Saving Temporary Actors' Data
#1
Saving Temporary Actors' Data


I'm not following the usual scripting format for this is just a scriptlet.

Well, you should know by now that it is possible to "save" data before you enter a battle... yeah by means of calling a script!

You can save the very same $game_party data BEFORE your enter the battle and without creating a saved file. In case the team loses, you would just retrieve everything from the temporary variables you would have created, i.e. $game_temp_party.

The Script to be Pasted on your Script Editor

Code:
class Game_TempActors
 attr_reader :actors, :items, :weapons, :armors
 def initialize
   @game_actors = $game_actors.clone
   @actors = $game_party.actors.clone
   @items = $game_party.items.clone
   @weapons = $game_party.weapons.clone
   @armors = $game_party.armors.clone
 end
end

class Game_Party
 def reset_data
   $game_actors = @game_actors#.clone
   @actors = $game_temp_actors.actors#.clone
   @items = $game_temp_actors.items#.clone
   @weapons = $game_temp_actors.weapons#.clone
   @armors = $game_temp_actors.armors#.clone
   $game_temp_actors = @game_actors = nil
 end
end

Script Call to Use Before Battle

$game_temp_actors = Game_TempActors.new

Script Call to Use After Losing the Battle

$game_party.reset_data

or the following call if you won...

$game_temp_actors = nil

Terms & Conditions

You are free to use the way you like it, no restrictions apply here. Just keep in mind I won't be held responsible if you screw it! Laughing + Tongue sticking out
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }
#2
I have updated my script in order to make it compatible for all RGSS based RPG Makers.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   LILY'S MEGA DATA! DerVVulfman 1 6,891 08-28-2017, 08:07 PM
Last Post: EricandTheCheat
   Prompt for Overwrite Confirmation when Saving RPG Advocate 5 10,562 04-10-2016, 03:41 AM
Last Post: DerVVulfman
   DerVVulfman's Game Data Sneak DerVVulfman 1 7,469 04-03-2013, 08:42 PM
Last Post: Taylor
   Card Game Data Structure Trickster 5 11,464 12-09-2009, 06:38 PM
Last Post: Trickster
   Universal Data Back-Up Kain Nobel 2 7,121 04-19-2009, 12:33 PM
Last Post: Kain Nobel
   Temporary Save Script Anonymous 0 4,610 03-03-2008, 06:12 AM
Last Post: Anonymous
   Loading Data from File Trickster 0 5,206 03-02-2008, 06:04 AM
Last Post: Trickster



Users browsing this thread: 1 Guest(s)