Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Battle Retry, Script:When you losse one battle you can retry the battle
skaterdoggy
post Aug 5 2008, 02:12 AM
Post #1


Level 2
Group Icon

Group: Member
Posts: 20
Type: Event Designer
RM Skill: Skilled




This is one script for retry one battle when you losse it
THIS IS NOT MY SCRIPT
THE CREATOR OF SCRIPT IS SANDGOLEM FROM GAMEBAKER.COM
CREDITS:SANDGOLEM

CODE
#======================================================================
# ** SG Battle Retry
#==========================================================================
# by sandgolem
# Version 6
# January 15th, 2008
#==========================================================================

module SG
BattleRetryCommands = ['Retry Battle','Title Screen']
BattleRetryDisableSwitch = 14
end

#==========================================================================
#
# To check for updates or find more scripts, visit:
# http://www.gamebaker.com/rmxp/scripts/
# Our RMVX scripts: http://www.gamebaker.com/rmvx/scripts/
#
# Instructions: http://www.gamebaker.com/rmxp/scripts/e/battle-retry.php
# Discussion/Help: http://forums.gamebaker.com/showthread.php?t=8
#
#==========================================================================

if Object.const_defined?('SDK')
SDK.log('SG Battle Retry', 'sandgolem', 6, '15.01.08')
@sg_battleretry_disabled = true if !SDK.enabled?('SG Battle Retry')
end

if !@sg_battleretry_disabled
#--------------------------------------------------------------------------

class Interpreter
alias_method :sg_battleretry_interp601, :command_601
def command_601
if $sg_retrywon
@branch[@list[@index].indent] = 0
$sg_retrywon = nil
end
return sg_battleretry_interp601
end

alias_method :sg_battleretry_interp602, :command_602
def command_602
if $game_temp.battle_can_escape && $sg_retryescaped
@branch[@list[@index].indent] = 1
$sg_retryescaped = nil
end
return sg_battleretry_interp602
end
end

# class Game_System; attr_accessor :playing_bgm; end
class Game_Temp; attr_accessor :battle_music_playing; end

class Scene_Map
alias_method :sg_battleretry_callbattle, :call_battle
def call_battle
sg_battleretry_callbattle
$game_temp.battle_music_playing = $game_system.playing_bgm.clone
end
end

class Scene_Save < Scene_File
def sg_write_retrysave_data
file = File.open('Data/retry.sg', 'wb')
write_save_data(file)
file.close
end
end

class Scene_Load < Scene_File
def sg_read_retrysave_data
file = File.open('Data/retry.sg', 'rb')
read_save_data(file)
file.close
end
end

class Scene_Battle
alias_method :sg_battleretry_main, :main
def main
$sg_retryescaped = nil
$sg_retrywon = nil
if !$game_switches[SG::BattleRetryDisableSwitch]
if !$sg_battleretry_inbattle && !$game_temp.battle_can_lose
$sg_battleretry_inbattle = $game_temp
sg_scene_save_temp = Scene_Save.new
sg_scene_save_temp.sg_write_retrysave_data
end
end
sg_battleretry_main
if !$scene.is_a?(Scene_Gameover)
File.delete('Data/retry.sg') if FileTest.exist?('Data/retry.sg')
$sg_battleretry_inbattle = nil
end
end

alias_method :sg_battleretry_battleend, :battle_end
def battle_end(result)
$sg_retrywon = true if result == 0
$sg_retryescaped = true if result == 1
sg_battleretry_battleend(result)
end
end

class Scene_Gameover
alias_method :sg_battleretry_gameovermain, :main
def main
if $sg_battleretry_inbattle
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.gameover($data_system.gameover_name)
$game_system.bgm_stop
$game_system.me_play($data_system.gameover_me)
Graphics.transition(90)
@command_window = Window_Command.new(192,SG::BattleRetryCommands)
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
loop do
Graphics.update
Input.update
sg_retry_update
if $scene != self
break
end
end
@command_window.dispose
Graphics.freeze
@sprite.bitmap.dispose
@sprite.dispose
Graphics.transition(30)
Graphics.freeze
else
sg_battleretry_gameovermain
end
end

def sg_retry_update
@command_window.update
if Input.trigger?(Input::C)
case @command_window.index
when 0
sg_scene_save_temp = Scene_Load.new
sg_scene_save_temp.sg_read_retrysave_data
$game_temp = $sg_battleretry_inbattle
$game_temp.gameover = nil
$game_system.bgm_play($game_temp.battle_music_playing)
$scene = Scene_Battle.new
when 1
File.delete('Data/retry.sg') if FileTest.exist?('Data/retry.sg')
$sg_battleretry_inbattle = nil
$scene = Scene_Title.new
end
end
end
end

#--------------------------------------------------------------------------
end

#==========================================================================
# End of file! You can find more of my scripts at http://www.rpgrevolution.com
#==========================================================================


This post has been edited by skaterdoggy: Aug 15 2008, 12:43 AM


__________________________
<a href="http://www.pricemyname.net/"><img src="http://www.pricemyname.net/wendigous.jpg" /></a>

[Show/Hide] My Projects
Ages Of Xordia



Go to the top of the page
 
+Quote Post
   
kaimonkey
post Aug 5 2008, 02:22 AM
Post #2


Level 11
Group Icon

Group: Revolutionary
Posts: 193
Type: Scripter
RM Skill: Beginner




Looks- cool! Can you say how many times you can retry?
Like at a boss you can only retry once, but on a rat you can retry 25 times?
Go to the top of the page
 
+Quote Post
   
Moogleking
post Aug 5 2008, 10:04 AM
Post #3


Level 3
Group Icon

Group: Member
Posts: 35
Type: Event Designer
RM Skill: Skilled




^ Yeah, or more along the lines can you turn it on and off when you want?
Go to the top of the page
 
+Quote Post
   
skaterdoggy
post Aug 5 2008, 10:21 AM
Post #4


Level 2
Group Icon

Group: Member
Posts: 20
Type: Event Designer
RM Skill: Skilled




QUOTE (Moogleking @ Aug 5 2008, 10:26 AM) *
^ Yeah, or more along the lines can you turn it on and off when you want?



Hmm... dry.gif zou want to turn on and off it...
i work at this to tell you
wait..probably i tell zou tomorow when your question run thumbsup.gif
enter tomorow and see when i post anything about this yes.gif


__________________________
<a href="http://www.pricemyname.net/"><img src="http://www.pricemyname.net/wendigous.jpg" /></a>

[Show/Hide] My Projects
Ages Of Xordia



Go to the top of the page
 
+Quote Post
   
Moogleking
post Aug 5 2008, 12:04 PM
Post #5


Level 3
Group Icon

Group: Member
Posts: 35
Type: Event Designer
RM Skill: Skilled




Thanks alot happy.gif.
Go to the top of the page
 
+Quote Post
   
skaterdoggy
post Aug 5 2008, 09:57 PM
Post #6


Level 2
Group Icon

Group: Member
Posts: 20
Type: Event Designer
RM Skill: Skilled




QUOTE (Moogleking @ Aug 5 2008, 12:26 PM) *
Thanks alot happy.gif.


confused.gif sorry but i don't know how to create him on-off
i tryed it with switch but don't work
i tryed to create one new script to activate this when i want...but don't work...
wink.gif


__________________________
<a href="http://www.pricemyname.net/"><img src="http://www.pricemyname.net/wendigous.jpg" /></a>

[Show/Hide] My Projects
Ages Of Xordia



Go to the top of the page
 
+Quote Post
   
Moogleking
post Aug 6 2008, 07:22 AM
Post #7


Level 3
Group Icon

Group: Member
Posts: 35
Type: Event Designer
RM Skill: Skilled




Ah well no worries, thanks for the script anyway!
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 20th May 2013 - 11:44 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker