Character Rotations in Battle (similar to Dragon Ball Z Dokkan Battle)

Discussion in 'RGSS3 Script Requests' started by Corboblan, Apr 20, 2019.

  1. Corboblan

    Corboblan Villager Member

    Messages:
    6
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMVXA
    Hi this is an obscure question. I want to make a fun and innovating battle system similar to where your team in Dragon Ball Z Dokkan Battle consists of 7 characters to use in battle using RPG Maker VX ACE. Each turn you use 3 characters since these don't divide evenly, you will not always have the same characters next to each other when they come up.

    If possible, when entering the battle, their positions will appear in a random order instead of in that normal same formation. The reason this happens is so characters can use their "link skills" to buff themselves if the character next to them has the same link skill. Would it also be possible to get change up each of the character's positions before attacking?

    So without changing any position the rotation goes like this:

    Turn 1 - Characters 1, 2, 3
    Turn 2 - 4, 5, 6
    Turn 3 - 7, 1, and 2
    ... and so on going in numerical order.

    With changing, a rotation could hypothetically go like this:

    Turn 1 - Characters 2, 3, 1
    Turn 2 - 4, 5, 6
    Turn 3 - 7, 2, 3
    Turn 4 - 1, 4, then 5

    I hope this makes sense. Please feel free to ask if there are any questions. Thanks in advance for any responses!
     
    #1
  2. ZirconStorms

    ZirconStorms VX & VX Ace Scripts Veteran

    Messages:
    321
    Likes Received:
    104
    First Language:
    English
    Primarily Uses:
    RMVXA
    You'll need to be crafty with common events and eventing in general.
    https://forums.rpgmakerweb.com/index.php?threads/swapping-actors-in-battle.17940/
    code reformatted because original posts are broken. Credit Yato if you use it just to be safe.
    Code:
    # Script by: Yato (https://forums.rpgmakerweb.com/index.php?members/yato.587/)
    # Credit if used.
    # Script call to use: $game_party.swap_members(id1, id2)
    # - id1 is the database number of the actor that will be swapped.
    # - id2 is the database number of the actor you want to swap with.
    
    class Game_Party < Game_Unit 
      #-------------------------------------------------------------------------- 
      # * Change Members 
      #-------------------------------------------------------------------------- 
      def swap_members(id1, id2)   
        i = @actors.index(id1)   
        @actors[i] = id2 unless @actors.include?(id2) or i == nil   
        $game_player.refresh   
        $game_map.need_refresh = true 
      end
    end
    Then do a ton of conditional branches/common event programming to check who is in what formation and do fitting script calls:
    https://forums.rpgmakerweb.com/index.php?threads/character-dialog-dependant-on-party-leader.16033/
     
    #2
  3. Corboblan

    Corboblan Villager Member

    Messages:
    6
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMVXA
    This looks perfect! I'll check it out. Thank you so much!
     
    #3
    ZirconStorms likes this.

Share This Page