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?
# -------------------------------------------------------------------------
# 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