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
jtown84
Novice


Joined: 09 Oct 2007
Posts: 36

PostPosted: Fri Mar 28, 2008 11:40 am   

Triggering on Expanded Variables
 
Hey all, I have a simple alias that i used to sub mobs, so i can turn
Quote:
A squid torn apart floats motionless in the water.

into
Quote:
A bloody squid [14]

or Whatever the case may be.
the alias simply did
Code:
#prompt MobPattern "Instructs";#prompt NewSub "Instructs"

etc.. the alias would expand those variables and create a trigger from it..
Code:

#tr <@MobPattern> {#sub <@newsub>}

Is there a way to do the same thing in CMud?
Variables wont expand via <> and i cant find the setting like it was in zMud.
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Fri Mar 28, 2008 12:59 pm   
 
Put the string in a local variable and use that to create your new trigger. It's been documented in the CMUD vs zMUD changes list, I believe.

Something like this should work:
Code:
$MobPattern = "stuff goes here"
$NewSub = "other stuff here"
#TRIGGER {$MobPattern} {#SUB {$NewSub}}
Reply with quote
jtown84
Novice


Joined: 09 Oct 2007
Posts: 36

PostPosted: Fri Mar 28, 2008 2:40 pm   
 
That worked great.. I swore i thought of that.. but i guess i never tried it.
anyways.. The only part i cant get working correctly.. is the class folder part..
Perhaps i could figure it out if i slept.. but Not in the mood yet..
Code:

#Prompt newmobpattern "Enter the name, EXACTLY from copy/paste"
#PROMPT mobinfo "Enter the addmob info (i.e addmob level keyword)"
#PROMPT subinfo "Enter the sub info you want to see"
#PROMPT classfolderinfo "Enter the class folder you want to add mob to or New class folder you want to put trigger into"
$newmobpattern = @newmobpattern
$mobinfo = @mobinfo
$subinfo = @subinfo
$classfolderinfo = @classfolderinfo
#trigger {$newmobpattern} {
  #sub {$subinfo}
  $mobinfo
  } "MobSubs|$classfolderinfo"
newmobpattern = ""
mobinfo = ""
subinfo = ""
classfolderinfo = ""

The problem is, it creates a folder $classfolder info, I know why it does it, I cant figure out how to expand that var for it to work.. I suppose i could do #class MobSubs|$classfolderinfo, then do the trig, and then close it.. Thats 1 alternative.. if there is another let me know?
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Fri Mar 28, 2008 5:03 pm   
 
Try "MobSubs|"$classfolderinfo, moving the last quote so the variable is outside the quotes.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Fri Mar 28, 2008 8:00 pm   
 
Larkin, isn't that implicit concatenation, to be avoided? Would %concat("MobSubs|", $classfolderinfo) be better?
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Fri Mar 28, 2008 8:36 pm   
 
I use it in many places, and it works fine for me. Your mileage may vary.
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