[XP] Save File System

Started by shdwlink1993, July 26, 2008, 06:59:24 am

Previous topic - Next topic

shdwlink1993

Thanks for catching so many of my stupid errors, shadonking. Very nice of you! I got that one, so now the files will display correctly. The problem was exactly the same as the one before it. -_- Oh well. It works a bit better (hopefully bugfree!) now.
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Shadonking

ok its done, yay. if i get any other problems later on i'll tell you.

powerup

also if you need any scripts testing just pm me the script and i'll test it for you a tell you if it has bugs and problems or if i works perfectly.





Creator Of Music And Games
Spoiler: ShowHide
]

keywords: ShowHide
rmxp rmvx blizz-abs rpg maker xp vx abs cbs cms script tons of addons charsets autotiles HUD


come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

Fantasist

Well shdw, I got to admire your guts. I wonder how long you've been working on this. Making a system like this is too much for how lazy I am (-_-)' *powers up*
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




shdwlink1993

Thanks, Fantasist! I appreciate the compliment and the powerup, although I wonder where this x-ray camera he's using to see my guts is...  :O_O:

And I haven't been working on it all that long. I think I started on it... a week before the first release, maybe?

If someone has an idea for the script, then please drop a line here or a PM... preferably here, and unless the idea is out of my league, I'll try and put it in.
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Fantasist

Hm, how about this, can you emulate the save scene from RM2k where the windows scroll? When I used RPG Advocate's savefile script a long time ago, I tried to do it but I couldn't. Of course, the windows scroll only if there are more than 4 save slots.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




TheHackMan

August 30, 2008, 04:23:51 pm #45 Last Edit: August 30, 2008, 04:29:24 pm by TheHackMan
Just put this in there and the ARS portion of it is causing some problems.
Whenever you click on Retry or Quit the little box stays stuck on the screen as an image and you can't get it off. If you do something to die again or whatnot then a new one comes up and if you select the other one then you can see that both are there. So its not clearing away that box image after you make your selection to retry or quit.
Also there appears to be an issue with disabling ARS and whatnot as well. When I try setting it to false and then have a character die, each time it says: "Cannot update Temp Save File!\nPlease activate ARS and retry." Not sure if this is supposed to happen if its disabled but seems more like an error of some form.

shdwlink1993

Version 1.12b is out. This will hopefully fix the bugs that TheHackMan spotted. Thanks.

The first one was because I forgot to dispose of that window... Now I know what happens if you forget to do that xD. And the second one... is that when ALL the characters die or when just one dies? If it's the former, then that's hopefully been fixed. Otherwise, I have no clue. Tell me if the problem still happens.
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

TheHackMan

Just put in the new version and ran it through the paces that got the old bugs and tested it out in battle as well and all appears to be working now :D
Great job with the script, its going to come in handy at several points in the game 8)

Shadonking

September 05, 2008, 07:11:57 pm #48 Last Edit: September 08, 2008, 12:24:45 pm by shadonking
hello me agian.

iv just added a visual equipment script put it cuases problems with your save file system.

could you help make it compatible.

here is the error i get when i enter the save game or load game menu.



and here is the visual equipment  script

Spoiler: ShowHide
Quote#==============================================================================
# ? Visual_Equipment
# Written by Rataime
#
# Edit below
#
# Note : If you have a custom Window_SaveFile, check the one at the end of the scrîpt,
# add the added lines to yours, and delete the whole Window_SaveFile class here
#==============================================================================
def equip_update(light=false)

$visual_equipment=Array.new
$visual_equipment[0]=light
for i in 0..3
  $visual_equipment[i+1]=[]
end

#===================================================
# ? EDIT HERE !
#===================================================  

#If weapon n°33 is equiped, add the charset tpl_helmet_1.png (I don't have a weapon charset ><)
#add_weapon_sprite(33,"tpl_helmet_1")

#If weapon n°6 is equiped, add the charset tpl_helmet_1.png
add_armor_sprite(6,"tpl_helmet_2")

add_armor_sprite(7,"tpl_helmet_3")
add_armor_sprite(20,"tpl_armor_white")
add_armor_sprite(15,"tpl_armor_blue")
add_armor_sprite(21,"tpl_armor_cape")

#===================================================
# ? Visual_equip functions
#===================================================
   RPG::Cache.clear
   @game_party = $game_party
   @game_party = $game_party2 if $visual_equipment[0]
   for i in 0...@game_party.actors.size
     for img in $visual_equipment[i+1]
      bitmap = RPG::Cache.character(@game_party.actors.character_name, @game_party.actors.character_hue)
      if img!=true and img!=false
        add_equip(bitmap,img,i)
      end
     end
   end
end

  def add_equip(sprite,to_add,character)
  @game_party = $game_party
  @game_party = $game_party2 if $visual_equipment[0]
  bmp = Sprite.new
  bmp.visible =false
  bmp.bitmap = RPG::Cache.character(to_add,@game_party.actors[character].character_hue)
  color = bmp.bitmap.get_pixel(0, 0)
  x=sprite.width
  y=sprite.height
  if $visual_equipment[0]
   x=x/4
   y=y/4
  end
  for i in 0..x
   for j in 0..y
     color_get=bmp.bitmap.get_pixel(i, j)
     if color_get!=color
      sprite.set_pixel(i, j ,color_get)
     end
   end
  end

  bmp=nil

  end

  def add_weapon_sprite(id,sprite)
   @game_party = $game_party
   @game_party = $game_party2 if $visual_equipment[0]
   for i in 0...@game_party.actors.size
     if @game_party.actors.weapon_id==id
      $visual_equipment[i+1].push(sprite)
     end
   end
  end

  def add_armor_sprite(id,sprite)
   @game_party = $game_party
   @game_party = $game_party2 if $visual_equipment[0]
   for i in 0...@game_party.actors.size
     if @game_party.actors.armor1_id==id or @game_party.actors.armor2_id==id or @game_party.actors.armor3_id==id or @game_party.actors.armor4_id==id
      $visual_equipment[i+1].push(sprite)
     end
   end
  end

#===================================================
# ? CLASS Scene_Equip edit
#===================================================

class Scene_Equip

  alias visual_update_right update_right

  def update_right
   if Input.trigger?(Input::B)
     equip_update
     $game_system.se_play($data_system.cancel_se)
     $scene = Scene_Menu.new(2)
     return
   end
   visual_update_right
  end
      
end

class Interpreter

  alias visual_command_319 command_319

  def command_319
   actor = $game_actors[@parameters[0]]
   if actor != nil
     actor.equip(@parameters[1], @parameters[2])
   end
   equip_update
   return true
  end

end

class Game_Character
  attr_accessor :character_hue
end

class Game_Actor < Game_Battler
alias visual_setup setup
  def setup(actor_id)
   visual_setup(actor_id)
   @character_hue = (@character_hue+1)%256
  end
end

class Scene_Load
  alias visual_read_save_data read_save_data
  alias visual_on_cancel on_cancel

  def on_cancel
   equip_update
   visual_on_cancel
  end

  def read_save_data(file)
   visual_read_save_data(file)
   equip_update
  end
end

class Scene_Save
  alias visual_on_decision on_decision
  alias visual_on_cancel on_cancel

  def on_cancel
   equip_update
   visual_on_cancel
  end

  def on_decision(file)
   equip_update
   visual_on_decision(file)
  end
end

class Scene_Title
  alias visual_command_new_game command_new_game

  def command_new_game
   visual_command_new_game
   equip_update
  end

end

class Window_SaveFile < Window_Base

  def initialize(file_index, filename)
   super(0, 64 + file_index % 4 * 104, 640, 104)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.contents.font.name = $fontface
   self.contents.font.size = $fontsize
   @file_index = file_index
   @filename = "Save#{@file_index + 1}.rxdata"
   @time_stamp = Time.at(0)
   @file_exist = FileTest.exist?(@filename)
   if @file_exist
     file = File.open(@filename, "r")
     @time_stamp = file.mtime
     @characters = Marshal.load(file)
     @frame_count = Marshal.load(file)
     @game_system = Marshal.load(file)
     @game_switches = Marshal.load(file)
     @game_variables = Marshal.load(file)
     @self_variables = Marshal.load(file)#added
     @game_screen = Marshal.load(file)#added
     @game_actors = Marshal.load(file)#added
     $game_party2=@game_party= Marshal.load(file)#added
     @total_sec = @frame_count / Graphics.frame_rate
     file.close
   end
   equip_update(true)#added
   refresh
   @selected = false
  end

end






Creator Of Music And Games
Spoiler: ShowHide
]

keywords: ShowHide
rmxp rmvx blizz-abs rpg maker xp vx abs cbs cms script tons of addons charsets autotiles HUD


come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

shdwlink1993

Sorry for the long wait. This would just need a very small change to the Visual Equipment Script:

Change this line:
  def initialize(file_index, filename)


to this:
  def initialize(file_index, filename, position)
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Shadonking

September 17, 2008, 06:30:39 pm #50 Last Edit: October 24, 2008, 05:27:38 pm by Shadonking
ok i'll try it tomorow, thanks for your help





Creator Of Music And Games
Spoiler: ShowHide
]

keywords: ShowHide
rmxp rmvx blizz-abs rpg maker xp vx abs cbs cms script tons of addons charsets autotiles HUD


come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

KRoP


rgangsta

In SFS, I get an error on line 301. I need halp with this.

HELP?!  :^_^':

Red XIII

Hi Shdw, i know this topics like a year old but I really need your help.  :)
I've been looking for a script like this for ages, one that uses a temp save thats loaded on gameover.

I put the script in just above main, and because I've used a map as my title screen, I got rid of the command window from the scene_title in your script and defined update as command_new_game. That all works fine (i'm not usin NG+ at the mo) until I enter 'SL93.update_temp_save' into an event. As soon as it reaches this point when playing, I get the error: 'Unable to find file Section106:311:in 'initialize'temp.save.' Thats problem number 1  :P

Also, (im using the chaos project save layout and stormtronics CMS btw) whenever a script has to display the location name, like in the chaos save screen or the CMS, I get this message: 'NoMethodError occurred undefined method '[]' for nil:NilClass'. I had a look at the error in the script and it was definatly this line causing it: 'self.contents.draw_text(0, y, 502, 32, 'Location: ' + $map_names[@game_map.map_id])'. But when I remove your script this error doesnt happen. I was thinking it might be because of my changes to the title script, but I couldn't find anythin wrong.

I've tried sortin it myself but I'm an epic phailure when it comes to RGSS. Please help!  :'(

Blizzard

Shdw is currently inactive.
Maybe your problem can be solved by changing the order of the scripts. Try that.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Red XIII

Yay! That sorted the location display problem. I feel like an idiot lol. It still came up with the 'Unable to find file Section106:311:in 'initialize'temp.save' error though. hmm... I've also tried using the original script without any modifications too, but no luck. Any ideas?
Thanks for your help btw  :)

Blizzard

Try deleting your old savefiles. Something seems to be messed up.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Red XIII

 :'( Still came up after deleting them. I really don't know what to do. It would be amazing if it worked- being able to respawn at a checkpoint when it's gameover. By the way, replacing the Tons of Addons script solved the BlizzABS HUD lag :D but the events still keep executing when they walk in to the character. Thanks again Blizzard

shdwlink1993

Thanks for reminding me. I've been meaning to redo that entire system for a while. That message always comes up. Never have figured out why, but I suspect something's hardcoded into the hidden classes to do that. I'll get a newer version up pretty soon.
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Red XIII

Oh, thank god. Cheers shdw! Can't wait for the latest version  :D