Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: Thu Oct 29, 2009 7:07 pm   

Whats the difference between an alias and an event?
 
i created an event called LootCorpse and i raise it when i get exp.

i guess i could create an alias called LootCorpse and do the same thing.

i was just wondering what the differences are and are there benefits do doing it one way or the other?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Oct 29, 2009 7:55 pm   
 
Events are like triggers in alias form. When you raise an event, all defined events with that event name are executed.
_________________
EDIT: I didn't like my old signature
Reply with quote
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: Thu Oct 29, 2009 8:04 pm   oh
 
so i can have the same event name in multiple places in my code programmed to do different things?

and when i raise the event. all those events will run?
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Thu Oct 29, 2009 8:33 pm   
 
That is correct. You can also #raise an event with one or more arguments, which can be accessed in the event objects with %1, etc. This is especially powerful if you give IDs to the event objects or put them into classes, and use #t+ and #t- to enable and disable which ones are actually active at any time. When you #raise myEvent, all of the enabled myEvent objects will fire, in order of priority number. A great feature.
Reply with quote
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: Thu Oct 29, 2009 9:02 pm   
 
wow thats sounds really cool.

how do you use the id to turn things on and off with #T- and #T+ i always used the name of the thing i was turning on and off which makes it so that i have to not use spaces in my names. but if i could use the id that would be cleaner.
Reply with quote
Tarken Aurelius
Apprentice


Joined: 23 Oct 2008
Posts: 120
Location: Cincinnati, Ohio

PostPosted: Thu Oct 29, 2009 11:02 pm   
 
You have to first assign the trigger/class/setting an ID which can be done when you create it:

Code:
 #TRIGGER id {pattern} {commands} classname options


or there is a box labeled "ID" inside the trigger editor where you can assign it an ID. Personally, I use the number you can see on the XML tab for simplicity, then something like this would work:

Code:
#TRIGGER 26 {^(%w) tells you} {#BEEP} "tells"


With the following to turn it on/off:

Code:
#T+ 26
#T- 26


I hope this helps!
_________________
Tarken Aurelius, quality triggers since 2004! Trigger consulting since 2008! Content Developer at BatMUD (www.bat.org)
Reply with quote
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: Fri Oct 30, 2009 12:54 am   yeah it does
 
thanks
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net