Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[XP] Saving Characters and Equipement as Variables

So let's say I want to make different stories in one game, like an hour I play with Character 1, then I want to switch as character 2, and be doing that a lot in the game.
How do I save them and their equipement as variables?
 

khmp

Sponsor

As long as you don't overwrite the variable later. Use the "Script..." event command and input the lines below:

Code:
# Where "x" is the variable index you 
# want to save the character data to 
# Ex: $game_variables[1]
#
# Where "n" is the actor in your party 
# you want to save the data from. 
# Ex: $game_party.actors[0]
#
$game_variables[x] = 
$game_party.actors[n]

Then when you want to restore that data just juxtapose the variable and the actor. Word of the day is juxtapose! *AHHHHHH*

Good luck with it Forsaken_Shadow! :thumb:
 
Uh.. you don't really need to do all that. The game automatically saves the player's equipment when you take them out of the party.

Just use a "Change Party Member" command (I think it's on the first page) to remove the first party member, and add the second. Remember when you're adding to uncheck "Initialize" or the player will go back to level 1.
 

khmp

Sponsor

Regimos":vf95di57 said:
Uh.. you don't really need to do all that. The game automatically saves the player's equipment when you take them out of the party.

Just use a "Change Party Member" command (I think it's on the first page) to remove the first party member, and add the second. Remember when you're adding to uncheck "Initialize" or the player will go back to level 1.

Touche :lol:
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top