Eventing a Battle System - fixing a key press issue

lithkast

Quirky mini boss
Veteran
Joined
May 12, 2014
Messages
105
Reaction score
49
First Language
english
Primarily Uses
So I'm trying to see how much of an Action Battle System I can make without using any third party scripts.  Its more of a test for me to see how far I can get with just eventing, so that maybe in the future I wont have to use as many scripts.  So anyways, here is the problem I'm encountering.

Yurei has a punch attack.  You press the A key and she punches.  This is how I have the common event set up currently.

Event name: Punch Effect / Trigger: Parallel Process / Condition Switch: Fist@>Conditional Branch: The A Button is Being Pressed @>Control Switches: [0997:punch] = On #turns the event on the map on @>Control Variables: [0003:Character location X] = Player's Map X @>Control Variables: [0004:Character location Y] = Player's Map Y @>Conditional Branch: Player is Facing Down @>Control Variables: [0004:Character location Y] += 1 @>Set Event Location: [Punch], Variable [0003][0004] @>Set Move Route: player : :$>Stepping Animation ON @>Show Animation: [Punch], [Pierce Physical], Wait @>Set Move Route: Player : :$>Stepping Animation OFF @> : Branch End @>Conditional Branch: Player is Facing Left @>Control Variables: [0004:Character location X] -= 1 @>Set Event Location: [Punch], Variable [0003][0004] @>Set Move Route: player : :$>Stepping Animation ON @>Show Animation: [Punch], [Pierce Physical], Wait @>Set Move Route: Player : :$>Stepping Animation OFF @> : Branch End @>Conditional Branch: Player is Facing Right @>Control Variables: [0004:Character location X] += 1 @>Set Event Location: [Punch], Variable [0003][0004] @>Set Move Route: player : :$>Stepping Animation ON @>Show Animation: [Punch], [Pierce Physical], Wait @>Set Move Route: Player : :$>Stepping Animation OFF @> : Branch End @>Conditional Branch: Player is Facing Up @>Control Variables: [0004:Character location Y] -= 1 @>Set Event Location: [Punch], Variable [0003][0004] @>Set Move Route: player : :$>Stepping Animation ON @>Show Animation: [Punch], [Pierce Physical], Wait @>Set Move Route: Player : :$>Stepping Animation OFF @> : Branch End @>Control Switches: [0997:punch] = OFF @>: Branch end@> ok, to explain that common event up there.  When you hold A, the event gets the players X and Y position and stores them in variables.  It also turns on a switch that turns on an event on my map.  The event on the map activates when another event touches it (the enemies) and will do damage to said enemies.  

Then the event checks the characters direction.  If facing down, it adds 1 to the Y coordinate, sets the event (punch, the damaging event) location to the coordinates, activates the stepping animation (to look like the character is punching), uses an animation, turns off the stepping animation, and wait 10 frames.

The common event works fine, I just need help with one small detail.  I don't want the event to continually run if you hold the button.  I want it to run on button press.  So one punch per button press.  Can't figure out how to do that for the life of me so any help would be appreciative.  

Thanks!
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,537
Reaction score
4,992
First Language
English
Primarily Uses
RMVXA
Try changing the Conditional Branch from "Button Press" to "Script" and entering the following: Input.trigger?:)A)

Not sure whether it will work with your event structure, but if I were to script such an input check, that's how I'd do it, so I think it will work and it's by far the simplest way if it does.
 

lithkast

Quirky mini boss
Veteran
Joined
May 12, 2014
Messages
105
Reaction score
49
First Language
english
Primarily Uses
That worked.  Thank you very much.  
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

We are truly intellectuals.
Without using violence without weapons
Our group has as many as 1.3 million people and more than 1 hundred thousand talks.
We gathered in an hour, more than 4.5 Half a hundred thousand



I got a Sword.
I got an Axe.
I got two Swords.
Nothing to see here, just walking with my dog.
I haven’t worked on my game in a while. Tomorrow might be the day.
*squeals* :kaoblush:


I've been experimenting with improved memory management again, which allowed me to include items to increase player path length. These are both 44 grid spaces long, and stable. :LZSexcite:
I FINALLY DID IT! 5 years making my very first game and I just officially released it on STEAM..... OMG..... I can say I finished a game! The feelings!!!!!

Forum statistics

Threads
104,463
Messages
1,006,474
Members
135,971
Latest member
Akasheee
Top