How do I with Player States and Timer with button spam?

Get help using Construct 2

Post » Thu Aug 11, 2016 9:55 pm

Hello all, I'm here trying to create a certain type of dash involving Instance Variables(player states) with a Timer(dash timer) and triggering it with "On Button press". Problem with this is, if you spam the button rapidly(dash button), there is a chance the player will get stuck in Player State 1(dash state). Its a little to fast for me to see exactly where the problem is. If anyone can tell me what im missing here, I would appreciate it.

here is the capx.
https://www.dropbox.com/s/ilpmdx6plklp0 ... .capx?dl=0

pic
http://imgur.com/a/h4p3u
B
13
S
4
Posts: 29
Reputation: 933

Post » Thu Aug 11, 2016 10:16 pm

"Trigger once" is meant to be paired with a condition, not used on it's own. Drag the code in event 9 to event 7 and it works.
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Thu Aug 11, 2016 11:00 pm

blackhornet wrote:"Trigger once" is meant to be paired with a condition, not used on it's own. Drag the code in event 9 to event 7 and it works.


You are amazing!. And yeah i been using a bunch of those trigger once's like that and pulling my hair out on some things haha. One other thing is, Is there any way to retrigger this dash during the dash itself? But not have the dash stop upon releasing the dash button. thanks again.
B
13
S
4
Posts: 29
Reputation: 933

Post » Thu Aug 11, 2016 11:36 pm

To make the timer accumulate, move the Space trigger out and add the current-time to your timer.
http://www.blackhornettechnologies.com/ ... s_BHT.capx
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Fri Aug 12, 2016 1:16 am

blackhornet wrote:To make the timer accumulate, move the Space trigger out and add the current-time to your timer.
http://www.blackhornettechnologies.com/ ... s_BHT.capx


Not exactly what i had in mind but still interesting. Little embarressed to mention this but i'm kinda looking for Castlevania style dash. The vania dashes dont cancel upon release of dash button(unlike mmx style dash), but can retrigger durring the dash or cancel into other states. There is a pause there as well(where player isnt continously moving if retriggering the dash) which im guessing to "set vector X 0" before each dash. gonna be trying more things. I'm just so grateful u helped me get rid of the frozen Instant Variables ;)

Edit: something kinda like this but looking for a way not to use that 3rd state i just added.

Capx: https://www.dropbox.com/s/baxkemawba97w ... .capx?dl=0
B
13
S
4
Posts: 29
Reputation: 933

Post » Fri Aug 12, 2016 1:56 am

:? I don't see a third state.
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Fri Aug 12, 2016 2:07 am

blackhornet wrote::? I don't see a third state.

sorry sorry, hopefully this is it lol. its a bit confusing for me to achieve this type of dash without using that 3rd state for a bit of delay on retrigger or else it just acts like its in state 1 whole time while retriggering the dash.

Capx: https://www.dropbox.com/s/pclpeby41n98h3i/NEW.capx?dl=0
B
13
S
4
Posts: 29
Reputation: 933

Post » Fri Aug 12, 2016 2:31 am

Just move the events in event 13 to 11. state 3 isn't needed.
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Fri Aug 12, 2016 3:03 am

blackhornet wrote:Just move the events in event 13 to 11. state 3 isn't needed.


Thanks a bunch, guess im over thinking a bit or just not thinking of simple solutions. Is hard to find good help like this, you saved me a lot of trouble :D
B
13
S
4
Posts: 29
Reputation: 933


Return to How do I....?

Who is online

Users browsing this forum: koops and 7 guests