Updating variables after battle.

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

  1. DyingDutchman

    DyingDutchman Warper Member

    Messages:
    1
    Likes Received:
    0
    First Language:
    Dutch
    HI all!


    I am trying to make my game work with Gameus's Quest System, and for now, it works like a charm. However, there is one problem regarding gathering quests. I got these really MMO'ey gathering quests in my game that involves getting certain loot from monsters you encounter. It is quite simple to script these events in order to work. Gameus's System however also tracks the progress of these quests in a quest log. For that to work i would have to update a certain variable after an item has been obtained in battle. That way the log always stays up to date.


    Of course i can put an event in every room that continiously checks these items every tick, but that means that every time i make a new gathering quest, I will have to copy and paste this event in every map. I imagine there is a much simpler way of achieving this. Could anyone provide me with some much needed help? Thanks in advance!  :D
     
    Last edited by a moderator: Jul 6, 2016
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    28,132
    Likes Received:
    6,372
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    If you want to do something after each battle (like updating variables), there is a trick to have a common event run exactly once after each battle.


    1) name/reserve a switch "after battle".


    2) in every troop, make a troop event on turn 0 to control on that switch (you might consider looking for a script that executes troop-one-events on every troop, that way you don't have to add that troop event everywhere).


    3) make a common event, set it to parallel process and condition it to the "after battle"-switch.


    4) after adding whatever you want to do after each battle, the last command on that common event has to be control switch "after battle" = OFF.


    Parallel processes are stopped on any screen, including the battlescreen - so the common event parallel process will not get executed during battle, even if activated on first battleturn. However, it will be executed as soon as the battle is over and the player returns to map - and since it switches itself off, it will only be executed once (no need for a lagging constant parallel everywhere)
     
    #2

Share This Page