Change party formation with a button press

Discussion in 'RGSS3 Script Requests' started by Canini, Apr 10, 2018.

  1. Canini

    Canini Veteran Veteran

    Messages:
    973
    Likes Received:
    646
    First Language:
    Swedish
    Hello and thanks for looking! I need a really simple (hopefully) script. Say you have a game with two characters, lets call them X and Y. I need a script that changes their formation with the press of a keyboard button (Q). Hopefully these images are clear enough:

    [​IMG]
    X is in front. The player presses the Q button on their keyboard.

    [​IMG]
    Now Y is in front!

    [​IMG]
    If the player presses Q again X returns to the front.

    In other words, exactly what the change position in the default menu does but with the press of a button. The party will never have more than two characters.
     
    #1
  2. GuanyuMaker

    GuanyuMaker Veteran Veteran

    Messages:
    63
    Likes Received:
    73
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    #2
  3. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,644
    Likes Received:
    364
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    #3
    GuanyuMaker likes this.
  4. GuanyuMaker

    GuanyuMaker Veteran Veteran

    Messages:
    63
    Likes Received:
    73
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Oh. Im so sorry. Missed the thread. I've done something with script calls myself before for vxace but cant remember well how to do it. Basically you need to remove the first party member and add it back, however so long i dont touch vxace that i cant tell you exactly what to do.

    EDIT:
    I would create a parallel common event and put a conditional inside for the key you want to press for it. Inside the condition a script call with this:

    Code:
    temp = $game_party.members[0].id
    $game_party.remove_actor(temp)
    $game_party.add_actor(temp)
    
    Not sure if it will work as I dont have VXACE anymore to test it for you.
     
    Last edited: Apr 10, 2018
    #4
    Ebanyle and Canini like this.
  5. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,644
    Likes Received:
    364
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    If you use Yanfly Party system script, then Soulpour has a fix to allow party swap.
    By using script call $game_party.swap_order(n,n)
     
    #5
    Canini likes this.
  6. Harosata

    Harosata Dramatic Lightning's BFF Veteran

    Messages:
    240
    Likes Received:
    65
    First Language:
    English
    Primarily Uses:
    RMVXA
    Himework's Rotate Formation, which uses A and S to rotate party formation. Simply #comment out one of the calls on the bottom if you want only one button.
     
    #6
    Canini likes this.
  7. Canini

    Canini Veteran Veteran

    Messages:
    973
    Likes Received:
    646
    First Language:
    Swedish
    @Harosata

    Exactly what I was looking for! I actually managed to solve it myself by following @GuanyuMaker suggestion and using a common event, but the script should still be super useful for someone else having a set-up like this.
     
    #7
    GuanyuMaker likes this.

Share This Page