[SOLVED]Battle Condition After Actions, Not Turns(Yanfly's STB)

Discussion in 'Javascript/Plugin Support' started by SmashArtist, May 20, 2019.

Thread Status:
Not open for further replies.
  1. SmashArtist

    SmashArtist Lazy Artist Veteran

    Messages:
    556
    Likes Received:
    1,004
    First Language:
    English
    Primarily Uses:
    RMMV
    Hello!
    I made a game and implemented Yanfly's Standard Turn Battle System plugin as I like being able to have the characters instantly carry out their chosen actions in battle. Unfortunately I came into a problem when trying to create a new system into my project.

    Here's how it works:

    The player has to inflict a certain state on an enemy so that another enemy has it's immortal state removed.

    Problem:

    I need this condition to run after any actor or enemy action so that the other enemy instantly becomes vulnerable to any attack the next actor performs(before the turn ends). MV has conditions only for turns, but not actions by default, and turns only end after every actor has performed.

    I was hoping someone would find a way so that I could have a common event(or battle event) run once every action(or at the end of every action).

    If anyone could help it would be most appreciated! :kaohi:
     
    #1
  2. SmashArtist

    SmashArtist Lazy Artist Veteran

    Messages:
    556
    Likes Received:
    1,004
    First Language:
    English
    Primarily Uses:
    RMMV
    Bump~
     
    #2
  3. Andar

    Andar Veteran Veteran

    Messages:
    27,987
    Likes Received:
    6,321
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    that should be handled by the span of the troop event - I don't think that yanfly had changed that.
     
    #3
  4. SmashArtist

    SmashArtist Lazy Artist Veteran

    Messages:
    556
    Likes Received:
    1,004
    First Language:
    English
    Primarily Uses:
    RMMV
    How would I handle this then?
    I've tried using the 'turn' conditions, however this only triggers after every actor /enemy has performed their move. Did Yanfly provide a way to have it happen only after each action? I must have missed it. D:
    Not exactly sure how I could make this work, help would be appreciated! :kaoswt2:

    Edit:
    You bringing this up gave me a lightbulb moment. I've been avoiding using the 'moment' span in troops due to my brain not comprehending how to stop it from repeating constantly and getting the whole battle stuck. I think I may have figured out how it works, will check it out tomorrow. If it works I'm going to feel so dumb. XD
     
    Last edited: May 30, 2019
    #4
  5. Andar

    Andar Veteran Veteran

    Messages:
    27,987
    Likes Received:
    6,321
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    As your edit shows you realised that the span defines how often a troop event and its conditions are checked.
    Battle: Once per battle
    Turn: Once per turn
    Moment: Once per action

    For anything set to Moment you need to make sure that it cannot be stopped - checking values and changing other things should not be a problem, but anything including wait, show text or so on has a high risk of going wrong if you aren't carefull with the conditions.
     
    #5
    SmashArtist likes this.
  6. SmashArtist

    SmashArtist Lazy Artist Veteran

    Messages:
    556
    Likes Received:
    1,004
    First Language:
    English
    Primarily Uses:
    RMMV
    Managed to figure it out!
    Solution:
    1. Had skill(the one that applies the state) run a common event that turns on a switch to let the troop event know the state MAY be applied.
    2. Have a troop event that's condition is set to the switch and has a span of 'moment'
    3. In the event check if the enemy has the state applied, if yes, remove the immortal state and turn off the switch. If not, turn off the switch to stop the event from continuously running.
    I did add an extra event to check if the state has been removed and to add the immortal state again, however this used a 'turn' span and was pretty easy to figure out.

    Thanks again Andar for your help!
    Now I shall wallow in shame about how simple this was. :kaocry:
     
    #6
  7. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,146
    Likes Received:
    10,310
    First Language:
    English
    Primarily Uses:
    RMVXA

    This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

     
    #7
Thread Status:
Not open for further replies.

Share This Page