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
kiara2425
Newbie


Joined: 04 Feb 2016
Posts: 3

PostPosted: Thu Feb 04, 2016 5:28 am   

Using an alias to update a trigger
 
Hey all.

I am a recent convert over from zmud, and near everything ported over flawlessly. The one thing that didn't was an alias that updated a trigger I had..

Here is what is supposed to happen:

I type:

st pirate

The alias then updates a trigger named 'ghost leaves' with 'attack pirate'

If I type st bandit, it updates ghost leaves with 'attack bandit'

Etc.

On zmud, it was simple: I just had the alias

st

#trigger {ghost leaves} {attack %1}

On cmud, it tries to update the trigger, but it just puts attack %1 -- As in the percent sign and number one. :P
..
Since I suck at coding and have pretty much stayed basic, I'm completely lost as to why it doesn't work. Can someone help me out and tell me what I am doing wrong? :P My % is 'parameter char' and enabled in special characters... and is the same in zmud.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Feb 04, 2016 8:05 am   
 
I would suggest switching to a variable.
Code:
#ALIAS st {AttackTarget=%-1}
#TRIGGER {ghost leaves} {attack @AttackTarget}
#VAR AttackTarget {} ""
The #VAR command at the end creates the variable. I included this command to set the default value to "" which should cause CMud to not record changes to the value of this variable into the package file. This can be a bit of a speed boost. If you need the variable to retain its value between sessions then leave that line off and the variable will be created by the first usage of the st alias.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
kiara2425
Newbie


Joined: 04 Feb 2016
Posts: 3

PostPosted: Thu Feb 04, 2016 6:42 pm   
 
Alright, I updated with the code you gave, but now when I type st pirate, I get:


>{AttackTarget=%-1}
What?

That pops up, and the trigger is not updated. :(
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Feb 04, 2016 9:08 pm   
 
You should just have to copy and paste all of it into the command line. It should change your "st" alias, the "ghost leaves" trigger, and create a variable.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
kiara2425
Newbie


Joined: 04 Feb 2016
Posts: 3

PostPosted: Thu Feb 04, 2016 9:49 pm   
 
Awesome, it works now! :)

I just deleted out the old stuff and added that code in. Thank you so much. That had bothered me for weeks with me trying to figure out what was wrong and how to fix it! :) :)
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