Combo Input Command

Get help using Construct 2

Post » Wed Jun 27, 2012 7:35 am

I'm trying to figure out how to do a combo for
example: Hold Shift and press, Forward, Forward, Jump = Something

Sorta Like Mortal Kombat if you dont press it in sequence fast enough it wont work thats what I want.



ThanksErndog2k2012-06-27 07:37:06
B
27
S
11
G
1
Posts: 246
Reputation: 5,048

Post » Wed Jun 27, 2012 3:33 pm

Bump
B
27
S
11
G
1
Posts: 246
Reputation: 5,048

Post » Wed Jun 27, 2012 3:56 pm

Create a variable that stores the different commands.

Maybe this is a bit complicated, but its off the top of my head.

Have a variable which counts down, lets call it V:Time.

Then have variables for each action, punch, jump, kick etc...

The Time value is constantly counting down.
When ever a key is pressed, V:Time is set to 5.
If punch is presses set V:Punch to +1
If another action is then pressed, for each action variable greater than 1, add 1, as well as adding to that action variable.
-----------
To demonstrate:

V:Time = 0
V:Punch = 0
V:Kick = 0
V:Jump = 0

>> Punch is pressed

V:Time = 5
V:Punch = 1
V:Kick = 0
V:Jump = 0

>> Punch is pressed again withing 5 seconds (Before V:Time =<0)

V:Time = 5
V:Punch = 3
V:Kick = 0
V:Jump = 0

>> Kick is pressed within 5 seconds

V:Time = 5
V:Punch = 4
V:Kick = 1
V:Jump = 0

>> Jump is pressed within 5 seconds

V:Time = 5
V:Punch = 5
V:Kick = 2
V:Jump = 1

>> Kick is pressed within 5 seconds

V:Time = 5
V:Punch = 6
V:Kick = 4
V:Jump = 2

>> Special move:

If shift is pressed and (V:Punch = 6) (V:Kick = 4) (V:Jump = 2) Perform special move XYZ

The V:Time is just to make sure the combo is done within the time, if V:Time ever =0 then reset all the other values.
---------------

Or something there abouts.Andeming2012-06-27 15:59:05
B
85
S
31
G
14
Posts: 106
Reputation: 16,440

Post » Wed Jun 27, 2012 4:21 pm

@Andeming

Thanks I'll give it a shot, n post back. The logic seems sound.
B
27
S
11
G
1
Posts: 246
Reputation: 5,048

Post » Wed Jun 27, 2012 6:35 pm

thats over complicating it. All you have to do is make a global var and everytime a control is pressed append its text to that global.

Then to see if the right combo has been entered you see if the global var = the required combo.

To give it a time limit on input you set the global var to "" every x amount of time thats passed. The longer that time is the more time you have to input the combos

The text your going to append to the global needs to be an identifier of the control used. Like L for left and R for right. You can use the whole name of the control like Punch or Kick but this stuff is all happening constantly so its best to keep it as short and identifiable as possible.
B
13
S
5
G
2
Posts: 306
Reputation: 3,262

Post » Wed Jun 27, 2012 11:01 pm

I basically combined both your ideas into a hybrid lol


Add 1 by N7Effect, on Flickr

Combo System1 by N7Effect, on Flickr

Every 1 Second: "Shift" is Down
   Add "+1" to value "Shift F F J"

Wen this group is beyond or greater then "3 seconds" all
variables reset to DEFAULT values "0" including itself.

Before Jump if first two variables are correct will cancel out the "just jumping while holding shift". Command, and complete.

Notice bottom pic, FrontJump is inverted to check if False. If "false" it will complete. If true will ignore and complete other.

If and only if combo done in correct order "Hold Shift + Front + Front + Jump" it will kill me lol.

you can easily change "Front" "Jump" "Hold Shift" detectors to punch kick etc... and add different Global Variable Combo Counters.Erndog2k2012-06-28 01:04:20
B
27
S
11
G
1
Posts: 246
Reputation: 5,048


Return to How do I....?

Who is online

Users browsing this forum: gregorysforster, WhosWho and 16 guests