YesNoOk
avatar

Change Helper (Read 202 times)

Started by LuigiMario, January 02, 2014, 04:36:43 pm
Share this topic:
Change Helper
#1  January 02, 2014, 04:36:43 pm
  • avatar
    • Afghanistan
    • axel201183@hotmail.com
So, what i want is to change helper after certain actions happens.

I have helper 500 in state 230. Helper 500 fires a projectile. I use command "hold_y" to shoot, just like a machine gun.

And i want the helper to change sprite after i fire 9 projectiles, like so:

fireball, fireball, fireball, fireball, fireball, fireball, fireball, fireball, fireball, bluefireball.

Also, i want to make the bluefireball to deal more damage than a regular fireball.

i hope i was clear enough of what i want, my english is not very good.

     Posted: January 02, 2014, 04:38:03 pm
i leave helper so someone can tell me what should i do to change sprite and hitdef:

;---------------------------------------------------------------------------
[Statedef 500]
type = A
ctrl = 0
anim = 290
velset = 4,0
movetype = A
physics = N
sprpriority = 5

[state a]
type = Trans
trigger1 = 1
trans = addalpha
alpha = 245,50

[state a]
type = nothitby
trigger1 = 1
value = SCA
time = -1

[state a]
type = hitby
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignorehitpause = 1

[state a]
type = hitoverride
trigger1 = 1
attr = SCA,NP,SP,HP
stateno = 511
ignorehitpause = 1

[State 210, 2]
type = HitDef
trigger1 = time = 1
attr = A, NP
animtype  = light
damage    = 1, 0
priority = 1, Hit
getpower = 1,0
givepower = 0,0
hitflag = MA
guardflag = MA
pausetime = 0,0
sparkno = s550
sparkxy = 0,0
hitsound   = s200,3
guardsound = s200,4
guard.sparkno = s555
ground.type = high
ground.slidetime = 0
ground.hittime  = 0
ground.velocity = 0
air.velocity = 0,0
yaccel = 0.47
air.fall = 0
fall.recover = 1
ID = 1000
nochainID = 9999
palfx.time =1
palfx.mul = 230,230,250
palfx.sinadd = 255,255,255,5;palfx.sinadd = 63,65,68,5
palfx.add = 16,16,16
palfx.color = 1
palfx.invertall = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0

[state a]
type = changestate
trigger1 = moveguarded
value = 510

[state a]
type = destroyself
trigger1 = movehit
trigger2 = frontedgedist <= -100
trigger3 = backedgedist <= -100
trigger4 = time = 150
Re: Change Helper
#2  January 02, 2014, 05:12:32 pm
  • **
  • NvP!
you should code them as a helper, not as a projectile, cuz then you could easily use this code
[State 0, BlueFireBall]
type = ChangeAnim
triggerall = NumHelper( put here the id of the fireball ) >9
trigger1 = Anim!= Animation number of the blue fireball
value = Animation number of the blue fireball
Re: Change Helper
#3  January 02, 2014, 05:51:38 pm
  • avatar
    • Afghanistan
    • axel201183@hotmail.com
you should code them as a helper, not as a projectile, cuz then you could easily use this code
[State 0, BlueFireBall]
type = ChangeAnim
triggerall = NumHelper( put here the id of the fireball ) >9
trigger1 = Anim!= Animation number of the blue fireball
value = Animation number of the blue fireball


the code i put in the post is the code of the helper, im using stateno 500 as a helper state.
also, i tried your code, after the 9th fireball, the rest of the fireballs are blue, i just want to shoot one blue fireball after every 9 normal fireballs, not turn them all into blue fireballs.
Re: Change Helper
#4  January 02, 2014, 08:54:33 pm
  • **
  • NvP!
well then you need to give the 9th fireball a different ID
so then u could use this
[State 0, BlueFireBall]
type = ChangeAnim
triggerall = IsHelper( ID OF THE BLUE FIREBALL) = 1 && NumHelper( put here the id of the fireball ) >9
trigger1 = Anim!= Animation number of the blue fireball
value = Animation number of the blue fireball
Re: Change Helper
#5  January 03, 2014, 06:58:54 pm
  • avatar
    • Afghanistan
    • axel201183@hotmail.com
Im sorry, im new at this, where do i put the code? in the helper state? the state where the helper is activated?
Re: Change Helper
#6  January 03, 2014, 08:07:12 pm
  • **
  • NvP!
state of the fireball