Page 1 of 1
earthquake.scr
Posted: Fri Aug 20, 2004 8:15 am
by G3mInI
If I have a player targeted in script using local.player = parm.other, can I make just that one players' screen shake by lets say adding some lines like:
Code: Select all
self waitexec global/earthquake.scr .3 1 0 0
self waitexec global/earthquake.scr .3 .75 0 0
self waitexec global/earthquake.scr .3 .3 0 0
Will that cause just the one players' screen to shake or will all the players' screen shake that are in the server? Keep in mind this is for a server side mod to a stock map. I want to accomplish this while the player is standing inside a trigger_multiple.
G3mInI
Posted: Fri Aug 20, 2004 11:16 am
by jv_map
It will shake the view for all players.
Posted: Fri Aug 20, 2004 6:07 pm
by G3mInI
Not possible at all to shake just one screen or a few but not all ?
Posted: Fri Aug 20, 2004 6:49 pm
by jv_map
Hey.. I didn't say that
s/th like this will shake a player's view just a little, you could easily adjust it to your needs though
Code: Select all
shakemyview local.player:
local.offset = (0 0 0) // make vector
for(local.i = 0; local.i <= 2; local.i++)
local.offset[local.i] = (randomfloat 2.0 - 1.0) * 5.0 // randnum [-5,5]
local.player.viewangles += local.offset // tilt view
waitframe
wait (randomfloat 1.0)
if(local.player != NIL && isAlive local.player)
local.player.viewangles -= local.offset // reset view
end
Posted: Sat Aug 21, 2004 4:32 am
by G3mInI
Sweet! Now I have some new commands to study. .. lol ... half of that is greek to me. Such as += and -= ... never seen those used. And why the wait randomfloat instead of just wait 1?
Nevertheless I will make use of this little tidbit. I just like to understand what is I am using.
G3mInI
Posted: Sat Aug 21, 2004 10:16 am
by Angex
G3mInI wrote:+= and -= ... never seen those used.
These operators are a "short hand" way of writing the following expressions:
Code: Select all
// local.number += 1 is equivalent to the line below.
// It means add one to local.number, and store the result in local.number.
local.number = local.number + 1
// local.number -= 1 is equivalent to the line below.
// It means minus one from local.number, and store the result in local.number.
local.number = local.number - 1
I'm guessing the random number is used to make the screen shake more varied, otherwise a shake of the same magnitude would look the same everytime (which is a bit boring).
Posted: Sat Aug 21, 2004 2:34 pm
by G3mInI
Thanks angex. It all makes sense to me now.