المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : [RPMXP] سكربت لأكمال اللعب بعد الانتهاء.



Noor Xp
03-04-2008, 12:02 AM
السلام عليكم

اقدم لكم سكربت لاضهار خيارات بعد ان تخسر وتنتهي اللعبه سكربت رائع وهذه صوره توضحيه لعمله:

http://i12.tinypic.com/6wmuniw.png

السكربت:
ضعه فوق ال Main:


#==============================================================================
# ** TDS Continue [Scene_Gameover]
# Version: 1.1
#------------------------------------------------------------------------------
# Allows for a player to continue at the last save point when he dies.
#==============================================================================
# Variable para los comandos en español
ESPAÑOL = false
#==============================================================================
# ** TDS Game_Temp
#------------------------------------------------------------------------------
# This class handles temporary data that is not included with save data.
# Refer to "$game_temp" for the instance of this class.
#==============================================================================
class Game_Temp
attr_accessor :playing_filename
alias tds_continue_gameover_game_temp_initialize initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
@playing_filename = 0
tds_continue_gameover_game_temp_initialize
end
end

#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
# This is a superclass for the save screen and load screen.
#==============================================================================

class Scene_File
alias tds_continue_gameover_scene_file_update update
def update
# If C button was pressed
if Input.trigger?(Input::C)
# Call method: on_decision (defined by the subclasses)
on_decision(make_filename(@file_index))
$game_temp.last_file_index = @file_index
$game_temp.playing_filename = @file_index + 1
return
end
tds_continue_gameover_scene_file_update
end
end


#==============================================================================
# ** Window_Command
#------------------------------------------------------------------------------
# This window deals with general command choices.
# Gives more options for the command window.
#==============================================================================

class TDS_Window_Command < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
# width : window width
# commands : command text string array
# column_max : Maximun number of culumns
# Style : Centering style
# inf_scroll : Information scrolling
#--------------------------------------------------------------------------
def initialize(width, commands, column_max = 1, style = 0, inf_scroll = 1)
# Compute window height from command quantity
super(0, 0, width, (commands.size * 1.0 / column_max).ceil * 32 + 32)
@inf_scroll = inf_scroll
@item_max = commands.size
@commands = commands
@column_max = column_max
@style = style
self.contents = Bitmap.new(width - 32, (@item_max * 1.0 / @column_max).ceil * 32)
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
# color : text color
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(index%@column_max * (self.width / @column_max) + 4, 32 * (index/@column_max), self.width / @column_max - 40, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index], @style)
end
#--------------------------------------------------------------------------
# * Disable Item
# index : item number
#--------------------------------------------------------------------------
def disable_item(index)
draw_item(index, disabled_color)
end

def update_help
@help_window.set_actor($game_party.actors[$scene.actor_index])
end
end

#==============================================================================
# ** Scene_Gameover
#------------------------------------------------------------------------------
# This class performs game over screen processing.
#==============================================================================

class Scene_Gameover
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make game over graphic
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.gameover($data_system.gameover_name)
# Creates command window
if ESPA&Atilde;‘OL == true
@command_window = TDS_Window_Command.new(192, ['Continuar',
'Pantalla de t&Atilde;­tulo','Cargar Fila','Salir'],1,1)
else
@command_window = TDS_Window_Command.new(192, ['Continue', 'Title Screen',
'Load file','Quit'],1,1)
end
@command_window.back_opacity = 0
@command_window.opacity = 0
@command_window.contents_opacity = 0
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 290 #40
@command_window.visible = false
@command_window.active = false
# Stop BGM and BGS
$game_system.bgm_play(nil)
$game_system.bgs_play(nil)
# Play game over ME
$game_system.me_play($data_system.gameover_me)
# Execute transition
Graphics.transition(120)
@intro_updating = true
@continue_enabled = false
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of game over graphic
@sprite.bitmap.dispose
@sprite.dispose
@command_window.dispose
# Prepare for transition
Graphics.freeze
# If battle test
if $BTEST
$scene = nil
end
end
#--------------------------------------------------------------------------
# * Updates the first fading effect
#--------------------------------------------------------------------------
def update_enter
@command_window.opacity += 10
@command_window.back_opacity += 10 if @command_window.back_opacity < 160
@command_window.contents_opacity += 10 if @command_window.contents_opacity < 255
@command_window.visible = true
if @command_window.opacity >= 255
@command_window.active = true
@intro_updating = false
return
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
update_enter if @intro_updating == true
# Update command window
@command_window.update
# Gets the value of playing file to apply it later when the game is reloaded
@game_value = $game_temp.playing_filename
# Gets the filename # of the last playing variable
@filename = "Save#{$game_temp.playing_filename}.rxdata"
# If file last playing file exist let's you continue otherwise it cancels the
# continue command
unless FileTest.exist?(@filename)
# Disables first item in the command window
@command_window.disable_item(0)
# Allows to continue if file exist
@can_continue = false
else
@can_continue = true
end
# checks to see if save files 1 to 5 exist
for i in 0..5
if FileTest.exist?("Save#{i+1}.rxdata")
# Allows for continue command to be used
@continue_enabled = true
break
end
end
# if continue disable
if @continue_enabled == false
# Disables load game command
@command_window.disable_item(2)
end

if @command_window.active == true && Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # Continue
if @can_continue == true
$game_system.se_play($data_system.decision_se)
# loads filename if filename from continue exist
# Load File
load = Scene_Load.new
load.on_decision(@filename)
# Make player face down
$game_player.turn_down
#Gives back the value of the game you were playing
$game_temp.playing_filename = @game_value
# stops ME audio
Audio.me_stop
else
$game_system.se_play($data_system.buzzer_se)
end
when 1 # To title
Graphics.transition(40)
$game_system.se_play($data_system.decision_se)
$scene = Scene_Title.new
when 2 # Load File
if @continue_enabled == true
$game_system.se_play($data_system.decision_se)
$scene = Scene_Load.new
else
$game_system.se_play($data_system.buzzer_se)
end
when 3 # Shutdown
$game_system.se_play($data_system.decision_se)
$scene = nil
end
end
end
end


ارجوا ان السكربت قد افادكم.
أي سؤال انا حاظر.

سلام

Noor Xp
03-04-2008, 02:30 PM
11 واحد شاف الموضوع ولاواحد رد بكلمة شكر على الأقل >_<.

PrinceOfSorrow
03-04-2008, 03:46 PM
عندي اقتراح يفضل ان تعمل ديمو مع كل سكربت تقوم بأرفاقة ^^
وشكرا على سكربت

Noor Xp
03-04-2008, 05:45 PM
اهلا برنس
ان شاء الله بالمره الجايه ولكن انا اشوف ان الصوره معبره ماتحتاج ديمو.