Parallel Event processing during battles

Discussion in 'RPG Maker MV' started by Kip, Jul 6, 2016.

  1. Kip

    Kip Veteran Veteran

    Messages:
    32
    Likes Received:
    11
    First Language:
    English
    My goal is to Create a custom battle system in which each attack uses a small "mini game" to determine whether or not the attack will be a success or a failure.


     


    I will gladly commission any coder/scripter who thinks they might be able to help me accomplish this goal. If you are interested in taking my money, please don't hesitate to message me with your estimate for the cost!


     


    I would prefer this solution to come in the form of a plugin so that I might be able to share this with the rest of the RPG Maker MV community


     


    I am using a series of pictures and Common Events to create my own HUD. My issue occurs because My hud will rely on multiple Common Events running in parallel with one another during a battle scene. In order for my HUD to work properly, they must continually be checking the status of variables in the background simultaneously with one another and updating their graphics according to what their variable is set to at any given moment.


     


    This is the sort of animation that I am going for.


    Animation.gif


     


    You can see screenshots of the common events I used to make this happen along with descriptions for what each event is responsible for below:



    THE BATTLE GAUGE COMMON EVENT:


    I have 3 different common events that work together in order to make my battle gauge function:


    This Common Event is responsible for the background picture of the Gauge. It also displays the "sweet spot" graphic and the Full timer Graphic.


    Battle Gauge Common Event Screen Shot Pt1


    Battle_Gauge_Common_Event_01.png


    Battle Gauge Common Event Screen Shot Pt2


    Battle_Gauge_Common_Event_02.png


    This event is always looping, and always checking to see if the "OK" button is pressed down. If the "OK" button is pressed down, this Common event will add +4 to the "gauge" variable and wait 1 frame before checking again. If the "ok" button is released it will subtract -4 from the "gauge" variable and wait 1 frame before checking again.


    It will also stop the "gauge" variable from going beyond a specific values (both plus and minus) if the ok button is held down for too long or released for too long.


    THE CURSOR COMMON EVENT:


    This Common Event controls the cursor image. All it does is tell the cursor to appear on the screen based on what value the "gauge" variable event from above is currently at. 


    Cursor Common Event Screen Shot


    Cursor_Common_Event_01.png


    THE GAUGE TIMER COMMON EVENT:


    And this Common Event is for the Timer. It starts the "Gauge Timer" variable at 180 and then subtract -1 from that variable. It will wait 1 frame and repeat the process. It will also display different amounts of the timer graphic based on what number the "Gauge Timer" variable is currently set to. 


    Gauge Timer Common Event Pt1


    Gauge_Timer_Common_Event_01.png


    Gauge Timer Common Event Pt2


    Gauge_Timer_Common_Event_02.png


    Gauge Timer Common Event Pt3


    Gauge_Timer_Common_Event_03.png


    At the end, when the "Gauge Timer" variable has hit zero, this Common Event will go back and check to see what the original "gauge" variable (that changes when you press the "OK" button) is set to. If that "gauge" variable is within a specific range (the range that lines up with the "sweet spot" graphic) then this Common Event will reset all variables to their original states and display a "success" message. If the "gauge" variable is outside the "sweet spot" range then a "failed" message will appear instead.


    EXAMPLES OF THE FINAL PRODUCT (IN BATTLE) :


    This is what my current implementation looks like during battles because these 3 common events cannot run parallel with one another.


    Animated Battle Gauge Example (In Battle)


    Special_Move_Description_01.gif


    You'll be able to tell that There is no timer graphic running because battles do not allow for the Common event that is checking to see if the "OK" button is pressed to run at the same time as the Common Event that is counting the time. Because of this, I get stuck in this screen, unable to move the battle forwards since it is continually looping the event that watches the ok button. Since the timer event is not running, the timer never hits zero. Because the timer never hits zero, the event is never stopped.


    EXAMPLES OF THE FINAL PRODUCT (OUTSIDE BATTLE) :


    This is what it should look like if it were working correctly (done outside of battle so that the events run parallel)


    Animated Battle Gauge Example (Functioning properly, Outside Battle)


    Special_Move_Description_02.gif


    As you can see, I've got all the eventing set up correctly to make this all happen...it's just the limitation of RPG maker's battle system that's holding me back...


     


     


    PLUGINS THAT I AM AWARE OF THAT DO NOT SOLVE MY PROBLEM:


     


     


     


    It is my understanding that Hime's "Global Common Events" Plug in can allow me to do this:


    http://himeworks.com/2013/04/global-common-events/


    Sadly As you will see in the comments below, I was informed that this script was designed for RPG Maker VX Ace and will not work with MV. I have attempted to contact Hime through his "contact me" page on his website, but he hasn't gotten back to me.


     


    I have also been made aware of a relatively new plugin called "Timed Attack Core" by "SumRndmDde" that will, at first glance, provide very similar functionality to what I am looking for, but it doesn't quite fit the bill either:


    Timed Attack Core


     


    The issue with this plugin is that it is too specific. It will only allow you moves that vary in damage and will not activate/deactivate switches, nor will it control variables. A plug in that would allow you to run Common events in parallel during battle scenes would open up a huge world for RPG maker developers.
     
    Last edited by a moderator: Jul 25, 2016
    #1
    JLowther likes this.
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    That is an Ace script, not an MV plugin.  You won't be able to use it in MV, and will need to search around to see if Hime or anyone else has ported it.
     
    #2
  3. Kip

    Kip Veteran Veteran

    Messages:
    32
    Likes Received:
    11
    First Language:
    English
    aahhh...Well thank you! You seem to be very helpful <3


    I'll see if maybe I can get into contact with Hime, maybe he will let me commission him for an MV compatible version!
     
    #3
  4. Andar

    Andar Veteran Veteran

    Messages:
    28,004
    Likes Received:
    6,328
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    Common event parallel processes don't run during screens, you would have to use a troop event set to constantly check that.


    sorry - can't work out the details at the moment, you'll have to check how to do that for yourself.
     
    #4
  5. JLowther

    JLowther Veteran Veteran

    Messages:
    327
    Likes Received:
    34
    First Language:
    English
    I too would love to be able to do this.


    I have a few visual elements I'd like to have hover up and down slightly throughout the battle.


    Though, for a custom HUD, might want to check this one out: http://hudell.com/blog/mv-plugin-orange-hud/
     
    Last edited by a moderator: Jul 9, 2016
    #5
  6. Kip

    Kip Veteran Veteran

    Messages:
    32
    Likes Received:
    11
    First Language:
    English
    Right?


    Thank you for this link though! I think I can work with this! At least for stuff outside of battles =^.^=


    But yeah I'm still searching for a way to parallel process events during battles...I've sent an email to Himeworks a few days ago...but sadly they haven't been able to get back to me :/


    Honestly all I'm looking for is a way to take a common event with a parallel process trigger, and make it run in a battle in the same way it would on a map.


    Lets say a player is in the middle of a battle: Switch "1" is triggered: Parallel Common event "1" activates when switch "1" is triggered. Make the contents of common event "1" run continuously for as long as the trigger is active.


    What im trying to do is a special move in a battle that will bring up a gauge like this:


    https://drive.google.com/file/d/0B7j7ma3Mg-rDRFRpZVZwYV9RajQ/view?usp=sharing


    Imagine this animation happening every time you hit "Special Attack" If you hold down the "OK" button the cursor goes to the right If you let go of the "OK" button, the cursor falls back to the left You have to keep the cursor in the "sweet spot" until that timer bar at the bottom runs out. If the cursor is in the right spot, then you get a successful move! But if the cursor is outside the "sweetspot" when the timer ends, then the enemy gets a successful "dodge"


    I was able to use a series of pictures and events to make what you see in the gif above work flawlessly!...as an event on a map...But when I try and run the same event in battle, the variable that controls the "Timer" in the bottom most bar won't continually run in the background. I can either run the "timer" or I can run the "cursor" animation one at a time during the battle, but not both concurrently with one another.
     
    #6
    JLowther likes this.
  7. Kip

    Kip Veteran Veteran

    Messages:
    32
    Likes Received:
    11
    First Language:
    English
    Honestly, at this point I am willing to pay money for someone to be able to help me achieve this. I feel like I can't be the only one looking to be able to Parallel process multiple common events at once during a battle without having to wait for each turn to pass for something to refresh.


    If anyone could provide a link to any scripters/coders that would be willing to take my money as a commission for a plugin that could allow for this to happen. I would gladly pay and share the plugin with the world!
     
    Last edited by a moderator: Jul 9, 2016
    #7
  8. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    just report the thread and ask for it to be moved to Classifies - also edit your first post and state how much you're willing to pay to have it done.
     
    #8
  9. JLowther

    JLowther Veteran Veteran

    Messages:
    327
    Likes Received:
    34
    First Language:
    English


    I'm kinda surprised that this doesn't exist already.


    It seems like running parallel events during battles would be something that would be almost necessary...
     
    Last edited by a moderator: Jul 12, 2016
    #9
  10. TakeHomeTheCup

    TakeHomeTheCup Veteran Veteran

    Messages:
    242
    Likes Received:
    451
    First Language:
    English
    Well, you can always just program what you want.


    It is better than using events.
     
    #10
  11. JLowther

    JLowther Veteran Veteran

    Messages:
    327
    Likes Received:
    34
    First Language:
    English


    I can't, personally.


    I don't know JS well enough to do anything beyond extracting variable values, really.
     
    #11
  12. Andar

    Andar Veteran Veteran

    Messages:
    28,004
    Likes Received:
    6,328
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    No - parallel processes are simply not intended to be used in battles at all.


    What you do instead is use troop events set to a span of moment.
     
    #12
    JLowther likes this.
  13. JLowther

    JLowther Veteran Veteran

    Messages:
    327
    Likes Received:
    34
    First Language:
    English


    Could this be used to, say, have the Y coordinate of something on screen constantly oscillate up and down, even while idle? I've tried this but any event set to the span of a moment cycles endlessly and locks down the interface...


    My goal is to add a hovering effect to numbers that will remain above the heads of actors/enemies in battle.


    I've seen plugins that do this for certain things (like Yanfly's breathing effect for animated battlers), but I'm guessing this is tied deeper into the way the game handles the refreshing system for on screen elements and simply adding it to another element would be difficult. :\
     
    Last edited by a moderator: Jul 12, 2016
    #13
  14. Kip

    Kip Veteran Veteran

    Messages:
    32
    Likes Received:
    11
    First Language:
    English
    JLowther is right, you can't use troop events for events that you want to continually run in the background because the battle will get stuck on that loop forever and never move on to the next event. And if you exit the loop you are no longer running the variable witch is no good either.


    For me, I need a timer running constantly in the background. a variable that it just continually going up until it reaches 300. But I need that timer to be running WHILE a second, completely separate event is happening at the same time. If I set up the timer in troop events then the game gets stuck running the timer until the timer is over before moving on to the second event. If I try setting up the second event in troop events, the game will get stuck on this event because it only ends when the timer reaches 0. Since the timer can not run at the same time as the event, it never reaches zero. 


    We need parallel events because we need two events to be running at the same time.
     
    #14
  15. Tairo

    Tairo Villager Member

    Messages:
    8
    Likes Received:
    4
    First Language:
    English


    While I think multiple parallel events at once could be very useful, I don't think you need it here. Looking at your screenshots, I see you have 2 events where you initialize values and then loop something, and a third event which just displays an image (probably doesn't need to be it's own event, but I digress...).


    I don't have a plugin for you, but I do I see 2 possible solutions to your problem. (I am very new to rpg maker, but I do know coding, so I think one of these may work for you.)


    First, instead of using a switch to trigger the timer from the battle gauge event, why not simply start the timer event manually/directly (like you did with the cursor event)?


    Second, you could combine them into 1 event. You'd place the first line of the timer before the loop in the gauge event, then copy everything from inside the loop of the timer event to before the "Repeat Above" line in the gauge event.


    For an example of what I mean by combining them (simplified as pseudo-code):


         timer = 180


         *show pictures*


         Loop


             *code from the gauge event*


             *code from the timer event*


         Repeat Above


    It may not be the exact answer you were looking for, but I think either of these could work.
     
    Last edited by a moderator: Jul 31, 2016
    #15
  16. Kip

    Kip Veteran Veteran

    Messages:
    32
    Likes Received:
    11
    First Language:
    English


    You...You are quite possibly a genius ^.^;


    I feel like there was some reason why I had broken this up into 3 different events, but to be quite honest it's been a few weeks since I put these events together. It's possible that I just had a specific idea in mind as to how I was going to do things and tunnel visioned in on that.


    I'm going to try combining the events together like you mentioned and see if it still works properly! If it does, I will definitely post within a day or two and let you know how it goes!


    Thank you so much for your suggestion! I have literally been grasping at straws trying to make this work and was starting to get discouraged! If this works it will be a huge amount of progress for me!
     
    #16
  17. Tairo

    Tairo Villager Member

    Messages:
    8
    Likes Received:
    4
    First Language:
    English
    I'm glad I could help, and I hope it works the way you want it to.
     
    #17

Share This Page