YesNoOk
avatar

Quick time events (Read 195 times)

Started by Borghi, July 30, 2012, 12:25:36 am
Share this topic:
Quick time events
#1  July 30, 2012, 12:25:36 am
  • ****
  • Happy release for you all!
    • Argentina
    • www.andresborghi.com.ar
Hello! I'm kinda back.

I'm making a small update of my game (The Black Heart) and I want to include a special move that works with quick time events. For starters, qtevents is this minigame kinda thing that you can see in resident evil 4/5 and god of war, where an animation is presented and suddenly you have to press the move displayed on screen to survive or to continue the combo.

I'm doing this:
I'm puttng p2 in a custom state.
then I set a var like this:

Code:
[State 0, VarSet]
type = VarSet
trigger1 = time = 80
v = 52
value = 1+(random/200)
persistent = 0

IIRC, it means that variable 52 will be randomly set between 1 and 6. this will represent 6 possible moves: back, forward, up, down, kick and punch.

then I have an explod that shows the needed movement depending on that variable so the player can see what he has to press.

and here comes the trouble.

the next step is to put a changetate that moves to the next phase if the qtevent is solved properly and other one that cuts the thing if you press the wrong key.

So, I've done this:

Code:
[State 0, ChangeState]
type = ChangeState
trigger1 = var(25)=1 && command = "holdback"
trigger2 = var(25)=2 && command = "holdup"
trigger3 = var(25)=3 && command = "holdfwd"
trigger4 = var(25)=4 && command = "holddown"
trigger5 = var(25)=5 && command = "x"
trigger6 = var(25)=5 && command = "y"
trigger7 = var(25)=6 && command = "a"
trigger8 = var(25)=6 && command = "b"
value = 210
ctrl = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = var(25)!=1 && command = "holdback"
trigger2 = var(25)!=2 && command = "holdup"
trigger3 = var(25)!=3 && command = "holdfwd"
trigger4 = var(25)!=4 && command = "holddown"
trigger5 = var(25)!=5 && command = "x"
trigger6 = var(25)!=5 && command = "y"
trigger7 = var(25)!=6 && command = "a"
trigger8 = var(25)!=6 && command = "b"
value = 240
ctrl = 0

State 210 represent success and 240 failure.

but whatever I push in the required moment, it always takes me to state 240 (failure).

what am I doing wrong?
      
Little John from the big castle, plays with little friend,
snip! snip! snip! off goes his head, bright red! bright red!
Re: Quick time events
#2  July 30, 2012, 01:44:06 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
You have set var(52) but you are testing on var(25)


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Quick time events
#3  July 30, 2012, 01:49:41 am
  • ****
  • Happy release for you all!
    • Argentina
    • www.andresborghi.com.ar
      
Little John from the big castle, plays with little friend,
snip! snip! snip! off goes his head, bright red! bright red!