Code for Slow p2

Started by icare26, February 13, 2020, 09:19:30 PM

Previous topic - Next topic

icare26

Please help me.

[Statedef 650];       
type = S
movetype= A
physics = S
velset = 0,0
ctrl = 0
anim = 650

[State 650]
type = Projectile
trigger1 = AnimElem = 25
ProjID = 3400
projanim = 3400
..........................

[state 650]
type = varadd
trigger1 = projhit3400 = 1
var(44) = 300
ignorehitpause = 1


and state-2 ------------------------------

[State -2]
type = pause
triggerall = var(44) = 300
trigger1 = gametime%3= 0
time = 1
movetime = 1

[State -2]
type = VarAdd
trigger1 = var(44) = 300
v = 2
value = -1


out works p2 slows down its movements !

My problem is that I would like it to only last 300ticks

but here player 2 remains slow indefinitely during the round !!

Can someone tell me where my error (s) is ???

Thnak you for answers.



XGargoyle

[State -2]
type = VarAdd
trigger1 = var(44) = 300
v = 2
value = -1

This triggers the first time that var(44)=300, but when var(44)=299 there's no code that keeps decreasing the value


XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!

icare26

should i put this so? 

trigger1 = var(44) <= 300

?

XGargoyle

you could have tested it instead of posting. That's how people learn.

Assuming that var(44) only goes from 300 to 0, you could use var(44)>0. If not, then you will need to specify the correct ranges


XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!

Odb718

So your original VarAdd, should probably be a varSet.
Your method could make var(44) sky rocket if that animation's elem 25 is long. Each tic it could be adding 300 to it.
Use DisplayToClipboard to see the value.

[State -2]
type = VarAdd
trigger1 = var(44) = 300
v = 2         ;What does Var(2) control??
value = -1

You could probably change
Spoiler: This (click to show)
    [State -2]
    type = pause
    triggerall = var(44) = 300
    trigger1 = gametime%3= 0
    time = 1
    movetime = 1
     
    [State -2]
    type = VarAdd
    trigger1 = var(44) = 300
    v = 2
    value = -1
Into
Spoiler: This (click to show)
    [State -2]
    type = pause
    triggerall = var(44) >= 1
    trigger1 = gametime%3= 0
    time = 1
    movetime = 1
     
    [State -2]
    type = VarAdd
    trigger1 = var(44) >= 1
    v = 44
    value = -1
vVv Gouken718 vVv SabreTooth718 vVv


icare26


"please,I have been working on my project for more than ten years, and I rarely post a help message, generally yes I do my research myself and test too."

Thank you for your answer.

[State -2]
type = pause
trigger1 = var(44)> 0
trigger1 = gametime%3= 0
time = 1
movetime = 1

[State -2]
type = VarAdd
trigger1 = var(44)> 0
v = 44  ; v= 2
value = -1   



icare26

Thank you XGargoyle and Odb718 ! ^^

It's good !