I'm trying to use ccoa's UMS's Shortcut feature...
And I have put a script into an event on a bookcase that has a lot of text...
The script is the FIRST thing on my event...
It reads like this:
$game_system.set_shortcut('\bt','\nm[Briar]\i')
And when I activate that event in game, it says "SyntaxError occurred while running script."
What am I doing wrong?
Thank you!
Shortcuts
This is maybe the most fun part of the script. If there is a message code, or series of message codes, you're using a lot, you can define a shortcut to use instead of typing them out. To define a shortcut, use the following code in a Script:
$game_system.set_shortcut('shortcutcode', 'messagecode')
Note that you must use the single quotes ('), not double quotes (").
For example, I might be having a conversationg between two characters, Bob and Rex. Both have face graphics, and I want to switch the justification when each one talks. I could do this:
text: \nm[Bob]\face[bob]\flHi, Rex.
text: \nm[Rex]\face[rex]\frHey, Bob.
text: \nm[Bob]\face[bob]\flWhat shall we do today, Rex?
text: \nm[Rex]\face[rex]\frDunno.
And so on. Or I could do this:
Script: $game_system.set_shortcut('\c1', '\nm[Bob]\face[bob]\fl')
$game_system.add_shortcut('\c2', '\nm[Rex]\face[rex]\fr')
text: \c1Hi, Rex.
text: \c2Hey, Bob.
text: \c1What shall we do today, Rex?
text: \c2Dunno.
Much better.
Note that you cannot use any of the reserved codes as a shortcut. The reserved codes are:
'\v', '\n', '\c', '\g', '\skip', '\m', '\height', '\width',
'\jr', '\jc', '\jl', '\face', '\fl', '\fr', '\b', '\i', '\s',
'\e', '\t1', '\t2', '\th', '\nm', '\font', '\p', '\w', '\ws',
'\oa', '\oi', '\os', '\ow', '\tl', '\tr', '\tc', '\ignr',
'\shk', '\slv', '\ind', '\inc'
This is maybe the most fun part of the script. If there is a message code, or series of message codes, you're using a lot, you can define a shortcut to use instead of typing them out. To define a shortcut, use the following code in a Script:
$game_system.set_shortcut('shortcutcode', 'messagecode')
Note that you must use the single quotes ('), not double quotes (").
For example, I might be having a conversationg between two characters, Bob and Rex. Both have face graphics, and I want to switch the justification when each one talks. I could do this:
text: \nm[Bob]\face[bob]\flHi, Rex.
text: \nm[Rex]\face[rex]\frHey, Bob.
text: \nm[Bob]\face[bob]\flWhat shall we do today, Rex?
text: \nm[Rex]\face[rex]\frDunno.
And so on. Or I could do this:
Script: $game_system.set_shortcut('\c1', '\nm[Bob]\face[bob]\fl')
$game_system.add_shortcut('\c2', '\nm[Rex]\face[rex]\fr')
text: \c1Hi, Rex.
text: \c2Hey, Bob.
text: \c1What shall we do today, Rex?
text: \c2Dunno.
Much better.
Note that you cannot use any of the reserved codes as a shortcut. The reserved codes are:
'\v', '\n', '\c', '\g', '\skip', '\m', '\height', '\width',
'\jr', '\jc', '\jl', '\face', '\fl', '\fr', '\b', '\i', '\s',
'\e', '\t1', '\t2', '\th', '\nm', '\font', '\p', '\w', '\ws',
'\oa', '\oi', '\os', '\ow', '\tl', '\tr', '\tc', '\ignr',
'\shk', '\slv', '\ind', '\inc'
And I have put a script into an event on a bookcase that has a lot of text...
The script is the FIRST thing on my event...
It reads like this:
$game_system.set_shortcut('\bt','\nm[Briar]\i')
And when I activate that event in game, it says "SyntaxError occurred while running script."
What am I doing wrong?
Thank you!