CyberForte

PartySwapScripts

Feb 18th, 2017
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. # Use this to set the members of party one and party two. The actors in party one will be the elements of the
  2. # array $PartyOneMembers and similarly for the second in $PartyTwoMembers. Their ids are just the id from the actor
  3. # list, starting from 1. In the example, I've used actors 1-5 for party one and 6-10 for party
  4. # two. You can just put this as a script in the eventing menu at the start of the split
  5. # section. Also, the order the IDs are in here will determine the initial party orders. I wrote
  6. # this for two equal parties of five, but it should be easily adapted to any size. Just add extra
  7. # entries to the appropriate array at initialization and tweak the script below.
  8. $PartyOneMembers = Array.new([1, 2, 3, 4, 5])
  9. $PartyTwoMembers = Array.new([6, 7, 8, 9, 10])
  10.  
  11. # Now, for the events that swap the party, this script call records the current order of party
  12. # one, then removed it and adds party two based on the stored order. Put this in the event that
  13. # swaps party one to party two. If you added more or less than 5 members in party one, just add
  14. # an extra definition or remove the last, etc.
  15. $PartyOneMembers[0] = $game_party.members[0].id
  16. $PartyOneMembers[1] = $game_party.members[1].id
  17. $PartyOneMembers[2] = $game_party.members[2].id
  18. $PartyOneMembers[3] = $game_party.members[3].id
  19. $PartyOneMembers[4] = $game_party.members[4].id
  20. # Replace the removed actor ids here with the ids of the actors in party one. If you have more
  21. # than five in party one, add extra copies of $game_party.remove_actor(n)
  22. $game_party.remove_actor(1)
  23. $game_party.remove_actor(2)
  24. $game_party.remove_actor(3)
  25. $game_party.remove_actor(4)
  26. $game_party.remove_actor(5)
  27. # If party two is more than 5 members, then add 5, 6, 7... to the [] as needed.
  28. for n in [0, 1, 2, 3, 4]
  29. $game_party.add_actor($PartyTwoMembers[n])
  30. end
  31.  
  32. # And this one does the same, only storing party two and swapping in party one:
  33. $PartyTwoMembers[0] = $game_party.members[0].id
  34. $PartyTwoMembers[1] = $game_party.members[1].id
  35. $PartyTwoMembers[2] = $game_party.members[2].id
  36. $PartyTwoMembers[3] = $game_party.members[3].id
  37. $PartyTwoMembers[4] = $game_party.members[4].id
  38. # Replace the removed actor ids here with the ids of the actors in party two. If you have more
  39. # than five in party two, add extra copies of $game_party.remove_actor(n)
  40. $game_party.remove_actor(6)
  41. $game_party.remove_actor(7)
  42. $game_party.remove_actor(8)
  43. $game_party.remove_actor(9)
  44. $game_party.remove_actor(10)
  45. # If party one is more than 5 members, then add 5, 6, 7... to the [] as needed.
  46. for n in [0, 1, 2, 3, 4]
  47. $game_party.add_actor($PartyOneMembers[n])
  48. end
Advertisement
Add Comment
Please, Sign In to add comment