05-07-2009, 01:00 PM
Show Choices with hidden option
by xackery
May 7 2009
I wanted to make choices that by default are hidden, but are unlocked later when you gain e.g. a thief job.
Instead of writing a lengthy two-way condition to check if the unlock occurred, I wrote a check inside Interpreter 3.
This is how it works:
Change Interpreter 3 from:
To...
Now any time you create a choice called "\c[2]Steal" (no quotes) it will skip it as an option if variable 16 is not turned on.
Downside: This ONLY works on the last option of a choice menu, Example:
@>Show Choices: Talk, \c[2]Steal, Dance
If you do my above code, it would display Talk and Dance, but when you click Dance, it'd trigger the \c[2]Steal code.
The recommended way to use this modification is:
@>Show Choices: Talk, Dance, \c[2]Steal
The menu would work normally, only showing the last option when you unlock the Thief class.
If you see any other downsides, or know of a better method let me know!
Thanks for your time.
by xackery
May 7 2009
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
No support is given. If you are the owner of the thread, please contact administration.
I wanted to make choices that by default are hidden, but are unlocked later when you gain e.g. a thief job.
Instead of writing a lengthy two-way condition to check if the unlock occurred, I wrote a check inside Interpreter 3.
This is how it works:
Change Interpreter 3 from:
Code:
#--------------------------------------------------------------------------
# * Show Choices
#--------------------------------------------------------------------------
def command_102
# If text has been set to message_text
if $game_temp.message_text != nil
# End
return false
end
# Set message end waiting flag and callback
@message_waiting = true
$game_temp.message_proc = Proc.new { @message_waiting = false }
# Choices setup
$game_temp.message_text = ""
$game_temp.choice_start = 0
setup_choices(@parameters)
# Continue
return true
end
To...
Code:
#--------------------------------------------------------------------------
# * Show Choices
#--------------------------------------------------------------------------
def command_102
# If text has been set to message_text
if $game_temp.message_text != nil
# End
return false
end
# Set message end waiting flag and callback
@message_waiting = true
$game_temp.message_proc = Proc.new { @message_waiting = false }
# Choices setup
$game_temp.message_text = ""
$game_temp.choice_start = 0
#Xack Filter Choices:
@tmpparam = []
for text in @parameters[0]
if text.index("\\c[2]Steal") == 0 and $game_switches[16] == false
#Xack Don't include option of Steal if thief switch(16) is not on
else
@tmpparam.push(text)
end
end
@parameters[0] = @tmpparam
setup_choices(@parameters)
# Continue
return true
end
Now any time you create a choice called "\c[2]Steal" (no quotes) it will skip it as an option if variable 16 is not turned on.
Downside: This ONLY works on the last option of a choice menu, Example:
@>Show Choices: Talk, \c[2]Steal, Dance
If you do my above code, it would display Talk and Dance, but when you click Dance, it'd trigger the \c[2]Steal code.
The recommended way to use this modification is:
@>Show Choices: Talk, Dance, \c[2]Steal
The menu would work normally, only showing the last option when you unlock the Thief class.
If you see any other downsides, or know of a better method let me know!
Thanks for your time.