Salve a tutti,oggi mi sono ritrovato davanti il seguente problema:
Ho creato una scena da zero,dove un comando dovrebbe sbloccarsi in base ad una variabile(non di gioco),però quando risulta "false" la scena non entra in atto...Ora la uppo per facilitare la comprensione e capire dov'è l'errore :)
class Scene_Lotta def main @calcio = false comandi = (["Pugno", "Suplex", "Dropkick", "Irish whip"]) comandi.unshift ("Calcio") if @calcio = true @select_window = Window_Command.new(192, comandi) @select_window.x = 0 @select_window.y = 100 @select_window.opacity = 255 @spriteset = Spriteset_Map.new @window_hud = Window_HUD.new @window_hud.opacity = 255 Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @window_hud.dispose @select_window.dispose end def update @select_window.update @window_hud.update if Input.trigger?(Input::C) case @select_window.index when 0 if @calcio = false $game_system.se_play($data_system.decision_se) $game_variables[1] += 3 $game_map.need_refresh = true $scene = Scene_Map.new else $game_system.se_play($data_system.decision_se) $game_variables[1] += 3 $game_map.need_refresh = true $scene = Scene_Map.new end return when 1 if @calcio = false $game_system.se_play($data_system.decision_se) $game_variables[1] += 20 $game_map.need_refresh = true $scene = Scene_Map.new else $game_system.se_play($data_system.decision_se) $game_variables[1] += 2 $game_map.need_refresh = true $scene = Scene_Map.new end return when 2 if @calcio = false $game_system.se_play($data_system.decision_se) $game_variables[1] += 15 $game_map.need_refresh = true $scene = Scene_Map.new else $game_system.se_play($data_system.decision_se) $game_variables[1] += 20 $game_map.need_refresh = true $scene = Scene_Map.new end return when 3 if @calcio = false $game_system.se_play($data_system.decision_se) $game_variables[1] += 5 $game_map.need_refresh = true $scene = Scene_Map.new else $game_system.se_play($data_system.decision_se) $game_variables[1] += 15 $game_map.need_refresh = true $scene = Scene_Map.new end return when 4 $game_system.se_play($data_system.decision_se) $game_variables[1] += 5 $game_map.need_refresh = true $scene = Scene_Map.new return end end end end
Question
Squall_Leonheart
Salve a tutti,oggi mi sono ritrovato davanti il seguente problema:
Ho creato una scena da zero,dove un comando dovrebbe sbloccarsi in base ad una variabile(non di gioco),però quando risulta "false" la scena non entra in atto...Ora la uppo per facilitare la comprensione e capire dov'è l'errore :)
class Scene_Lotta def main @calcio = false comandi = (["Pugno", "Suplex", "Dropkick", "Irish whip"]) comandi.unshift ("Calcio") if @calcio = true @select_window = Window_Command.new(192, comandi) @select_window.x = 0 @select_window.y = 100 @select_window.opacity = 255 @spriteset = Spriteset_Map.new @window_hud = Window_HUD.new @window_hud.opacity = 255 Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @window_hud.dispose @select_window.dispose end def update @select_window.update @window_hud.update if Input.trigger?(Input::C) case @select_window.index when 0 if @calcio = false $game_system.se_play($data_system.decision_se) $game_variables[1] += 3 $game_map.need_refresh = true $scene = Scene_Map.new else $game_system.se_play($data_system.decision_se) $game_variables[1] += 3 $game_map.need_refresh = true $scene = Scene_Map.new end return when 1 if @calcio = false $game_system.se_play($data_system.decision_se) $game_variables[1] += 20 $game_map.need_refresh = true $scene = Scene_Map.new else $game_system.se_play($data_system.decision_se) $game_variables[1] += 2 $game_map.need_refresh = true $scene = Scene_Map.new end return when 2 if @calcio = false $game_system.se_play($data_system.decision_se) $game_variables[1] += 15 $game_map.need_refresh = true $scene = Scene_Map.new else $game_system.se_play($data_system.decision_se) $game_variables[1] += 20 $game_map.need_refresh = true $scene = Scene_Map.new end return when 3 if @calcio = false $game_system.se_play($data_system.decision_se) $game_variables[1] += 5 $game_map.need_refresh = true $scene = Scene_Map.new else $game_system.se_play($data_system.decision_se) $game_variables[1] += 15 $game_map.need_refresh = true $scene = Scene_Map.new end return when 4 $game_system.se_play($data_system.decision_se) $game_variables[1] += 5 $game_map.need_refresh = true $scene = Scene_Map.new return end end end endIscriviti sul mio canale youtube -
https://www.youtube.com/channel/UCYOxXExvlXiOFfYD1fTFpww?view_as=subscriber
Seguimi su Instagram -
https://www.instagram.com/ancestralguitarist/
---------------------------------------------------------------------------------------------------------------------------------------
Contest vinti
---------------------------------------------------------------------------------------------------------------------------------------
FACE CONTEST # 3
BANNER CONTEST #69
Link to comment
Share on other sites
41 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now