Touch Surprise Battles

Discussion in 'JS Plugin Releases (RMMV)' started by DreamX, Jan 12, 2016.

  1. DreamX

    DreamX Veteran Veteran

    Messages:
    816
    Likes Received:
    812
    First Language:
    English
    Touch Surprise Battles v1.4
    By DreamX

     
    Introduction/Features
    Events labeled with <enemy:1> will use their direction and the player's direction to decide whether their battle processing command results in a preemptive, surprise, or normal battle. You can also force the next evented battle to be preemptive, surprise or normal.


    Patch Notes


    v1.4a (1/23/16): Fixed compatibility for Orange Custom Events.


    v1.4 (1/23/16): Added compatibility for Orange Custom Events.


    v1.3 (1/16/16): Added parameters for back preemptive/surprise battles chance.


    v1.2 (1/14/16): Plugin commands now apply to touch <enemy:1> events.


    v.1.1 1/12/16: Fixed bug with maps that don't have all events sequentially ordered (for example, if you delete an event) and added compatibility for Sanshiro's Map Generator.


    How to Use
    Right click the script link and select save link as.


    Make sure to set the switches in the parameters or the script won't do anything.
    Put <enemy:1> into an event so that when the player and it touches, it'll set the next battle type depending on how they touched (you touch their back = preemptive, they touch your back =  surprise, otherwise = normal). In addition, surprise battles may occur when the enemy touches the player from the side or preemptive battles if vice versa. Set the chance of this occuring in the parameters.

    The following plugin commands do not apply to random battle encounters you get from walking around on the map (it does apply to battle processing event commands that are "same as random encounter," though).


    Plugin Commands:
    ForceSurpriseBattle - Forces the next battle to be surprise.
    ForcePreemptiveBattle - Forces the next battle to be preemptive.
    ForceNormalBattle - Forces the next battle to be normal.


    ResetBattleType - Removes the forced state. If the event is labeled <enemy:1>, the battle type will be decided by direction again.


    Script


    Credit and Thanks
    - DreamX


     Script portions used, modified or referenced in this plugin: Jeneeus Guruman - Preemptive-Surprise Event Battle:
            Jene.gameInterpreterCommand301
            Jene.gameCharacterBaseSetDirection
            Game_Interpreter.prototype.preemptiveOrSurprise


    Author's Notes/Terms of Use
    Free to use and modify for commercial and noncommercial games, with credit.


    You should credit Jeneeus Guruman for the referenced script.
     
    Last edited by a moderator: Jan 24, 2016
    #1
  2. matthew30903

    matthew30903 Veteran Veteran

    Messages:
    82
    Likes Received:
    31
    Location:
    United States
    First Language:
    English
    Thank you for sharing, it works perfectly so far.
     
    #2
    DreamX likes this.
  3. Val

    Val Veteran Veteran

    Messages:
    275
    Likes Received:
    162
    First Language:
    Français
    Sorry to ask but what need to be set in the plugin to make it work? 

    I tried to add the number of switch to use but this seem not to work :(  

    What I'm missing? thank you 
     
    #3
  4. DreamX

    DreamX Veteran Veteran

    Messages:
    816
    Likes Received:
    812
    First Language:
    English
    Put in the switch numbers and make sure <enemy:1> is in the notetag of the event and that you have a Battle Processing in the event.
     
    #4
    Val likes this.
  5. Val

    Val Veteran Veteran

    Messages:
    275
    Likes Received:
    162
    First Language:
    Français
    It's working WONDERFUL!!! My game will be so much awesome now another great mechanic :D

    Humm I think I have found a bug

    I trying with the plugin command : ForceNormalBattle on a event who got the tag <enemy:1> but the fight never trigger normal if I touch the event in the back. Is it normal? 

    thx!
     
    Last edited by a moderator: Jan 14, 2016
    #5
    DreamX likes this.
  6. DreamX

    DreamX Veteran Veteran

    Messages:
    816
    Likes Received:
    812
    First Language:
    English
    -outdated-
     
    Last edited by a moderator: Jan 15, 2016
    #6
    Val likes this.
  7. Val

    Val Veteran Veteran

    Messages:
    275
    Likes Received:
    162
    First Language:
    Français
    Hi

    Its because im using the same event for more then one battle and sometime I Want to be sure the 2nd or 3rd battle is normal or other event if its labelled enemy:1.

    Can you please update your script so the plugins command overwrite the system for the next battle event please? :)
     
    #7
    DreamX likes this.
  8. DreamX

    DreamX Veteran Veteran

    Messages:
    816
    Likes Received:
    812
    First Language:
    English
    A new version has been uploaded. The plugin commands will apply to events labeled with <enemy:1> too now. Make sure to go into the parameters and set the new parameter "Force Switch" to a switch id (that isn't being used for anything else).
     
    #8
    Val likes this.
  9. Val

    Val Veteran Veteran

    Messages:
    275
    Likes Received:
    162
    First Language:
    Français
    Awesome!! it's work perfectly :) thx again for you time and sharing skill coding ultimate helper :)  

    It's really cool to have the good feeling now in my project, I will let you know when I will have updated everything ;)  

    Good job!
     
    #9
    DreamX likes this.
  10. Val

    Val Veteran Veteran

    Messages:
    275
    Likes Received:
    162
    First Language:
    Français
    Question DreamX ?

    Is it possible for you to add a parameter where we can set a % to the battle to be ForceNormal even if the player have touched the Event on the Back?

    Because I want to not Always give the player the big advantage of Surprise Attack on enemy if he touch them on the back. (More like 55%-75%)

    thank you in advance :D  
     
    #10
  11. DreamX

    DreamX Veteran Veteran

    Messages:
    816
    Likes Received:
    812
    First Language:
    English
    The plugin has been updated with parameters to set the % chance of causing a surprise or preemptive battle when touched from the back. You might need to delete the plugin from the plugin list and reenable it to get it to work.
     
    #11
    Val likes this.
  12. Val

    Val Veteran Veteran

    Messages:
    275
    Likes Received:
    162
    First Language:
    Français
    Thank you that a really nice to have for your plugins! I hope you will continue develop great plugins for RPG Maker MV :)  
     
    #12
    DreamX likes this.
  13. BloodletterQ

    BloodletterQ Chaotic Neutral Assassin Veteran

    Messages:
    1,450
    Likes Received:
    1,047
    Location:
    My head's in the clouds at least...
    First Language:
    English
    Primarily Uses:
    N/A
    Much appreciated.
     
    #13
    DreamX likes this.
  14. matthew30903

    matthew30903 Veteran Veteran

    Messages:
    82
    Likes Received:
    31
    Location:
    United States
    First Language:
    English
    Thank you for the plugin.


    I may have found an incompatibility or bug. I set up an event spanner using Orange Custom Events and it crashes. This error did was not occurring before. It seems to only happen with events spawned from other maps. This happens with all battle events spawned this way, not just ones with the "enemy:1" notetag.


    View attachment Suprise Spawn Crash.PNG


    If you have the time I uploaded an image of the crash and error. It would be greatly appreciated if you can fix this.
     
    #14
    DreamX likes this.
  15. DreamX

    DreamX Veteran Veteran

    Messages:
    816
    Likes Received:
    812
    First Language:
    English
    This was an incompatibility rather than a bug. I have made the plugin compatible with the new version. Thank you for finding this and let me know if you have any other issues.


    Make sure that this plugin is below Orange Custom Events in the plugin list order.
     
    Last edited by a moderator: Jan 24, 2016
    #15
  16. matthew30903

    matthew30903 Veteran Veteran

    Messages:
    82
    Likes Received:
    31
    Location:
    United States
    First Language:
    English
    Thank you for the quick reply, it still does not seem to be working, but I am still getting bugs on my end.


    Suprise Spawn Crash.PNG
     
    #16
    DreamX likes this.
  17. DreamX

    DreamX Veteran Veteran

    Messages:
    816
    Likes Received:
    812
    First Language:
    English
    This time I tested the plugin with an event from another map. It appears to be working now as of the latest update.
     
    Last edited by a moderator: Jan 24, 2016
    #17
  18. matthew30903

    matthew30903 Veteran Veteran

    Messages:
    82
    Likes Received:
    31
    Location:
    United States
    First Language:
    English
    It works now, thank you.
     
    #18
    DreamX likes this.

Share This Page