ID:141418
 
Code:
proc
Quake_Effect(mob/M,duration)
if(!M.client)return
spawn(1)
var/original=M.client.eye
var/a
for(a=0;a<duration,a++)
M.client.eye = get_step_rand(M)
sleep(1)
M.client.eye=original


Problem description:
When ever I use my technique, it gives me an error that says
"runtime error: Cannot read null.client
proc name: Quake Effect (/proc/Quake_Effect)
source file: magic.dm,81
usr: Alex (/mob)
src: null
call stack:
Quake Effect(null, null)
Alex (/mob): Exploding Tag()"

M and duration aren't defined right, look at where you call the proc.
That demo is somewhat outdated anyway; you can use the client's relatively new pixel_x and y vars for finer shaking of less than 32 pixel jumps.
In response to Kaioken
Yea, i tried editing the demo a bit and just made it worst, so i got the Client one and mixed it up a bit and it works perfectly, even though sometimes it shakes up so much that my character goes out of screen lol. Thanks any ways guys..

Edit:
New Problem -_-
proc
Quake_Effect(client/C,duration,strength)
spawn(1)
var/list/oldE = list("x"=C.pixel_x,"y"=C.pixel_y)
for(var/i=0;i<=duration;i++)
var/random = pick(1,0)
if(random)
C.pixel_x+=strength
else
C.pixel_x-=strength
random = pick(1,0)
if(random)
C.pixel_y+=strength
else
C.pixel_y-=strength
sleep(1)
C.pixel_x = oldE["x"]
C.pixel_y = oldE["y"]

Problem:
When the proc is activated, it works normally but when it finishes, the screen is at a different location, and if used enough, you won't be able to see your character... -_-
In response to Scarymonkeys623
Scarymonkeys623 wrote:
Yea, i tried editing the demo a bit and just made it worst, so i got the Client one and mixed it up a bit and it works perfectly, even though sometimes it shakes up so much that my character goes out of screen lol. Thanks any ways guys..

Edit:
New Problem -_-
> proc
> Quake_Effect(client/C,duration,strength)
> spawn(1)
> var/list/oldE = list("x"=C.pixel_x,"y"=C.pixel_y)
> for(var/i=0;i<=duration;i++)
> var/random = pick(1,0)
> if(random)
> C.pixel_x+=strength
> else
> C.pixel_x-=strength
> random = pick(1,0)
> if(random)
> C.pixel_y+=strength
> else
> C.pixel_y-=strength
> sleep(1)
> C.pixel_x = oldE["x"]
> C.pixel_y = oldE["y"]
>

Problem:
When the proc is activated, it works normally but when it finishes, the screen is at a different location, and if used enough, you won't be able to see your character... -_-

Yeah, scrap that, I hate it. It's so ugly, I made it ages ago. Scrap it hard please.

Haywire
In response to Haywire
lol, there are only 3 demos i could find and every time I try to make one myself i screw my self over by wasting more time doing the impossible >>
In response to Scarymonkeys623
Scarymonkeys623 wrote:
lol, there are only 3 demos i could find and every time I try to make one myself i screw my self over by wasting more time doing the impossible >>

client
proc
Earthquake(duration,dizzyness)
for( var/x = 1 to duration )
pixel_y = 0
pixel_x = 0
var/changeVars = pick( list( "pixel_x", "pixel_y" ),
list( "pixel_x" ),
list( "pixel_y" ),
)

for( var/v in changeVars )
vars[v] = rand( -32, 32 )

sleep( dizzyness )

pixel_x = 0
pixel_y = 0

Written by Metamorphman. I modified it a tiny bit, not enough to mention. It's client based of course, here is an example:

mob
Login()
..()
sleep(10)
client.Earthquake(30,1)


Have fun, Haywire.