Dodge/Dive in ARPG game

Get help using Construct 2

Post » Mon Aug 06, 2012 1:52 pm

Hi. I'm doing an ARPG in the style of Zelda (LttP), a 3/4 overhead action-style game. I'm having, however, an awful lot of problems trying to get the controls down.

This is my problem: As you can see on the screenshot, I've set it up so the player loses the 8-dir control of the character and it instead switches to a bullet behavior, goes in the direction of the mouse for half a second, and then reverts to 8-dir. This is working pretty well as far as I'm concerned. The problem however, comes with the DodgeTimer variable.

I want the Dodge function to be disabled for a couple seconds, so I've set a variable. When the variable is not 0, an autonomous process should take care to reset it once enough seconds have passed. And the thing is, it works! At the first time. Then I'm able to click without the function being disabled for some time (the text box I set to monitor the variable shows a '3' briefly, but quickly reverts back to 0), and then it works again. And then it will do the same thing again.

So what's the problem here? The processes are correct as far as I can tell, and it works flawlessly except for 4 times out of 5, when the counter just resets to 0 without waiting for the seconds.
I'd be really thankful if anyone pointed out the problem for me.

Here's the screenshot.

B
3
Posts: 6
Reputation: 287

Post » Mon Aug 06, 2012 1:55 pm

Sorry, here's the real one.

B
3
Posts: 6
Reputation: 287

Post » Mon Aug 06, 2012 1:57 pm

Goddammit... u___u.

Clickable version.

B
3
Posts: 6
Reputation: 287

Post » Mon Aug 06, 2012 3:39 pm

Try changing your DodgeTimer reset event to this:

Conditions
System -> Every 1 Seconds
System -> DodgeTime > 0

Actions
Subtract 1 from DodgeTimer

Tis will count down the DodgeTimer by 1 second every second, rather than waiting and setting to 0.

The reason I think you are having problems is because your event is running every tick because your condition is true, so in 3 seconds at 60fps it's called 180 times. The one called at tick 1 will set DodgeTimer to 0 at the same time the one at tick 180 is called, i.e. at 3 seconds, but the ones called at all the ticks will still be waiting. So, every tick between 3 seconds and 6 seconds after the event conditions were first true, DodgeTimer will be set to 0.OddConfection2012-08-06 15:49:27
Vote for all the Construct 2 games on Steam Greenlight - Find them here
B
27
S
7
G
4
Posts: 314
Reputation: 4,928

Post » Mon Aug 06, 2012 5:06 pm

Gonna try that when I get home. I pretty much suspected the cause was that I was essentially strapping lightbulb to a nuclear reactor-- too much power to make it work confortably.

Also, I've found this, which could potentially save me a good chunk of hassle in that respect, considering I want to make heavy use of cooldown mechanics in general. Thanks a lot! :DOttomatic2012-08-06 17:07:05
B
3
Posts: 6
Reputation: 287


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 20 guests