RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[VX] Custom menu option? Or just key input?

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 69
RMRK Junior
Ok, so I developed a skill system that uses variables. I know how to make the window and get the key input to work.. however I would like to make this script accessible from the menu.  I want it to look like this:


Skills:

Skill:          Known by:          Level:

Lockpicking        Ralph              8
Disable Trap      Ralph              7
Mining:             Ulrika              10


... and so forth.    The window should putt the # for level for game variables.


The script I'm using right now is this..  I want to edit it to make it display the new window shown above, and if possible adding a new menu option..  how can this be done?

                 

Code: [Select]
#   -------------------------------------------------------------------------
#   Quest Objective, Version 1.0
#   Idea by DM Thanatos, Written mostly by Exhydra
#   Special Thanks to Pacman, and Modern Algebra for my bombardment of
#   questions.
#   -------------------------------------------------------------------------


#   You can call this window anywhere by using the following in a script input box : Quest_Log.new
#   To make sure that the player doesn't open multiple quest windows before closing the first,
#   you can call the script like so : Quest_Log.new unless $QUEST_LOG_WND != nil

#   Sets a Global Variable; this will keep track of if the window is currently
# open or not.
$QUEST_LOG_WND = nil

#   To catch keyboard strokes, we need a reliable way of calling the update
# method within our Quest_Log window. Scene_Map is updated every frame, so
# we'll use that to make sure our window is both updated and terminated
# properly since our window can't update itself without causing a fatal
# loop.

class Scene_Map
 
  #   We'll make an alias of Scene_Map's terminate and update so we don't   
  # over-write the methods, thus increasing compatability with other scripts.
  alias quest_log_terminate terminate unless $@
 
  def terminate
    # We'll call our alias first.
    quest_log_terminate
   
    # Dispose of the Quest_Log window unless it isn't open.
    $QUEST_LOG_WND.dispose unless $QUEST_LOG_WND == nil
  end
   
 
    alias quest_log_update update unless $@
   
    def update
      # We'll call our alias first.
      quest_log_update
     
      # Update the Quest_Log window unless it isn't open.
      $QUEST_LOG_WND.update unless $QUEST_LOG_WND == nil
     
    # Using Glitchkey's Key Input Module to catch the '1' key to open the
    # quest window.
    # .trigger? is better in this case than .press? because if the player
    # holds down the button, the Quest Log window will flash quickly because
    # it is being updated every frame.
    if Keys.trigger?(Keys::N1)
      # When the Number 1' key is pressed and the Quest Log window isn't open ...
     
      if $QUEST_LOG_WND == nil
        # Play a sound.
        RPG::SE.new('Decision2.ogg', 100, 100).play
       
        # Open a new Quest Log window.
        Quest_Log.new
       
      else # When the 'Number 1' key is pressed and the Quest Log window is open ...
        #Play cancel sound
        Sound.play_cancel
       
        # Close the Quest Log window.
        $QUEST_LOG_WND.dispose
      end
    end
 
  end
 
end # Scene_Map

class Quest_Log < Window_Selectable

def initialize
  super(0,270,545,146)
 
  #   We'll set the Global Variable to the current window. Now it will update
  # and terminate properly.
  $QUEST_LOG_WND = self
 
  @@quest_log = $game_variables[18] # Change the number to the in-game variable
                                    # you wish to use.
 
  #   We'll call the refresh method to display the text. Keep in mind that
  # currently, the player can run around with this window open and might
  # complete quests while showing the old data.
  refresh
end

def refresh
  # Clear the current contents
  self.contents.clear
 
  case @@quest_log
    when 1
      self.contents = Bitmap.new(width-32, height-32)
      self.contents.font.name = "Arial"
      self.contents.font.size = 22
     
  # This part displays the text perfectly within a window at the bottom of
  # the screen, omit the text lines if not all lines are needed.
     
      text = "The Wizard, Virgil, has agreed to help me escape. I will"
      text1 = "need to find some spell components that he can use to cast"
      text2 = "magic. It would be wise to talk to everybody on the ship to"
      text3 = "possibly find something useful for him."
     
      self.contents.draw_text(0, 0, 600, 32, text)
      self.contents.draw_text(0, 28, 600, 32, text1)
      self.contents.draw_text(0, 56, 600, 32, text2)
      self.contents.draw_text(0, 84, 600, 32, text3)
     
         
    end 
  end
 
  def dispose
    # Make sure the Global Variable is set to nil when closing the window.
    $QUEST_LOG_WND = nil
   
    # Dispose of the window.
    self.contents.dispose
    super
  end
 
  def update
    refresh
  end
 
end # Quest_Log

***
Rep:
Level 81
Monster Hunter

***
Rep:
Level 69
RMRK Junior
The script looks impressive however, it seems he has a lot of skills pre planned and I don't know if they are implemented into the game which i don't want, im gonna try it out and see how it looks.  thank you for the quick response. :)

***
Rep:
Level 69
RMRK Junior
The script you gave has all this premade stuff in it, I can draw a window myself, all I need is a menu option and a place to put in my variables,  I dont want to use his skill system, I made one myself and would like to use it.

The only thing I really want is a menu option such as it already exists (I dnt know how to add a selectable in the menu..)
Its purpose is to display skill names and my variables I already have set up..  Any ideas on that?

***
Rep:
Level 81
Monster Hunter
The script you gave has all this premade stuff in it, I can draw a window myself, all I need is a menu option and a place to put in my variables,  I dont want to use his skill system, I made one myself and would like to use it.

The only thing I really want is a menu option such as it already exists (I dnt know how to add a selectable in the menu..)
Its purpose is to display skill names and my variables I already have set up..  Any ideas on that?
sorry for the late response , i'll see what i can do ^^

**
Rep: +0/-0Level 70
RMRK Junior
Ok so I hope this helps:

http://pastebin.com/p2mpv2vd

BTW: Your name means "Sea" in greek, right?

Greetings,

HungrySnake
« Last Edit: October 02, 2011, 06:18:14 PM by slimmeturq61 »

***
Rep:
Level 69
RMRK Junior
"Death", and I'll check it out later, thanks for the help. :)