View unanswered posts | View active topics It is currently 20 Jun 2019 23:27

Forum rules

- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.

Reply to topic  [ 1 post ] 
Advanced Trigger Manipulation with Javscript 
Author Message
User avatar

Joined: 06 Apr 2014 07:40
Posts: 71
Triggers generally are set and then forgot about, but, in the cases where one would like to have multiple settings for one trigger or, in some very annoying instances, when one would like a trigger to only perform a task in a specific case and then completely ignore all others, there's a way to set and re-set one's triggers programmatically. The method hinges on having functions set within one's userdata that are called by the trigger, and, when one wants to set, reset, or unset a trigger, one simply has to make the associated userdata function an empty one.

Lets see what that might look like:

Alias that pre-loads the userdata trigger functions:
Pattern: load
gwc.userdata.triggers = {
    no_such_creature: function(){},
    too_heavy: function(){},
    you_killed: function(){}

Trigger for "You killed "

After that, you would then have a "profile"-like alias that sets the triggers for a given situation:

Alias that loads situational trigger usage:
Pattern: orc_killer
gwc.userdata.triggers.no_such_creature = function(){
   gwc.connection.send('kill orc');

Now, whenever one kills something, it will immediately try to attack an orc in the area. This is very useful for individuals that know for a fact that they will be needing specific responses for a special case that they are doing that they will have to either turn off or completely alter in the near future. This has the added bonus of using the "load" alias in order to remove any loaded profiles without having to do so by hand. Any number of profiles can then be made and be used to quickswap triggers.

Args Explained - Adv. Trigger Manip - Adding Audio

24 Apr 2015 02:50
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.