Chairman Yang
Member
I apologize in advance for what is probably a really dumb, noobish question. I've trying to properly learn scripting so that I can make a CBS. I'm still playing around, but what I've done is make the Scene_Map class call my Scene_CustomBattle class instead of the normal Scene_Battle.
Now, all I'm trying to do so far is to make a command window pop up on the screen (basically, I want my battles to be on the same map that players run around on normally).
Here's my code so far (pardon my sloppiness and extraneous code, I realize it's filled with unnecessary stuff):
The window doesn't show at all, but I know it's there because I can hear the sounds of me moving the cursor. When I "exit" my custom battle, the window suddenly appears. What am I doing wrong? I'd greatly appreciate any advice.
Now, all I'm trying to do so far is to make a command window pop up on the screen (basically, I want my battles to be on the same map that players run around on normally).
Here's my code so far (pardon my sloppiness and extraneous code, I realize it's filled with unnecessary stuff):
Code:
class Scene_CustomBattle
def main
# Make actor command window
s1 = "Exit combat"
s2 = $data_system.words.skill
s3 = $data_system.words.guard
s4 = $data_system.words.item
@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
@actor_command_window.y = 160
@actor_command_window.back_opacity = 160
@actor_command_window.visible = true
@actor_command_window.active = true
# 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
end
def update
@actor_command_window.update
@actor_command_window.refresh
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Dispose of windows
#@actor_command_window.dispose
# Switch to map screen
$scene = Scene_Map.new
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
end
end
end
The window doesn't show at all, but I know it's there because I can hear the sounds of me moving the cursor. When I "exit" my custom battle, the window suddenly appears. What am I doing wrong? I'd greatly appreciate any advice.