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.

How do I create more than one shortcut in ccoa's UMS?

Alright, I know you can just use the call script command, but I wouldn't use that too much since I never really have one long dialogue in one event. What I'd prefer is to just have a couple permanent shortcuts that I can use whenever. So far it works for one shortcut by editing this part of the script:
Code:
    @used_codes = ['\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']
                   
    @shortcuts = {}
  end
  
  def add_shortcut(shortcut, code)
    text = shortcut.downcase
    if !@used_codes.include?(text)
      @shortcuts[shortcut] = code
    end
  end

to look like this

Code:
    @used_codes = ['\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']
                   
    @shortcuts = {'\no', '\ignr\nm[]\face[]'}
  end
  
  def add_shortcut(shortcut, code)
    text = shortcut.downcase
    if !@used_codes.include?(text)
      @shortcuts[shortcut] = code
    end
  end

This works fine. whenever I type in \no, it performs the commands perfectly.

Now, is there a way to have several of these, as opposed to just one? Ideally. i'd like something like this:

Code:
    @shortcuts = {'\no', '\ignr\nm[]\face[]'},{'\Ba', '\ignr\nm[Badandy]\face[Badandy]},{etc, more code shortcuts},{one or two more, you get the idea;)}
  end

Something like that, but without it actually causing my game to crash >_> I can't code so I just guessed as to what it'd be. Is there a way of making this happen? Thanks in advance.
 

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