The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: BPKS0 on November 05, 2005, 06:03:37 AM

Title: Savepoint script
Post by: BPKS0 on November 05, 2005, 06:03:37 AM
I don't know if this was posted before, I tryed serching for it and googleing it but I couldn't find neinfo on how to do it. I need a script that lets you save only when you use a save point, but u can't save in the menu. Btw if it meens nething I'm using a ring menu.
Title: Savepoint script
Post by: mangadude5760 on November 05, 2005, 06:27:48 AM
i know what you mean....but i dont know ruby yet so its hard to explain what to do.... you have to take out the save option in your menu and you can make a save point with the events but dont touch the scripts untill a real scripter gives you any directions
Title: Savepoint script
Post by: Rikkuholic on November 05, 2005, 08:32:13 AM
I'll give you the script. It's default, but the save function is gone. Make a save point, and that event opens the save menu. Easy as pie.

Find and replace Scene_Menu with this:

#==============================================================================
# â–  Scene_Menu
#------------------------------------------------------------------------------
#  メニューç"»é¢ã®å‡¦ç†ã,'行うã,¯ãƒ©ã,¹ã§ã™ã€,
#==============================================================================

class Scene_Menu
 #--------------------------------------------------------------------------
 # ● ã,ªãƒ–ã,¸ã,§ã,¯ãƒˆåˆæœŸåŒ–
 #     menu_index : ã,³ãƒžãƒ³ãƒ‰ã®ã,«ãƒ¼ã,½ãƒ«åˆæœŸä½ç½®
 #--------------------------------------------------------------------------
 def initialize(menu_index = 0)
   @menu_index = menu_index
 end
 #--------------------------------------------------------------------------
 # ● メã,¤ãƒ³å‡¦ç†
 #--------------------------------------------------------------------------
 def main
   # ã,³ãƒžãƒ³ãƒ‰ã,¦ã,£ãƒ³ãƒ‰ã,¦ã,'作成
   s1 = $data_system.words.item
   s2 = $data_system.words.skill
   s3 = $data_system.words.equip
   s4 = "Status"
   s5 = "Exit"
   @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5])
   @command_window.index = @menu_index
   # ãƒ'ーテã,£äººæ•°ãŒ 0 人の場合
   if $game_party.actors.size == 0
     # ã,¢ã,¤ãƒ†ãƒ ã€ã,¹ã,­ãƒ«ã€è£...å,™ã€ã,¹ãƒ†ãƒ¼ã,¿ã,¹ã,'ç,,¡åŠ¹åŒ–
     @command_window.disable_item(0)
     @command_window.disable_item(1)
     @command_window.disable_item(2)
     @command_window.disable_item(3)
   end
   # ã,»ãƒ¼ãƒ–禁止の場合
   if $game_system.save_disabled
     # ã,»ãƒ¼ãƒ–ã,'ç,,¡åŠ¹ã«ã™ã,‹
     @command_window.disable_item(4)
   end
   # プレã,¤æ™,é–"ã,¦ã,£ãƒ³ãƒ‰ã,¦ã,'作成
   @playtime_window = Window_PlayTime.new
   @playtime_window.x = 0
   @playtime_window.y = 224
   # æ­©æ•°ã,¦ã,£ãƒ³ãƒ‰ã,¦ã,'作成
   @steps_window = Window_Steps.new
   @steps_window.x = 0
   @steps_window.y = 320
   # ã,´ãƒ¼ãƒ«ãƒ‰ã,¦ã,£ãƒ³ãƒ‰ã,¦ã,'作成
   @gold_window = Window_Gold.new
   @gold_window.x = 0
   @gold_window.y = 416
   # ã,¹ãƒ†ãƒ¼ã,¿ã,¹ã,¦ã,£ãƒ³ãƒ‰ã,¦ã,'作成
   @status_window = Window_MenuStatus.new
   @status_window.x = 160
   @status_window.y = 0
   # トランã,¸ã,·ãƒ§ãƒ³å®Ÿè¡Œ
   Graphics.transition
   # メã,¤ãƒ³ãƒ«ãƒ¼ãƒ—
   loop do
     # ã,²ãƒ¼ãƒ ç"»é¢ã,'æ›´æ–°
     Graphics.update
     # å...¥åŠ›æƒ...å ±ã,'æ›´æ–°
     Input.update
     # フレーム更新
     update
     # ç"»é¢ãŒåˆ‡ã,Šæ›¿ã,ã£ãŸã,‰ãƒ«ãƒ¼ãƒ—ã,'中断
     if $scene != self
       break
     end
   end
   # トランã,¸ã,·ãƒ§ãƒ³æº–å,™
   Graphics.freeze
   # ã,¦ã,£ãƒ³ãƒ‰ã,¦ã,'è§£æ"¾
   @command_window.dispose
   @playtime_window.dispose
   @steps_window.dispose
   @gold_window.dispose
   @status_window.dispose
 end
 #--------------------------------------------------------------------------
 # ● フレーム更新
 #--------------------------------------------------------------------------
 def update
   # ã,¦ã,£ãƒ³ãƒ‰ã,¦ã,'æ›´æ–°
   @command_window.update
   @playtime_window.update
   @steps_window.update
   @gold_window.update
   @status_window.update
   # ã,³ãƒžãƒ³ãƒ‰ã,¦ã,£ãƒ³ãƒ‰ã,¦ãŒã,¢ã,¯ãƒ†ã,£ãƒ–の場合: update_command ã,'å'¼ã¶
   if @command_window.active
     update_command
     return
   end
   # ã,¹ãƒ†ãƒ¼ã,¿ã,¹ã,¦ã,£ãƒ³ãƒ‰ã,¦ãŒã,¢ã,¯ãƒ†ã,£ãƒ–の場合: update_status ã,'å'¼ã¶
   if @status_window.active
     update_status
     return
   end
 end
 #--------------------------------------------------------------------------
 # ● フレーム更新 (ã,³ãƒžãƒ³ãƒ‰ã,¦ã,£ãƒ³ãƒ‰ã,¦ãŒã,¢ã,¯ãƒ†ã,£ãƒ–の場合)
 #--------------------------------------------------------------------------
 def update_command
   # B ボã,¿ãƒ³ãŒæŠ¼ã•ã,ŒãŸå ´åˆ
   if Input.trigger?(Input::B)
     # ã,­ãƒ£ãƒ³ã,»ãƒ« SE ã,'æ¼"奏
     $game_system.se_play($data_system.cancel_se)
     # マップç"»é¢ã«åˆ‡ã,Šæ›¿ãˆ
     $scene = Scene_Map.new
     return
   end
   # C ボã,¿ãƒ³ãŒæŠ¼ã•ã,ŒãŸå ´åˆ
   if Input.trigger?(Input::C)
     # ãƒ'ーテã,£äººæ•°ãŒ 0 人で、ã,»ãƒ¼ãƒ–、ã,²ãƒ¼ãƒ çµ,了以外のã,³ãƒžãƒ³ãƒ‰ã®å ´åˆ
     if $game_party.actors.size == 0 and @command_window.index < 4
       # ブã,¶ãƒ¼ SE ã,'æ¼"奏
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # ã,³ãƒžãƒ³ãƒ‰ã,¦ã,£ãƒ³ãƒ‰ã,¦ã®ã,«ãƒ¼ã,½ãƒ«ä½ç½®ã§åˆ†å²
     case @command_window.index
     when 0  # ã,¢ã,¤ãƒ†ãƒ 
       # 決定  SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # ã,¢ã,¤ãƒ†ãƒ ç"»é¢ã«åˆ‡ã,Šæ›¿ãˆ
       $scene = Scene_Item.new
     when 1  # ã,¹ã,­ãƒ«
       # 決定 SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # ã,¹ãƒ†ãƒ¼ã,¿ã,¹ã,¦ã,£ãƒ³ãƒ‰ã,¦ã,'ã,¢ã,¯ãƒ†ã,£ãƒ–にすã,‹
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 2  # è£...å,™
       # 決定 SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # ã,¹ãƒ†ãƒ¼ã,¿ã,¹ã,¦ã,£ãƒ³ãƒ‰ã,¦ã,'ã,¢ã,¯ãƒ†ã,£ãƒ–にすã,‹
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 3  # ã,¹ãƒ†ãƒ¼ã,¿ã,¹
       # 決定 SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # ã,¹ãƒ†ãƒ¼ã,¿ã,¹ã,¦ã,£ãƒ³ãƒ‰ã,¦ã,'ã,¢ã,¯ãƒ†ã,£ãƒ–にすã,‹
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 4  # ã,»ãƒ¼ãƒ–
       # ã,»ãƒ¼ãƒ–禁止の場合
       if $game_system.save_disabled
         # ブã,¶ãƒ¼ SE ã,'æ¼"奏
         $game_system.se_play($data_system.buzzer_se)
         return
       end
       # 決定 SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # ã,»ãƒ¼ãƒ–ç"»é¢ã«åˆ‡ã,Šæ›¿ãˆ
       $scene = Scene_Save.new
     when 5  # ã,²ãƒ¼ãƒ çµ,了
       # 決定 SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # ã,²ãƒ¼ãƒ çµ,了ç"»é¢ã«åˆ‡ã,Šæ›¿ãˆ
       $scene = Scene_End.new
     end
     return
   end
 end
 #--------------------------------------------------------------------------
 # ● フレーム更新 (ã,¹ãƒ†ãƒ¼ã,¿ã,¹ã,¦ã,£ãƒ³ãƒ‰ã,¦ãŒã,¢ã,¯ãƒ†ã,£ãƒ–の場合)
 #--------------------------------------------------------------------------
 def update_status
   # B ボã,¿ãƒ³ãŒæŠ¼ã•ã,ŒãŸå ´åˆ
   if Input.trigger?(Input::B)
     # ã,­ãƒ£ãƒ³ã,»ãƒ« SE ã,'æ¼"奏
     $game_system.se_play($data_system.cancel_se)
     # ã,³ãƒžãƒ³ãƒ‰ã,¦ã,£ãƒ³ãƒ‰ã,¦ã,'ã,¢ã,¯ãƒ†ã,£ãƒ–にすã,‹
     @command_window.active = true
     @status_window.active = false
     @status_window.index = -1
     return
   end
   # C ボã,¿ãƒ³ãŒæŠ¼ã•ã,ŒãŸå ´åˆ
   if Input.trigger?(Input::C)
     # ã,³ãƒžãƒ³ãƒ‰ã,¦ã,£ãƒ³ãƒ‰ã,¦ã®ã,«ãƒ¼ã,½ãƒ«ä½ç½®ã§åˆ†å²
     case @command_window.index
     when 1  # ã,¹ã,­ãƒ«
       # ã"のã,¢ã,¯ã,¿ãƒ¼ã®è¡Œå‹•制限が 2 以上の場合
       if $game_party.actors[@status_window.index].restriction >= 2
         # ブã,¶ãƒ¼ SE ã,'æ¼"奏
         $game_system.se_play($data_system.buzzer_se)
         return
       end
       # 決定 SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # ã,¹ã,­ãƒ«ç"»é¢ã«åˆ‡ã,Šæ›¿ãˆ
       $scene = Scene_Skill.new(@status_window.index)
     when 2  # è£...å,™
       # 決定 SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # è£...å,™ç"»é¢ã«åˆ‡ã,Šæ›¿ãˆ
       $scene = Scene_Equip.new(@status_window.index)
     when 3  # ã,¹ãƒ†ãƒ¼ã,¿ã,¹
       # 決定 SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # ã,¹ãƒ†ãƒ¼ã,¿ã,¹ç"»é¢ã«åˆ‡ã,Šæ›¿ãˆ
       $scene = Scene_Status.new(@status_window.index)
     end
     return
   end
 end
end


Then make savepoints. If you don't know how to do it, just ask me.
Title: Savepoint script
Post by: dwarra on November 05, 2005, 11:10:48 AM
Or you could do it like so. Make an event on the very first map and disable saving. Then just make points, where it takes you to the save menu on click. Check your event commands, this should be possible  :P
Title: Savepoint script
Post by: Rikkuholic on November 05, 2005, 01:01:30 PM
Then he must make such an event on all maps, as that command only functions on the map it was initiated on, then returns to normal i think.
Title: Savepoint script
Post by: Tsunokiette on November 05, 2005, 01:42:37 PM
close, you got the basics down, but you also need to change this

case @command_window.index
     when 0  # ã,¢ã,¤ãƒ†ãƒ 
       # 決定  SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # ã,¢ã,¤ãƒ†ãƒ ç"»é¢ã«åˆ‡ã,Šæ›¿ãˆ
       $scene = Scene_Item.new
     when 1  # ã,¹ã,­ãƒ«
       # 決定 SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # ã,¹ãƒ†ãƒ¼ã,¿ã,¹ã,¦ã,£ãƒ³ãƒ‰ã,¦ã,'ã,¢ã,¯ãƒ†ã,£ãƒ–にすã,‹
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 2  # è£...å,™
       # 決定 SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # ã,¹ãƒ†ãƒ¼ã,¿ã,¹ã,¦ã,£ãƒ³ãƒ‰ã,¦ã,'ã,¢ã,¯ãƒ†ã,£ãƒ–にすã,‹
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 3  # ã,¹ãƒ†ãƒ¼ã,¿ã,¹
       # 決定 SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # ã,¹ãƒ†ãƒ¼ã,¿ã,¹ã,¦ã,£ãƒ³ãƒ‰ã,¦ã,'ã,¢ã,¯ãƒ†ã,£ãƒ–にすã,‹
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 4  # ã,»ãƒ¼ãƒ–
       # ã,»ãƒ¼ãƒ–禁止の場合
       if $game_system.save_disabled
         # ブã,¶ãƒ¼ SE ã,'æ¼"奏
         $game_system.se_play($data_system.buzzer_se)
         return
       end
       # 決定 SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # ã,»ãƒ¼ãƒ–ç"»é¢ã«åˆ‡ã,Šæ›¿ãˆ
       $scene = Scene_Save.new
     when 5  # ã,²ãƒ¼ãƒ çµ,了
       # 決定 SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # ã,²ãƒ¼ãƒ çµ,了ç"»é¢ã«åˆ‡ã,Šæ›¿ãˆ
       $scene = Scene_End.new
     end


to this

case @command_window.index
     when 0  # ã,¢ã,¤ãƒ†ãƒ 
       # 決定  SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # ã,¢ã,¤ãƒ†ãƒ ç"»é¢ã«åˆ‡ã,Šæ›¿ãˆ
       $scene = Scene_Item.new
     when 1  # ã,¹ã,­ãƒ«
       # 決定 SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # ã,¹ãƒ†ãƒ¼ã,¿ã,¹ã,¦ã,£ãƒ³ãƒ‰ã,¦ã,'ã,¢ã,¯ãƒ†ã,£ãƒ–にすã,‹
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 2  # è£...å,™
       # 決定 SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # ã,¹ãƒ†ãƒ¼ã,¿ã,¹ã,¦ã,£ãƒ³ãƒ‰ã,¦ã,'ã,¢ã,¯ãƒ†ã,£ãƒ–にすã,‹
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 3  # ã,¹ãƒ†ãƒ¼ã,¿ã,¹
       # 決定 SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # ã,¹ãƒ†ãƒ¼ã,¿ã,¹ã,¦ã,£ãƒ³ãƒ‰ã,¦ã,'ã,¢ã,¯ãƒ†ã,£ãƒ–にすã,‹
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 4  # ã,²ãƒ¼ãƒ çµ,了
       # 決定 SE ã,'æ¼"奏
       $game_system.se_play($data_system.decision_se)
       # ã,²ãƒ¼ãƒ çµ,了ç"»é¢ã«åˆ‡ã,Šæ›¿ãˆ
       $scene = Scene_End.new
     end


nontice the difference? :wink:

you also need to go into the Scene_End script, and everywhere you see this line

$scene = Scene_Menu.new[5]

replace the number in the brackets with "4", so that it looks like this-

$scene = Scene_Menu.new[4]

otherwise, when you exit back into the menu, it will select the 6th option which no longer exists.
Title: Savepoint script
Post by: Rikkuholic on November 05, 2005, 02:11:46 PM
Thanks. I'll modify the script right away. Tsu, can't you teach me ruby, please? I'm having a hard time learning.
Title: Savepoint script
Post by: Tsunokiette on November 05, 2005, 02:27:19 PM
Quote from: RikkuholicThanks. I'll modify the script right away. Tsu, can't you teach me ruby, please? I'm having a hard time learning.

I'm gonna write a series of tutorials, however, I need to wait till things cool down at home *got a court case next week* and I'll probably write them over summer break.

I also need to scrap up $60 so I can buy the RMXP legal license.
Title: Savepoint script
Post by: BPKS0 on November 05, 2005, 03:08:00 PM
tyty but I'm using a ring menu would I have to do nething different?
Title: Savepoint script
Post by: Tsunokiette on November 05, 2005, 03:13:57 PM
Quote from: BPKS0tyty but I'm using a ring menu would I have to do nething different?

*sigh* yes...

post the script and I'll edit it for you
Title: Savepoint script
Post by: BPKS0 on November 05, 2005, 03:20:22 PM
k I did a littlebit to edit it I think I did it right. but it doesnt work so u need to look it over

[code]
#==============================================================================
#
Title: Savepoint script
Post by: mangadude5760 on November 05, 2005, 05:01:37 PM
Sir Vahalor is a girl...she is french so i think her name means something...
Title: Savepoint script
Post by: BPKS0 on November 05, 2005, 06:16:55 PM
O lol XD
Title: Savepoint script
Post by: Necroid on November 23, 2005, 12:40:47 PM
im using the ff styloe menu does anything need to change.
Title: Savepoint script
Post by: rune76 on November 25, 2005, 03:17:51 AM
Here you go:
[code]

#==============================================================================
#
Title: Savepoint script
Post by: disturbed317 on December 11, 2005, 11:48:01 PM
It's quite easy to do it. You don't need any scripts. Just events, cause there is the disallow saving event. And just have an event that does that at the beggining, and then make a save point event, that calls the save screen.