ID:170392
 
I need help with a shaking effect for when a player transforms. Ive tried it myself, but I cant get it to work.
It's kinda cheasy...but hey it works =P http://developer.byond.com/hub/AbyssDragon/QuakeEffect
In response to N1ghtW1ng
ive actually tried that, but I keep getting a runtime at if(M.client == 1)return



In response to FiredGoku
Try

if(M.client) return
In response to XxDohxX
nope no good

runtime error: Cannot read null.client
proc name: Quake Effect (/proc/Quake_Effect)
source file: SSJ System.dm,42
usr: Steve (/mob)
src: null
call stack:
Quake Effect(null, null, 1)
Steve (/mob): Raise Anger()

is the runtime im getting. line 42 is the code I said on the previous message.
In response to FiredGoku
Put in the beginining if(M)...also, you have to show us more of it. Show us what you have.
In response to N1ghtW1ng
K here it is, its not completely done, but im trying to get the screen to shake when you transform to ssj for the first time.
mob
verb
Anger()
set name = "Raise Anger"
set category = "Commands"
var/title2 = "Raise Anger"
var/text2 = "What do you wish to raise your anger to? "
var/anger_level = input(usr, text2, title2) as text
usr.levelanger = anger_level

if(usr.levelanger == "10")
oview(6) <<"[src.name]'s power increases..."
usr <<"[usr.name]: AHHHH!!!!!!! Arrrrrrrrrr..."
sleep(30)
usr <<"AHHHHHHHHHHH!!!!!!!!"
if(usr.powerlevel >= 1000000)
if(usr.maxpowerlevel >= 1000000)
usr.chancetogossj = (rand(1,2))
if(usr.chancetogossj == 1)
Quake_Effect()//here is where it will start to shake
usr <<"I won't let you...!!Get away...with this!!ARRRR!!!!"
oview(6) <<"[src.name]'s hair begins to glow!"
sleep(30)
oview(6) <<"Lightning starts to form overhead!"
sleep(30)
oview(6) <<"The ground starts to rumble and crack!"
usr <<"I..WONT..LET YOU!!!"
sleep(30)
usr <<"AAAAAHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!"
oview(6) <<"[src.name] explodes into a ball of light!"
sleep(30)
if(usr.raceextra == "Royal")
view(6) <<"[src.name]: I am the prince of all Saiyans once again!"
if(usr.raceextra == "Normal")
view(6) <<"[src.name]: I am the hope of the universe! The result of all the innocent lives you stole!"
world <<"[src.name] has become a <font color = yellow>Super Saiyan</font>!"
else
if(usr.maxpowerlevel >= 500000)
usr.chancetogossj = (rand(1,50))//not complete yet
proc
Quake_Effect(mob/M,duration,strength=1)//not edited one bit
if(M.client == 1) return
spawn(1)
var/oldeye=M.client.eye
var/x
for(x=0;x<duration,x++)
M.client.eye = get_steps(M,pick(NORTH,SOUTH,EAST,WEST),strength)
sleep(1)
M.client.eye=oldeye
In response to FiredGoku
Um...that is not how you use a library. The library includes a file that shows you how to use the library!
In response to FiredGoku
You need to pass the mob that will see the quake effect into Quake_Effect(). At the moment you're not passing anything to it, so M ends up null, and boom! Error.
In response to FiredGoku
FiredGoku wrote:
>   Quake_Effect(mob/M,duration,strength=1)//not edited one bit
> if(M.client == 1) return


If it's not edited one bit, then why is that "if(M.client == 1) return" line there? In the original code, it is:
if(!M.client)return
In response to Crispy
and how would I do that?
In response to FiredGoku
FiredGoku wrote:
and how would I do that?

Look at QuakeEffect's args.
In response to FiredGoku
mob
verb
Anger()
set name = "Raise Anger"
set category = "Commands"
var/title2 = "Raise Anger"
var/text2 = "What do you wish to raise your anger to? "
var/anger_level = input(usr, text2, title2) as text
usr.levelanger = anger_level

if(usr.levelanger == "10")
oview(6) <<"[src.name]'s power increases..."
usr <<"[usr.name]: AHHHH!!!!!!! Arrrrrrrrrr..."
sleep(30)
usr <<"AHHHHHHHHHHH!!!!!!!!"
if(usr.powerlevel >= 1000000)
if(usr.maxpowerlevel >= 1000000)
usr.chancetogossj = (rand(1,2))
if(usr.chancetogossj == 1)
Quake_Effect()//here is where it will start to shake
usr <<"I won't let you...!!Get away...with this!!ARRRR!!!!"
oview(6) <<"[src.name]'s hair begins to glow!"
sleep(30)
oview(6) <<"Lightning starts to form overhead!"
sleep(30)
oview(6) <<"The ground starts to rumble and crack!"
usr <<"I..WONT..LET YOU!!!"
sleep(30)
usr <<"AAAAAHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!"
oview(6) <<"[src.name] explodes into a ball of light!"
sleep(30)
if(usr.raceextra == "Royal")
view(6) <<"[src.name]: I am the prince of all Saiyans once again!"
if(usr.raceextra == "Normal")
view(6) <<"[src.name]: I am the hope of the universe! The result of all the innocent lives you stole!"
world <<"[src.name] has become a <font color = yellow>Super Saiyan</font>!"
else
if(usr.maxpowerlevel >= 500000)
usr.chancetogossj = (rand(1,50))//not complete yet
proc
Quake_Effect(mob/M,duration,strength=1)//not edited one bit
if(M.client == 1) return
spawn(1)
var/oldeye=M.client.eye
var/x
for(x=0;x<duration,x++)
M.client.eye = get_steps(M,pick(NORTH,SOUTH,EAST,WEST),strength)
sleep(1)
M.client.eye=oldeye


--

Its not working on my game is saying this error....


get_steps:undefined proc
In response to Destroior
This topic is like.... 10 months old.
In response to Xeal
Yeah. I didn't even read the other posts even though I see I replied =P. Well, I read the post that Xeal replied to. Get_Steps should be get_step. Also, when you call the quake proc, you need to pass the mob, strength and what ever else is needed.