New account registration is temporarily disabled.

[VXA] HELP WITH CONDITIONAL BRANCH BUTTON INPUT FOR DEFENDING

Posts

Pages: 1
So I am trying to make a game where enemies roam around and when they touch you, you battle them. I figure that will cut down on the annoyance caused by random encounters and allow for the player to know where the enemies are and either choose to sneak around them or go after them at their leisure.

However, I also want to implement a defense skill that at the press of the A button (the z key), the play will defend themselves. I want to have it that if the player touches the enemy while defending the enemy cries out and backs up, and I have that functional. My problem is, the way I have this set up is it is a toggle that if I press the key, it turns it on and if I press it again it turns it off... Only... it is not consistent. It is more likely to turn on and is next to impossible to turn it back off, leaving the enemy to constantly be crying out and running backwards whenever it touches the enemy.

So, what can I do? I want the enemy to touch the player, back up and then have the defending switch to turn off.

Here are images of the various eventing I am using:
This is the common event I am using:

This is the actual enemy:

This is the event I am using to call the common event:


Any help would be greatly appreciated! Thank you! :)
Marrend
Guardian of the Description Thread
21806
I'm wondering if you even need "Switch 3" to be turned on for that to function?

Anyway, I have to think this out some.

*Edit: I think I have this working? The only changes were to the common event. First, I made the trigger "None". The actual code I had looked like:

CONDITIONAL BRANCH (the A button is pressed)
CONTROL SWITCHES "Defense" = ON
ELSE
CONTROL SWITCHES "Defense" = OFF


*Edit2: Oh yeah, you wanted to cause the "defending" switch to be disabled after the monster backs off. Having monsters back off as long as the player has the A button pressed...

I guess the solution is more complicated than I thought.

Edit3: I suppose, rather than have the "defending" switch be turned off when players aren't pressing the A button, you might have to create another common event that shuts the "defending" switch off, and call it inside the monster event?
Thank you, that seems to be working, hahahaha.... I can't believe it was that simple. I'm probably going to switch it to another button other than the 'A' button, since that button is pressed so commonly.
Pages: 1