Author Topic: [XP] Party Swap  (Read 10584 times)

Offline nathmatt

  • Chaos User
  • ******
  • Posts: 1289
  • LV: 114
  • Gender: Male
  • The Add_on King
    • View Profile
    • Nathmatt Productions
[XP] Party Swap
« on: May 07, 2010, 08:41:56 PM »
Party Swap
Authors: Nathmatt
Version: 1.01
Type: Party Controller
Key Term: Misc Add-on

Introduction
This script allows you have multiple parties and swap between the easily

Features

  • Allows creating a new party and storing the current along with the players position in a $game_variable
  • Allows swapping the current party and position of the player with a $game_variable
  • Allows combining the parties inventory and gold stored in the $game_variable to the party

Screenshots

no screenshot

Demo
no demo

Script

(click to show/hide)

Instructions
in the script

Compatibility
Should not have any compatibility issues

Credits and Thanks

  • Nathmatt
  • Blizzard for little tricks about party storing
  • lonely_cubone for asking how to combine the stored inventory and gold to the party

Author's Notes

If you have any suggestions or problems with the instructions post here
« Last Edit: June 14, 2011, 02:48:28 PM by nathmatt »
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script
(click to show/hide)

Offline lonely_cubone

  • Transcended Spirit
  • ***
  • Posts: 227
  • LV: 6
  • Gender: Male
  • OMG IT'S A CUBONE
    • View Profile
Re: [XP] Party Swap
« Reply #1 on: May 07, 2010, 09:40:13 PM »
Great script, exactly what I was looking for! *levels*

Offline SBR*

  • Chaos User
  • ******
  • Posts: 1195
  • LV: -7
  • Gender: Male
    • View Profile
Re: [XP] Party Swap
« Reply #2 on: May 10, 2010, 05:34:33 PM »
Nice system! I actually was thinking about making something like this too, but I didn't know that $game_party holds every data of a party (like gold and steps)  :shy:, and, actually, I didn't even think of using $game_party for the players  double:shy:... This could be perfectly used for RMX-OS as multiple file system (I think). That was my first intention for my idea anyway... But why are you using $game_variables[var_id].items in the beginning of method combine_party of module Party? What does it do anyway?

 -SBR*

EDIT: Level up!

Offline nathmatt

  • Chaos User
  • ******
  • Posts: 1289
  • LV: 114
  • Gender: Male
  • The Add_on King
    • View Profile
    • Nathmatt Productions
Re: [XP] Party Swap
« Reply #3 on: May 10, 2010, 06:47:11 PM »
That was put there during testing and i forgot to remove it.
Yes but i added the reader to the items, weapons, and armor at the end of the script.
« Last Edit: May 10, 2010, 06:49:28 PM by nathmatt »
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script
(click to show/hide)

Offline SBR*

  • Chaos User
  • ******
  • Posts: 1195
  • LV: -7
  • Gender: Male
    • View Profile
Re: [XP] Party Swap
« Reply #4 on: May 12, 2010, 10:37:43 AM »
Ah, now I see!

monstergrin

  • Guest
Re: [XP] Party Swap
« Reply #5 on: June 24, 2010, 04:14:58 AM »
Okay, I am something of a scripting noob, so this might be a really basic question. How do you create another party to switch to? I can see how these scripts let you save your current one, and switch from that one to another, but currently I can't figure out how to make that other one exist in the first place.

Offline nathmatt

  • Chaos User
  • ******
  • Posts: 1289
  • LV: 114
  • Gender: Male
  • The Add_on King
    • View Profile
    • Nathmatt Productions
Re: [XP] Party Swap
« Reply #6 on: June 24, 2010, 04:12:01 PM »
i forgot to add that this creates the new party

Code: [Select]
Party.new_party(var_id)
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script
(click to show/hide)

monstergrin

  • Guest
Re: [XP] Party Swap
« Reply #7 on: June 24, 2010, 06:34:24 PM »
Okay! I got it to work. But after I switch to the other party, there's no actor or position information saved for it so I just get a blank square moving around from the same place the previous party was before the switch. How do I make content for the new party? Where do I put that information? (If I am asking questions that are answered elsewhere, I apologise.)

Offline nathmatt

  • Chaos User
  • ******
  • Posts: 1289
  • LV: 114
  • Gender: Male
  • The Add_on King
    • View Profile
    • Nathmatt Productions
Re: [XP] Party Swap
« Reply #8 on: June 24, 2010, 06:53:29 PM »
just use the event command  add actor
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script
(click to show/hide)

monstergrin

  • Guest
Re: [XP] Party Swap
« Reply #9 on: June 24, 2010, 11:07:06 PM »
Wow, I don't know why that didn't occur to me. Anyway, the script works beautifully and does exactly what I need it to, so thank you very much!

Offline SilverShadow737

  • Trained Member
  • *
  • Posts: 30
  • LV: 2
  • Gender: Male
  • Yep
    • View Profile
Re: [XP] Party Swap
« Reply #10 on: June 14, 2011, 09:22:26 AM »
Sorry for the bump, but when I try to combine two parties I get an error, "undefined method 'items' for #<Array:0x29e61c8>
If I comment out the items line error I get the same thing but for 'weapons' for #<Array:0x29067c8>
Same for 'armors' for #<Array:0x2906dc8>
Same for gold for a different arry # basically the entire combine script doesn't work.
I'm running this out of a new project, so there are no edited or added scripts.
Ginyu Force Rules

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6591
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] Party Swap
« Reply #11 on: June 14, 2011, 10:06:32 AM »
Replace these lines of code
Code: [Select]
def self.combine_party(var_id)
    $game_variables[var_id].items.each_pair {| key, value |
    $game_party.gain_item(key, value)}
    $game_variables[var_id].weapons.each_pair {| key, value |
    $game_party.gain_weapon(key, value)}
    $game_variables[var_id].armors.each_pair {| key, value |
    $game_party.gain_armor(key, value)}
    $game_party.gain_gold($game_variables[var_id].gold)
  end

With this.
Code: [Select]
def self.combine_party(var_id)
    $game_variables[var_id][0].items.each_pair {| key, value |
    $game_party.gain_item(key, value)}
    $game_variables[var_id][0].weapons.each_pair {| key, value |
    $game_party.gain_weapon(key, value)}
    $game_variables[var_id][0].armors.each_pair {| key, value |
    $game_party.gain_armor(key, value)}
    $game_party.gain_gold($game_variables[var_id][0].gold)
  end

See if that works.

Offline nathmatt

  • Chaos User
  • ******
  • Posts: 1289
  • LV: 114
  • Gender: Male
  • The Add_on King
    • View Profile
    • Nathmatt Productions
Re: [XP] Party Swap
« Reply #12 on: June 14, 2011, 02:45:56 PM »
yea that should work i thought i tested this when i made it i guess not fully
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script
(click to show/hide)

Offline SilverShadow737

  • Trained Member
  • *
  • Posts: 30
  • LV: 2
  • Gender: Male
  • Yep
    • View Profile
Re: [XP] Party Swap
« Reply #13 on: June 14, 2011, 10:05:11 PM »
Works perfectly, thanks muchly!
Ginyu Force Rules