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.

[FILLED] Message with more choices if a switch is on

I want it so when you use a skill, a messagebox comes up with the text "What do you want to transmute?" But the thing is, I don't want any choices to be there until I activate a switch. For example, I have a switch, and when it is enabled, you have the option "Spear", and then if you select it, it will call a common event that I can choose. Then, if I have a different switch on, then the option "Katana" is added, which will call a different common event when selected. I want it to have more than 4 options, and then an option always at the bottom (or only at the very top, if always at the bottom isn't possible), that says "Do nothing", that will do nothing. For the options names, if possible I want them to be chosen in the script. I would also like the script to be compatible with the SDK 1.5, which I think is the one used by the Mr. Mo ABS I am using. I hope I gave enough detail. :(

If anybody could write this script for me, I would of course give them credit, and I would be very, very happy. ^_^ Before I end the message, yes, I did search the forums.
 
mephisto;283857":33z9pjvy said:
You can use the UMS, is compatible with the SDK 1.5 or lower, but not greater.

But, you must put the UMS above the SDK.
Remember if you use the SDK 2.x The UMS doesn't Work..
Thanks for the reply, but am I blind? I didn't see the options to do the stuff I wanted to. :(
 
O.o The last time that i Test the UMS with the SDK doesn't work. thanks for the advise!

I was reborn!

To the Requester: If you see the Demo of the UMS, you can use a lot of conditions...I Read your mind...You want to make a CraftSystem XD... See and you will discover a New world of options. (See the Last NPC at the Bottom of the Screen).
 
I don't really want to make a crafting system, but a system to craft things, deal damage to enemies, and all sorts of other stuff. I don't know if I could do that with the UMS. But thanks. ^_^

Bump.
 
Bumps don't guarantee a filled script request. Just lots of empty post. If you really want your request filled, maybe add an incentive for something.


Because for some reason I am in the mood to file as many script request as I can, let me see what I can't do here.
 
Lol. Sorry, just been busy.


Working on it now... Give me about 30 minutes or so...


EDIT : Ok. Here's what I got.

Code:
module MapMenuCommonEvents
  Command_Words = {0 => 'Common Event 1', 1 => 'Common Event 2', 
                   2 => 'Common Event 3', 3 => 'Common Event 4'}
  Commond_Common_Events = {0 => 1, 1 => 2, 2 => 3, 3 => 4}
  Command_Switches = {0 => 10, 1 => 11, 2 => 12, 3 => 13}
  def self.commands
    commands = []
    for command_id in Command_Switches.keys.sort
      switch_id = Command_Switches[command_id]
      if $game_switches[switch_id]
        commands << Command_Words[command_id]
      end
    end
    commands << 'Back'
    return commands
  end
  def self.call_command(command_word)
    if command_word == 'Back'
      $game_system.se_play($data_system.cancel_se)
      return
    end
    command_id = Command_Words.index(command_word)
    $game_temp.common_event_id = Commond_Common_Events[command_id]
  end
end

class Window_Command
  def command
    return @commands[self.index]
  end
end

class Game_Player
  alias_method :seph_mapmenucommonevents_gmplyr_update, :update
  def update
    return if $seph_mapmenucommand_active
    seph_mapmenucommonevents_gmplyr_update
  end
end

class Scene_Map
  alias_method :seph_mapmenucommonevents_scnmap_update, :update
  alias_method :seph_mapmenucommonevents_scnmap_cm,     :call_menu
  def update
    seph_mapmenucommonevents_scnmap_update
    if @seph_mapmenuce_command != nil
      update_seph_mapmenuce
    end
  end
  def call_menu
    return if @seph_mapmenuce_command != nil
    seph_mapmenucommonevents_scnmap_cm
  end
  def update_seph_mapmenuce
    @seph_mapmenuce_command.update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @seph_mapmenuce_command.dispose
      @seph_mapmenuce_command = nil
      $seph_mapmenucommand_active = nil
      return
    end
    if Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      MapMenuCommonEvents.call_command(@seph_mapmenuce_command.command)
      @seph_mapmenuce_command.dispose
      @seph_mapmenuce_command = nil
      $seph_mapmenucommand_active = nil
      return
    end
  end
  def open_mapmenuce_command
    @seph_mapmenuce_command = Window_Command.new(240, 
      MapMenuCommonEvents.commands)
    @seph_mapmenuce_command.height = 160 if @seph_mapmenuce_command.height > 160
    @seph_mapmenuce_command.x = 200
    @seph_mapmenuce_command.y = 480 - 16 - @seph_mapmenuce_command.height
    @seph_mapmenuce_command.opacity = 160
    $seph_mapmenucommand_active = true
  end
end

Instructions:

To open command window, use
Code:
$scene.open_mapmenuce_command

To setup your commands and such.
Code:
  Command_Words = {command_id => 'Word', ...}
  Commond_Common_Events = {command_id => common_event_id, ...}
  Command_Switches = {command_id => switch_id, ...}

In my example:
Code:
  Command_Words = {0 => 'Common Event 1', 1 => 'Common Event 2', 
                   2 => 'Common Event 3', 3 => 'Common Event 4'}
  Commond_Common_Events = {0 => 1, 1 => 2, 2 => 3, 3 => 4}
  Command_Switches = {0 => 10, 1 => 11, 2 => 12, 3 => 13}

Ok. We have four commands. Here is details on each.

Command 1 : command_id = 0, Command Word (what appears in command window) = 'Common Event 1', command_event_id = 1, switch_id = 10

What this means: When switch 10 is on, the command 'Common Event 1' is added to the command window that appears in window
and when selected, calls common event 1.

The same goes for 2 - 3.


If you need any help, give me an example of:

~ What Commands you have
~ What common events each calls
~ What switch they use
 
Well, I never really do that with my scripts, unless I get paid for a private request. Something public like this, I try to share with anyone, or I wouldn't take public request. I take ones that I think people will like. But I will include your name in the credits of the script.
 

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