Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> Changing Module inside Eventing, I'm just wondering :P
Jonnie19
post Nov 20 2012, 02:04 PM
Post #1


Are you trying to rise from your lullaby?
Group Icon

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 smile.gif

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.

Thanks for your help in advance tongue.gif


__________________________

Finished Projects:
Slenderman's Army:


Go to the top of the page
 
+Quote Post
   
 
Start new topic
Replies
Jonnie19
post Nov 26 2012, 03:33 PM
Post #2


Are you trying to rise from your lullaby?
Group Icon

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 smile.gif
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 tongue.gif) It's probably something simple but i've tried going through the coding and I'm not sure I've got this right smile.gif
Help really appreciated tongue.gif


__________________________

Finished Projects:
Slenderman's Army:


Go to the top of the page
 
+Quote Post
   
Philip
post Nov 26 2012, 06:24 PM
Post #3


Nura (The Jade Ring)
Group Icon

Group: Revolutionary
Posts: 325
Type: Developer
RM Skill: Masterful




QUOTE (Jonnie19 @ Nov 26 2012, 05:33 PM) *
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 smile.gif
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 tongue.gif) It's probably something simple but i've tried going through the coding and I'm not sure I've got this right smile.gif
Help really appreciated tongue.gif

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

Phil


Go to the top of the page
 
+Quote Post
   



Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 25th May 2013 - 03:08 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker