Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Help, adding an option to main menu.

Hello, I found a script that works perfect on my Rpg, that changes the main menu around, HOWEVER it adds an option for Tournament, I would like to replace that option with Credits, I was wandering if anyone could do this for me, It would be greatly Apriciated. and you will be on the credits ofc, here is the info I need...





Mainpage Script:


#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
#  タイトル画面の処理を行うクラスです。
#==============================================================================

class Scene_Title
#--------------------------------------------------------------------------
# ● メイン処理
#--------------------------------------------------------------------------
def main
# 戦闘テストの場合
if $BTEST
battle_test
return
end
# データベースをロード

$game_music = Game_Options.new
$fight = Tornament_Mode.new
@my = Time.now
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
# システムオブジェクトを作成
$game_system = Game_System.new
$game_system.bgm_play($data_system.title_bgm)
# タイトルグラフィックを作成
# コマンドウィンドウを作成
s1 = ""
s2 = ""
s3 = ""
s4 = ""
@command_window = Menu_Command.new(192, [s1, s2, s3, s4])
@command_window.index = 0
@command_window.width = 560
@command_window.height = 250
@command_window.opacity = 0
@command_window.back_opacity = 0
@command_window.x = -10
@command_window.y = 424
@time = 0
@sprite2 = Sprite.new
@sprite2.bitmap = RPG::Cache.picture("book1")
@sprite2.z = 150
@sprite2.x = 40
@sprite2.y = 440
@select3_window = Window_Select.new
@select3_window.x = 20
@select3_window.y = 420
@select3_window.back_opacity = 150
@sprite3 = Sprite.new
@sprite3.bitmap = RPG::Cache.picture("b7")
@sprite3.z = 150
@sprite3.x = 40
@sprite3.y = 445
@sprite3.visible = false
@sprite4 = Sprite.new
@sprite4.bitmap = RPG::Cache.picture("b6")
@sprite4.z = 150
@sprite4.x = 80
@sprite4.y = 445
@sprite4.visible = false
@select1_window = Window_Select.new
@select1_window.x = 115
@select1_window.y = 420
@select1_window.back_opacity = 150
@sprite1 = Sprite.new
@sprite1.bitmap = RPG::Cache.picture("exit")
@sprite1.z = 150
@sprite1.x = 230
@sprite1.y = 445
@select2_window = Window_Select.new
@select2_window.x = 210
@select2_window.y = 420
@select2_window.back_opacity = 150
@select4_window = Window_Select.new
@select4_window.x = 305
@select4_window.y = 420
@select4_window.back_opacity = 150
@tor = Sprite.new
@tor.bitmap = RPG::Cache.picture("a4")
@tor.z = 150
@tor.x = 330
@tor.y = 445
#hand cursor
@hand = Sprite.new
@hand.bitmap = RPG::Cache.picture("hand_1")
@hand.x = 13
@hand.y = 452
@hand.z = 600
@hand.opacity = 50
@tit1 = Sprite.new
@tit1.bitmap = RPG::Cache.title("title_1")
@tit1.opacity = 0
@tit2 = Sprite.new
@tit2.bitmap = RPG::Cache.title("title_2")
@tit2.opacity = 0
@tit3 = Sprite.new
@tit3.bitmap = RPG::Cache.title("title_3")
@tit3.opacity = 0
@tit4 = Sprite.new
@tit4.bitmap = RPG::Cache.title("title_4")
@tit4.opacity = 0


#hand cursor
#text box for Title screen
@menu = Window_Help.new
@menu.set_text("New Game")
@menu.x = 410
@menu.y = 421
@menu.z = 200
@menu.width = 205
@menu.height = 60
@menu.back_opacity = 150
#continue enable and disable
@continue_enabled = false
@sprite3 = Sprite.new
@sprite3.bitmap = RPG::Cache.picture("b7")
@sprite3.z = 150
@sprite3.x = 130
@sprite3.y = 445
@sprite3.opacity = 150
@sprite3.visible = true
@sprite4.visible = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
@sprite4 = Sprite.new
@sprite4.bitmap = RPG::Cache.picture("b6")
@sprite4.z = 150
@sprite4.x = 130
@sprite4.y = 445
@sprite4.visible = true
@sprite3.visible = false
end
end
# コンティニューが有効な場合、カーソルをコンティニューに合わせる
# 無効な場合、コンティニューの文字をグレー表示にする
if @continue_enabled
@command_window.index = 1
else
@command_window.disable_item(1)
end
# タイトル BGM を演奏
$game_system.bgm_play($data_system.title_bgm)
# ME、BGS の演奏を停止
Audio.me_stop
Audio.bgs_stop
# トランジション実行
Graphics.transition
# メインループ
loop do
# ゲーム画面を更新
Graphics.update
# 入力情報を更新
Input.update
# フレーム更新
update
if $scene != self
break
end
end
# トランジション準備
Graphics.freeze
# コマンドウィンドウを解放
@command_window.dispose
# タイトルグラフィックを解放
# @sprite.bitmap.dispose
@tor.dispose
@sprite1.dispose
@sprite2.dispose
@sprite3.dispose
if @continue_enabled = false
@sprite3.dispose
end
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
@sprite4.dispose
end
@sprite4.dispose
@select1_window.dispose
@select2_window.dispose
@select3_window.dispose
@select4_window.dispose
@menu.dispose
@hand.dispose
@tit1.dispose
@tit3.dispose
@tit2.dispose
@tit4.dispose
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
# コマンドウィンドウを更新
@select1_window.update
@select2_window.update
@select3_window.update
@select4_window.update
@menu.update
@command_window.update
@hand.update
@tit1.update
@tit3.update
@tit2.update
@tit4.update
@tor.update

case @command_window.index
when 0
@menu.set_text("New Game")
@hand.x = 13
when 1
@menu.set_text("Continue")
@hand.x = 103
when 2
@menu.set_text("End game")
@hand.x = 199
when 3
@menu.set_text("Tornament")
@hand.x = 293
end
if Input.trigger?(Input::C)

case @command_window.index
when 0
command_new_game
when 1
@sprite4.dispose
command_continue
when 2
command_shutdown
when 3
command_tornament
end
end
@time = Time.now - @my
if @time < 5
if @tit4.opacity > 0
@tit4.opacity -= 2
end
if @tit1.opacity < 255
@tit1.opacity += 5
end
elsif @time >= 5 && @time < 10
if @tit1.opacity > 0
@tit1.opacity -= 2
end
if @tit2.opacity < 255
@tit2.opacity += 5
end
elsif @time >= 10 && @time < 15
if @tit2.opacity > 0
@tit2.opacity -= 2
end
if @tit3.opacity < 255
@tit3.opacity += 5
end
elsif @time >= 15 && @time < 20
if @tit3.opacity > 0
@tit3.opacity -= 2
end
if @tit4.opacity < 255
@tit4.opacity += 5
end
elsif @time >= 20
@my = Time.now
end



if @hand.opacity < 250
@hand.opacity += 2
return
end
if @hand.opacity == 250
loop do
Graphics.update
Input.update
@hand.update
@command_window.update
@hand.opacity -= 100
break if @hand.opacity >= 10
next
end
end
end


#--------------------------------------------------------------------------
# ● コマンド : ニューゲーム
#--------------------------------------------------------------------------
#new method for tornament
def command_tornament
$game_system.se_play($data_system.buzzer_se)
return
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_temp = Game_Temp.new
#$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_party.setup_starting_members
$game_map.setup(1)
$game_player.moveto(10, 13)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
end


#end of tornament code
def command_new_game
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# BGM を停止
Audio.bgm_stop
# プレイ時間計測用のフレームカウントをリセット
Graphics.frame_count = 0
# 各種ゲームオブジェクトを作成
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# 初期パーティをセットアップ
$game_party.setup_starting_members
# 初期位置のマップをセットアップ
$game_map.setup($data_system.start_map_id)
# プレイヤーを初期位置に移動
$game_player.moveto($data_system.start_x, $data_system.start_y)
# プレイヤーをリフレッシュ
$game_player.refresh
# マップに設定されている BGM と BGS の自動切り替えを実行
$game_map.autoplay
# マップを更新 (並列イベント実行)
$game_map.update
# マップ画面に切り替え
# $game_system.windowskin_name = "new system"
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# ● コマンド : コンティニュー
#--------------------------------------------------------------------------
def command_continue
# コンティニューが無効の場合
unless @continue_enabled
# ブザー SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# ロード画面に切り替え
$scene = Scene_Load.new
end
#--------------------------------------------------------------------------
# ● コマンド : シャットダウン
#--------------------------------------------------------------------------
def command_shutdown
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# BGM、BGS、ME をフェードアウト
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
# シャットダウン
$scene = nil
end
#--------------------------------------------------------------------------
# ● 戦闘テスト
#--------------------------------------------------------------------------
def battle_test
# データベース (戦闘テスト用) をロード
$data_actors = load_data("Data/BT_Actors.rxdata")
$data_classes = load_data("Data/BT_Classes.rxdata")
$data_skills = load_data("Data/BT_Skills.rxdata")
$data_items = load_data("Data/BT_Items.rxdata")
$data_weapons = load_data("Data/BT_Weapons.rxdata")
$data_armors = load_data("Data/BT_Armors.rxdata")
$data_enemies = load_data("Data/BT_Enemies.rxdata")
$data_troops = load_data("Data/BT_Troops.rxdata")
$data_states = load_data("Data/BT_States.rxdata")
$data_animations = load_data("Data/BT_Animations.rxdata")
$data_tilesets = load_data("Data/BT_Tilesets.rxdata")
$data_common_events = load_data("Data/BT_CommonEvents.rxdata")
$data_system = load_data("Data/BT_System.rxdata")
# プレイ時間計測用のフレームカウントをリセット
#$game_element_weapon = $data_system.elements.index("skilled")
Graphics.frame_count = 0
# 各種ゲームオブジェクトを作成
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_music = Game_Options.new
# 戦闘テスト用のパーティをセットアップ
$game_party.setup_battle_test_members
# トループ ID、逃走可能フラグ、バトルバックを設定
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
# バトル開始 SE を演奏
$game_system.se_play($data_system.battle_start_se)
# バトル BGM を演奏
$game_system.bgm_play($game_system.battle_bgm)
# バトル画面に切り替え
$scene = Scene_Battle.new
end
end




Script i need Tournament replaced with.

$scene = Scene_Credits.new




I hope someone could help cuzz anytime I do it, It doesn't activate when you click tournament/Credits It activates when themainpage loads, and when you lets say, press anykey to go back to main menu it crashes the game, could anyone also make it so when you press Enter on the Credits page, It loops back to the main menu? here is the Credits page.




CREDITS_FONT = "Times New Roman"
CREDITS_SIZE = 24
CREDITS_OUTLINE = Color.new(0,0,127, 255)
CREDITS_SHADOW = Color.new(0,0,0, 100)
CREDITS_FILL = Color.new(255,255,255, 255)

#==============================================================================
# ¦ Scene_Credits
#------------------------------------------------------------------------------
# ??????????????????
#==============================================================================

class Scene_Credits

# This next piece of code is the credits. Please keep the Zelda teams credits.

CREDIT=<<_END_

Credits:
(Creator and Director)
Vamp
_____________________________
(Custom Ring Menu system)
XRXS
Maki
Dubealex
_____________________________
Mini Games:
Zeriab
_____________________________
Cheat Script:
BudsieBuds
_____________________________
Heal On Level Up:
Ccoa
_____________________________
Triple Triad:
Sephiroth
_____________________________
Ideas:
Ricky
Granite
Thomas
_____________________________
Landscape | Towns | Buildings | Worldmap |
Thomas (Friend of Mine.
_____________________________
Final Fantasy 7 Windows
AcedentProne
_____________________________
Testers:
Ricky:
Granite
_____________________________
Special Thanks:
None

_END_
def main

#-------------------------------
# Animated Background Setup
#-------------------------------

@sprite = Sprite.new
#@sprite.bitmap = RPG::Cache.title($data_system.title_name)
@backgroundList = ["001-Title01"] #Edit this to the title screen(s) you wish to show in the background. They do repeat. Just put a comma in between each like this ["title1","title2"]
@backgroundGameFrameCount = 0
# Number of game frames per background frame.
@backgroundG_BFrameCount = 90
@sprite.bitmap = RPG::Cache.title(@backgroundList[0])

#------------------
# Credits txt Setup
#------------------

credit_lines = CREDIT.split(/\n/)
credit_bitmap = Bitmap.new(640,32 * credit_lines.size)
credit_lines.each_index do |i|
line = credit_lines
credit_bitmap.font.name = CREDITS_FONT
credit_bitmap.font.size = CREDITS_SIZE
x = 0
credit_bitmap.font.color = CREDITS_OUTLINE
credit_bitmap.draw_text(0 + 1,i * 32 + 1,640,32,line,1)
credit_bitmap.draw_text(0 - 1,i * 32 + 1,640,32,line,1)
credit_bitmap.draw_text(0 + 1,i * 32 - 1,640,32,line,1)
credit_bitmap.draw_text(0 - 1,i * 32 - 1,640,32,line,1)
credit_bitmap.font.color = CREDITS_SHADOW
credit_bitmap.draw_text(0,i * 32 + 8,640,32,line,1)
credit_bitmap.font.color = CREDITS_FILL
credit_bitmap.draw_text(0,i * 32,640,32,line,1)
end
@credit_sprite = Sprite.new(Viewport.new(0,50,640,380))
@credit_sprite.bitmap = credit_bitmap
@credit_sprite.z = 9998
@credit_sprite.oy = -430 #-430
@frame_index = 0
@last_flag = false

#--------
# Setup
#--------

#Stops all audio but background music.
Audio.me_stop
Audio.bgs_stop
Audio.se_stop

Graphics.transition

loop do

Graphics.update
Input.update


update
if $scene != self
break
end
end
Graphics.freeze
@sprite.dispose
@credit_sprite.dispose
end

##Checks if credits bitmap has reached it's ending point
def last?
if @frame_index > (@credit_sprite.bitmap.height + 500)
$scene = Scene_Map.new #change this to Scene_Title.new if you wish it to go to title screen instead.
Audio.bgm_fade(10000) #aprox 10 seconds
return true
end
return false
end

#Check if the credits should be cancelled
def cancel?
if Input.trigger?(Input::C)
$scene = Scene_Map.new #change this to Scene_Title.new if you wish it to go to title screen instead.
return true
end
return false
end
def update
@backgroundGameFrameCount = @backgroundGameFrameCount + 1
if @backgroundGameFrameCount >= @backgroundG_BFrameCount
@backgroundGameFrameCount = 0
# Add current background frame to the end
@backgroundList = @backgroundList << @backgroundList[0]
# and drop it from the first position
@backgroundList.delete_at(0)
@sprite.bitmap = RPG::Cache.title(@backgroundList[0])
end
return if cancel?
return if last?
@credit_sprite.oy += 1 #this is the speed that the text scrolls. 1 is default
#The fastest I'd recomend is 5, after that it gets hard to read.
@frame_index += 1 #This should fix the non-self-ending credits
end
end












Hope its possible if it isn't too much truble, this script is perfect only it has a tournament link not credits ^^
 
In the Scene_Title script, change the following line:
[ruby]when 3
  command_tornament
[/ruby]
to
[ruby]when 3
  $scene = Scene_Credits.new
[/ruby]

Also make sure you remove the def command_tornament which is the following:
[ruby]#--------------------------------------------------------------------------
# ● コマンド : ニューゲーム
#--------------------------------------------------------------------------
#new method for tornament
def command_tornament
$game_system.se_play($data_system.buzzer_se)
return
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_temp = Game_Temp.new
#$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_party.setup_starting_members
$game_map.setup(1)
$game_player.moveto(10, 13)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
end
 
 
#end of tornament code
[/ruby]

As for the Scene_Credits, you find this line:
[ruby] 
$scene = Scene_Map.new #change this to Scene_Title.new if you wish it to go to title screen instead.
[/ruby]
and replace the Scene_Map.new to Scene_Title.new (it also stated it in the code...) and also there are two lines of that in the credit script. Make sure you look at scripts as lots of instructions & information are usually in there already.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top