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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
methonis
Beginner


Joined: 16 Dec 2002
Posts: 13

PostPosted: Mon Dec 16, 2002 11:24 pm   

Trigger
 
Greetings,
I'm trying to figure out how to create a specific trigger, but for some reason not understanding how. I don't expect anyone to give me code, just a general point in the right direction. Here's what I'm trying to do:
Lets say I'm wielding a shortsword. If someone compulsed me and told me to unwield shortsword or by some other means, I would get the text: You cease to wield a silver shortsword in your right hand.

So what I want is to create a trigger that will auto wield it again. The trick is, I want this to apply to MANY wieldable items. So I'm trying to figure out how I can capture the item name from the unwield text, store that, and then wield that item again.

Any clue?

Thanks.

Meth
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Dec 16, 2002 11:43 pm   
 
The best way is not to capture the item name from the unwield message, but to capture the name when you wield the sword. For this, you need to create an alias which will accept one argument and do two things, wield the item you want using the passed argument (which should be a keyword for the item you want to build), and set a variable to contain whatever argument you passed to the alias.

After creating the alias, you would then create a trigger to fire when you see the line that informs you that you stop wielding the item. When this trigger fire it will wield the items you previously had. The trigger knows the keyword of the item you previously had since it is stored in the variable that the alias created.

One thing to take into consideration is that you will want to disable the trigger when you want to manually unwield the item. Otherwise, it will just keep wielding the item each time you unwield it.

Kjata
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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