YesNoOk
avatar

Another Trigger Problem (Read 639 times)

Started by The Lord of the Flies, November 24, 2009, 06:15:11 pm
Share this topic:
Another Trigger Problem
#1  November 24, 2009, 06:15:11 pm
  • ****
  • Am I evil?
Yeah, I'm guetting used to this board :P.

Anyways, I've made a special win when you win with a certain hyper. Everything's fine, except for one thing: my character changes states in the time I DON'T want it to. As it says in the code, I want this state (the winpose) to last more than 200 ticks, then changestate to 180, which returns him to the same state. Bleh, here's the code.

[State 3301, ChangeState]   ;This starts everything.
type = ChangeState
trigger1 = AnimElem = 47 && WinKO
value = 185
ctrl = 0


;---------------------------------------------------------------------------
;God End Win
[Statedef 185]
type = S
ctrl = 1
anim = 183
velset = 0,0
sprpriority = -4

[State 185, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[State 185, AssertSpecial]
type = AssertSpecial
triggerall = PrevStateNo = 180
trigger1 = Time = [0,250]
flag = roundnotover

[State 185, CtrlSet]
type = CtrlSet
trigger1 = PrevStateNo = 180
value = 0

[State 185, ChangeAnim]
type = ChangeAnim
triggerall = PrevStateNo = 180
trigger1 = Time = 0
value = 183
elem = 17

[State 185, Win]   ;THIS BITCH DOESN'T WORK PROPERLY .V.
type = ChangeState
triggerall = PrevStateNo=3301
trigger1 = Time > 250
value = 180
ctrl = 0



[State 180, ChangeState] ;win by God End
type = ChangeState
trigger1 = PrevStateNo = 185
value = PrevStateNo

Sig made by TempesT :)
Last Edit: November 24, 2009, 07:09:49 pm by The Lord of the Flies
Re: Another Trigger Problem
#2  November 24, 2009, 06:25:33 pm
  • avatar
  • ******
Uh... Can you display prevstateno in the debug and turn it on to keep track exactly tick by tick in which state you are and which is the prevstateno ?
By it doesn't work, you mean it stays in state 185 ? Try to check the triggers by testing trigger1 = 1 instead of time > 250, things like that.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: Another Trigger Problem
#3  November 24, 2009, 06:35:31 pm
  • ***
  • Portrait maker/AI coder
    • Egypt
    • romeotantan.webs.com/
Try changing this:

Code:
[State 185, Win]   ;THIS BITCH DOESN'T WORK PROPERLY .V.
type = ChangeState
triggerall = PrevStateNo=3301
trigger1 = Time > 250
value = 180
ctrl = 0

With this:

Code:
[State 185, Win]
type = ChangeState
triggerall = StateNo = 185 && animetime = (the no of the tick you want the change in)
value = 180
ctrl = 0
Re: Another Trigger Problem
#4  November 24, 2009, 06:37:50 pm
  • avatar
  • ******
............. :omg:
triggerall = StateNo = 185 <= absolutely useless
 && animetime = (the no of the tick you want the change in) <= missing the fact that he wants it to happen only if the previous state number is 3301, the changestate must not happen if it isn't.
By the way, you probably got animetime wrong, animetime gives the time until the end of the animation, not the time passed since the beginning of the animation. It won't do anything relevant.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: Another Trigger Problem
#5  November 24, 2009, 06:53:38 pm
  • ****
  • Am I evil?
Uh... Can you display prevstateno in the debug and turn it on to keep track exactly tick by tick in which state you are and which is the prevstateno ?
The prevstate no is state 3301, no debug flood, eerr...what else are you asking for?

By it doesn't work, you mean it stays in state 185 ? Try to check the triggers by testing trigger1 = 1 instead of time > 250, things like that.
It foes from state 3301 to 185, then to state 180 and finally returns to state 185. The problem is, he goes from 185 to 180 "too early", kinda not respecting the triggers I put in the ChangeState.


Some screenies for moar help:

After this state/tick, rugal goes to state 185 (his ending pose), so no problem till now but...


Here, he's in state 185 (prevstateno being 3301), and all goes well till this point. Next tick will have him change abruptly to state 180 (which redirects him to state 185 but on another AnimElem), cutting off the full animation.

Err... if you need more info, let me know.




Sig made by TempesT :)
Re: Another Trigger Problem
#6  November 24, 2009, 06:58:52 pm
  • avatar
  • ******
Quote
Here, he's in state 185 (prevstateno being 3301), and all goes well till this point. Next tick will have him change abruptly to state 180 (which redirects him to state 185 but on another AnimElem)
... ? At what point does prevstateno equal 3301 AND time has a chance of reaching 250 ? If you mean you don't want it to go to 180 too early... that's inbuilt, that's how the engine works, the character goes to state 180 when he wins, that's the roundstate. You can't change that. What you have to do is put a changeanim triggered correctly and not put the "anim" parameter in the state definition.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: Another Trigger Problem
#7  November 24, 2009, 07:09:14 pm
  • ****
  • Am I evil?
Very well then. I adjusted the coding. I was with the idea that you COULD delay reaching state 180, thus, the trigger with the time > 250.
Thx.

Sig made by TempesT :)