Ruby Kickstarter - Chrono Cry - 03-31-2005
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
Hello everyone i wrote this script earlier and posted it on rmxp and xrpg and thought why not here.
Hey all, i just got back from college and after a few minutes i was bored s***less so i decided to make a random script, this is my first script so dont be harsh lol but what it basically does is on you menu it will add another selection at the bottom called Help and hen you go on it it will contain data such as what the buttons do.
This script is basically for people who want to learn ruby and fast so all you have to do is look at my comments on the scripts and you should get some basic knowledge on how to script .
Here it is:-
First go to Scene_Menu and go to
Code: def main
# コマンドウィンドウを作�
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "Save"
s6 = "End Game"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
@command_window.index = @menu_index
and replace it with this
Code: def main
# コマンドウィンドウを作�
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "Save"
s6 = "End Game"
s7 = "Help" # Creates a new menu selection on the menu called help
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7]) # A new "s" is added to display the new selection
@command_window.index = @menu_index
This adds a new selection to you menu called help
After that change this
Code: # プレイ時間ウィンドウを作�
@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
with this
Code: @playtime_window = Window_PlayTime.new
@playtime_window.x = 0
@playtime_window.y = 244
# æ©æ•°ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’作æˆ?
@steps_window = Window_Steps.new
@steps_window.x = 0
@steps_window.y = 340
This stops the other windows covering up Help
now go down to this bit of coding
Code: 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
And just after
Code: $scene = Scene_End.new
Add
Code: when 6 # This is the new scene i have added to call upon the the scene
# 決定 SE を演�
$game_system.se_play($data_system.decision_se)
# ゲー� 終� 画��切� 替�
$scene = Scene_Helping.new # Scene that it opens
Now that this is set lets add the window and scene
Right make a new script above main and call it Scene_Helping
and paste this in it
Code: #==============================================================================
# â–� Scene_Helping
#------------------------------------------------------------------------------
#  デ�ッグ画��処� を行� クラス��。
#==============================================================================
class Scene_Helping
#--------------------------------------------------------------------------
# � プレ�トルフェーズ開始
#--------------------------------------------------------------------------
def main
@window_1=Window_Helping.new #This makes the window appear containing tje data in Window_Helping
# ウィンドウを作�
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
# ウィンドウを作�
Graphics.freeze
@window_1.dispose #This makes it dissapear when you exit from the screen
end
# ウィンドウを作�
def update
@window_1.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new #This is what it returns to, if you replace this with Scene_Map you can see the difference
end
end
end
#The end of the coding
and then make another code above main called Window_Helping
and paste this into it
Code: #==============================================================================
# â–� Window_Helping
#------------------------------------------------------------------------------
#  �トル画��パー� ィメン�ー�ス� ータスを表示�るウィンドウ��。
#==============================================================================
class Window_Helping < Window_Base
#--------------------------------------------------------------------------
# � オブジェクト�期化
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 480) # This defines the size of the window (x, y, width, height)
self.contents = Bitmap.new(width-32, height-32) # This enables you to display the text on the window
self.contents.font.name = "Times New Roman" # The font type used
self.contents.font.size = 25 # The size of the font
self.contents.draw_text(240, 0, 640, 30, "Help Menu") # Thies command displays the text in the chosen position
self.contents.font.size = 23
self.contents.draw_text(0, 0, 440, 80, "Controls")
self.contents.font.size = 22
self.contents.draw_text(0, 0, 600, 140, "Direction Keys = Move up, down, left and right on map")
self.contents.draw_text(0, 0, 600, 180, "Enter/Space = Used to accept/confirm stuff")
self.contents.draw_text(0, 0, 600, 220, "Esc/X = This opens up the menu screen")
self.contents.draw_text(0, 0, 600, 260, "CTRL = Use in test play to walk over and through everything")
self.contents.draw_text(0, 0, 600, 300, "F9 = This brings up switches and variables in test play")
self.contents.draw_text(0, 0, 600, 340, "F12 = This resets the game to main menu")
self.contents.draw_text(0, 0, 600, 440, "Hey all i have basically made this to get help you")
self.contents.draw_text(0, 0, 600, 480, "to learn how to know the basics of scripting")
self.contents.draw_text(0, 0, 600, 520, "so just look at the comments and just fiddle around.")
self.contents.draw_text(0, 0, 600, 560, "Good Luck :D")
end
end
# End of the coding
And thats it now just run your game and it should work
P.S. Even if you dont use the script soem people dont know this but when ur in game hold CTRL and you can walk over and through anything
Well i hope you liked it, i know your used to the ace codes you get off deke, dragonslayer, dubealex etc but at least this will help people fare well.
|