Triggers and Aliases - Different Profiles

Posted by Platypus on Sun 24 Nov 2013 06:58 PM — 4 posts, 16,947 views.

#0
I know it's possible to save character-specific triggers and aliases by creating and saving them as individual "worlds".

Is there any way to create multiple sets of both for conditions of multi-classing with the same character?

Example: A character is a shaman and starts as a human. It then beast forms into a coyote. I need certain triggers/aliases available as the human and then other completely different ones as the coyote.

To my non-coding mind this sounds impossible, if not horribly difficult and cringe-worthy. Am I wrong? Am I right?

Amended on Sun 24 Nov 2013 07:27 PM by Platypus
Australia Forum Administrator #1
There are a few ways of doing this.

First, you can save triggers and aliases as a batch. Go to the aliases list (for example), select the ones you want, and then click "Save". In your other world, click "Load" and load that file in. However changes you make to the first world won't automatically propagate.

Another way is to save the triggers / aliases (this will be two operations) as separate files, and then use the Global Configuration -> Defaults tab to make these files the "default" set of triggers / aliases. In effect they are loaded at startup, replacing ones that the other copies might have had. The problem with this is that it is hard to customize the other worlds.

In many ways the preferred way is to make a plugin (there is a plugin wizard to help with this) and then each world loads that plugin. Then there is a single place (the plugin) in which you make changes. However once created the plugin file does not have a GUI interface, you have to make changes by editing or copying / pasting new triggers and aliases.

One final thing you could consider if you are changing form is to use groups. For example the "beast" group and the "shaman" group. Then a simple alias could activate one group and deactivate another. Then you could have a single world file, and by activating/deactivating groups switch from one set of triggers/aliases to another.

Here is an example, the other ones should follow from this:


<aliases>
  <alias
   match="enable shaman"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>

EnableGroup ("shaman", true)  -- or false to disable
ColourNote ("yellow", "", "Shaman group enabled.")

</send>
  </alias>
</aliases>


Template:pasting
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


Each trigger / alias / timer has a "Group" box where you enter the relevant group name.
Amended on Sun 24 Nov 2013 07:39 PM by Nick Gammon
#2
If I went the group option, how does it function if I have some aliases/triggers that are the same? Do I need a third group or can I keep those without a group name and have them still function?

For instance, if have 6 shared triggers that I want to fire on both the shaman AND his coyote form. Then a bunch of aliases and triggers I want JUST on the coyote form but NOT the shaman form; and vice versa.

Right now the issue is mainly eat/drink problems, to be honest. There are others, natch, but this explains what I mean well: the shaman has a different pack and different food on him, and when he turns into a coyote he's got something else entirely.

Right now what I do is make an alias that has:

"get pie backpack
eat pie
get chicken crate
eat chicken"

So of course I see "I see no crate here." "You do not have that item" before it gets the right thing out and he eats it. And it works, but it's spammy as hell.

I guess technically these things could be fixed easily by making everything the same on the character in both forms (carrying a backpack with the same food, or making their decanters of water the same), but it's just not easy to manage that.
Amended on Sun 24 Nov 2013 09:45 PM by Platypus
Australia Forum Administrator #3
Ungrouped triggers would be unaffected.

So make common ones have no group. The ones for shaman form put in the shaman group and the ones for coyote form put in the coyote group.

So your alias could look like this:


<aliases>
  <alias
   match="enable shaman"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>

EnableGroup ("shaman", true)
ColourNote ("yellow", "", "Shaman group enabled.")
EnableGroup ("coyote", false)
ColourNote ("yellow", "", "Coyote group disabled.")

</send>
  </alias>
</aliases>


A single alias ("enable shaman") enables the shaman group and disables the coyote one. You can make a similar one to go the other way.