Group: Global Mod
Posts: 1,311
Type: Developer
RM Skill: Intermediate
Rev Points: 45
So, I'm now jumping into scripting, so after working with abit of JS thanks to Code Acadamy. I'm attempting to make my first menu script... Basically I am looking for three seperate menu backgrounds for each of the three Characters. I'm using GubID's FFT Menu Script Tutorial to help start me out
Anywho, here is the beginning of the script (At the moment I'm just trying to get the actual thing to change when I use an Script Even command.
My small script
CODE
module Lullaby_Menu #----------------------------------------------------------------------------- # Menu_Background_Type #----------------------------------------------------------------------------- # 0 = First Character # 1 = Second Character # 2 = Third Character #----------------------------------------------------------------------------- Menu_Character_Type = 0 First_Chara_BG = "Menu_Back" Second_Chara_BG = "Menu_Back1" Third_Chara_BG = "Menu_Back2" end class Scene_Menu < Scene_Base def start create_menu_background case Lullaby_Menu::Menu_Character_Type when 0 bitmap = Cache.system(Lullaby_Menu::First_Chara_BG) @menuback_sprite.bitmap = bitmap when 1 bitmap = Cache.system(Lullaby_Menu::Second_Chara_BG) @menuback_sprite.bitmap = bitmap when 2 bitmap = Cache.system(Lullaby_Menu::Third_Chara_BG) @menuback_sprite.bitmap = bitmap end end def update if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new end end def terminate super dispose_menu_background end end
Now, what I wanna know is how to change
CODE
Menu_Character_Type = 0
inside an event command. I know this is probably easy for experience scripters, and may seem a stupid question, but hey I'm learning.
Group: Global Mod
Posts: 1,311
Type: Developer
RM Skill: Intermediate
Rev Points: 45
Okay, thanks to Jens and Thallion for both helping me correct the problem...now I have a syntax error, which I am trying to solve, now perhaps an experienced scripter could help solve the issue
CODE
module Lullaby_Menu def initialize First_Chara_BG = "Menu_Back", Second_Chara_BG = "Menu_Back1", Third_Chara_BG = "Menu_Back2", end def Lullaby_Menu.menu_character_type if @menu_character_type.nil? @menu_character_type = 0 end end return @menu_character_type end def Lullaby_Menu.menu_character_type=(value) @menu_character_type = (value) end end end
There is something wrong with the Syntax of this module....(thank you Jens ) It's probably something simple but i've tried going through the coding and I'm not sure I've got this right Help really appreciated
Okay, thanks to Jens and Thallion for both helping me correct the problem...now I have a syntax error, which I am trying to solve, now perhaps an experienced scripter could help solve the issue
CODE
module Lullaby_Menu def initialize First_Chara_BG = "Menu_Back", Second_Chara_BG = "Menu_Back1", Third_Chara_BG = "Menu_Back2", end def Lullaby_Menu.menu_character_type if @menu_character_type.nil? @menu_character_type = 0 end end return @menu_character_type end def Lullaby_Menu.menu_character_type=(value) @menu_character_type = (value) end end end
There is something wrong with the Syntax of this module....(thank you Jens ) It's probably something simple but i've tried going through the coding and I'm not sure I've got this right Help really appreciated
You have too many end statements in your "Lullaby_Menu.menu_character_type" def
__________________________
"If your mind goes blank don't forget to turn off the sound." Unknown Author