ID:157807
 
I am trying to make a transformation code that goes through each stage in order.For example: To get to ssj 3 you must first go through stages ssj 1-2.

Here is what i have now
mob
SsjTransform
verb
SsjTransform()
set category="Fighting"
set name="Super Sayain Transformation"
if(usr.stamina>=3)
if(usr.ssj==0)
if(usr.maxpowerlevel>=300000)
usr.ssj=1
usr.underlays=0
usr.powerlevel+=usr.maxpowerlevel*2.5
sleep(10)
usr << "HAAAAA"
usr.underlays+='ssjaura.dmi'
oview(5) <<sound('powerup.WAV')
usr.overlays+='hair_super_saiyajin_Goku.dmi'
if(usr.ssj==1)
if(usr.maxpowerlevel>=1000000)
usr.ssj=2
usr << "Haaaaaaaa.."
oview(3)<<"You feel [usr] energy rising.."
usr << "You acend to the next level..SuperSayainTwo"
usr.underlays=0
usr.overlays-='hair_super_saiyajin_Goku.dmi'
usr.powerlevel+=usr.maxpowerlevel*3.5
sleep(10)
usr.underlays+='ssjaura.dmi'
oview(5) <<sound('powerup.WAV')
usr.overlays+='hair_ssj_goku.dmi'
if(usr.ssj==2)
if(usr.maxpowerlevel>=55000000)
usr.ssj=3
usr << "<H1>Haaaaaaaa..</H1><H2>Haaaaaaaaa</H2>"
oview(3)<<"You feel [usr] energy rising exponentially..."
usr << "You acend to the next level..SuperSayainThree"
usr.underlays=0
usr.overlays-='hair_ssj_goku.dmi'
usr.powerlevel+=usr.maxpowerlevel*4.5
sleep(10)
usr.underlays+='ssjaura.dmi'
oview(5) <<sound('powerup.WAV')
usr.overlays+='ssj3.dmi'
if(usr.ssj==3)
if(usr.maxpowerlevel>=12000000)
usr.ssj=4
usr.underlays=0
usr.overlays-='ssj3.dmi'
usr << "You have fully mastered your abilities"
usr.powerlevel+=usr.maxpowerlevel*5.6
sleep(10)
usr.underlays+='ssjaura.dmi'
oview(5) <<sound('powerup.WAV')
usr.icon_state="SuperSaiyan4"
verb
Revert()
set category="Fighting"
set name="Super Sayian Revert"
if(usr.ssj>0)
usr.ssj=0
usr.underlays=0
usr.overlays=0
usr << "You begin to calm down."
usr.icon_state=""
usr.powerlevel=usr.maxpowerlevel
usr.ki=usr.maxki
I have to guess at what you want but... from what I can tell, your trying to make an "Incredible Hulk" system with 3 stages.

SsjTransform()
spawn()
Mob_TryTransform1()

mob
Mob_TryTransform1()
// perform checks
// perform animations
// output text relative to transform 1
// sleep for a second
// Mob_TryTransform2()
Mob_TryTransform2()
// perform checks
// perform animations
// output text relative to transform 2
// sleep for a second
// Mob_TryTransform3()
Mob_TryTransform3()
etc


If you don't want the user to do anything else while performing this action, leave out the spawn. If the user doesn't meet your criteria, just return to end the chain.

ts
In response to Tsfreaks
I wouldn't call myself a professional coder, but when I look at that code what I see is when the player hits SsjTransform he'll instantly goto Super Saiyan 3.

mob
verb
SsjTransform()
if(usr.stamina < 3)
return
if(usr.ssj = 0)
if(maxpowerlevel < 300000)
return
//Super Saiyan 1 script
if(usr.ssj = 1)
if(maxpowerlevel < 1000000)
return
//Super Saiyan 2 script
if(usr.ssj = 2)
if(maxpowerlevel < 55000000)
return
//Super Saiyan 1 script
In response to Railon
Yes that is my problem, i want the player to hit the first two stages first before going on to their 3rd transformation.
mob
SsjTransform
verb
SsjTransform()
set category="Fighting"
set name="Super Sayain Transformation"
if(usr.stamina>=3)
if(usr.ssj==0)
src.SS1()
if(usr.ssj==1)
src.SS2()
if(usr.ssj==2)
src.SS3()
if(usr.ssj==3)
src.SS4()

Here my new coding but it still has the same issue.
In response to Tsfreaks
No , this code just take me straight to stage 3. i want stage 1[stop] stage 2[stop] stage 3[stop], etc.Basically the usr goes through each stage with every click.
mob
SsjTransform
verb
SsjTransform()
set category="Fighting"
set name="Super Sayain Transformation"
if(usr.stamina>=3)
if(usr.ssj==0)
src.SS1()
return
if(usr.ssj==1)
src.SS2()
return
if(usr.ssj==2)
src.SS3()
return
if(usr.ssj==3)
src.SS4()

HAha i think i solved my problems
mob
SsjTransform
verb
SsjTransform()
if(usr.stamina>=3)
if(usr.ssj==0)
if(usr.maxpowerlevel>=300000)
//Point at which usr.ssj is set to 1
usr.ssj=1
//End of the point =)
if(usr.ssj==1)
//Here is where you make your mistake, you can clearly see before this if(), it sets usr.ssj to 1, so of course this check will be true, instead you need only to un indent this line, and add a return at the end, like so...


mob
SsjTransform
verb
SsjTransform()
set category="Fighting"
set name="Super Sayain Transformation"
if(usr.stamina>=3)
if(usr.ssj==0)
if(usr.maxpowerlevel>=300000)
usr.ssj=1
return
if(usr.ssj==1)
//However, this will still leave you with problems, and isn't too great a system anyway...


mob
SsjTranform
verb
SsjTransform()
set category="Fighting"
set name="Super Sayain Transformation"
if(usr.stamina>=3)
if(usr.ssj==0)
if(usr.maxpowerlevel>=300000)
usr.ssj=1
return
if(usr.ssj==1)
if(usr.maxpowerlevel>=5500000)
usr.ssj=2
// this instead of usr.ssj2=1 means that usr.ssj doesn't == 1, and therefor it doesn't repeatedly go to level two.
if(usr.ssj==2)
//ect


This still isn't the method that I would personally use, but it's crude and effective none the less