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
teion
Wanderer


Joined: 03 May 2005
Posts: 72

PostPosted: Wed Sep 12, 2007 3:26 am   

capture to a single var
 
my problem is that i cant get more than one word of text to a single ver

mud output

You order Peacekeepers to engage The Night Creepers

I went something like this
#trigger {You order (*) to engage (*)} {#var enemyarmy=%2}

however this doesnt work and all i end up getting is the enemyarmy var = The and then Night as a class
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Wed Sep 12, 2007 7:05 am   
 
It's because your syntax is incorrect.

#var enemyarmy %2

OR

enemyarmy = %2

One or the other, never combined like you've got.
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Wed Sep 12, 2007 1:21 pm   
 
Gamma, that is part of the problem and the Cmud way of doing it. In Zmud you need to do this

#var enemyarmy "%2"

OR

enemyarmy = "%2"

to get more than one word.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
teion
Wanderer


Joined: 03 May 2005
Posts: 72

PostPosted: Wed Sep 12, 2007 1:44 pm   
 
thanks for the help guys. I'll try it when i get home
Reply with quote
teion
Wanderer


Joined: 03 May 2005
Posts: 72

PostPosted: Wed Sep 12, 2007 5:26 pm   
 
ok The variable enemyarmy now works but I am having trouble once more here

mud output

Bloodstalkers decides to regroup!
A squad of variags called 'Bloodstalkers' takes 0 casualties
A squad of men called 'The Bloodguard' takes 0 casualties

The Bloodguard decides to regroup!
A squad of men called 'The Bloodguard' takes 0 casualties
A squad of variags called 'Bloodstalkers' takes 0 casualties

Bloodstalkers decides to flank!
A squad of variags called 'Bloodstalkers' takes 0 casualties
A squad of men called 'The Bloodguard' takes 0 casualties

A squad of variags called 'Bloodstalkers' takes 0 casualties
A squad of men called 'The Bloodguard' takes 0 casualties

here my army is The Bloodguard and the enemy army is Bloodstalkers
now the enemyarmy var is Bloodstalkers
but the problem is i want to order my army to encircle when they flank and regroup when they do
My triggers are like this
#Trigger {@enemyarmy decides to flank!} {order encircle}
#Trigger {@enemyarmy decides to regroup!} {order regroup}
#Trigger {@enemyarmy decides to charge!} {order defend}
#Trigger {@enemyarmy decides to defend!} {order regroup}

the patterns match but the value doesnt work
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Wed Sep 12, 2007 11:28 pm   
 
Try this #Trigger {{@enemyarmy} decides to defend!} {order regroup}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
teion
Wanderer


Joined: 03 May 2005
Posts: 72

PostPosted: Thu Sep 13, 2007 1:45 am   
 
it worked :) just curious why did it work?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Sep 13, 2007 2:23 am   
 
Somehow you have more than one value in the variable. Using @varname means you are looking for the entire contents of varname, whereas {@varname} means you are looking for any member of a master list:

#trigger {@Name is here.} {#say hi}
Name = Ted <--pattern looks for the word 'Ted'
Name = Ted|George|Phil <-- pattern looks for the word 'Ted|George|Phil'

#trigger {{@Name} is here.} {#say hi}
Name = Ted <--pattern looks for the word Ted
Name = Ted|George|Phil <-- pattern looks for the word 'Ted', the word 'George' or the word 'Phil'
_________________
EDIT: I didn't like my old signature
Reply with quote
teion
Wanderer


Joined: 03 May 2005
Posts: 72

PostPosted: Thu Sep 13, 2007 1:48 pm   
 
the variable has only one value assigned. It may be that since the variable is longer than one word, just specifying the variable in a trigger as @varible may be just searching for one word in the variable however {@variable} specifies the whole variable.... if any of that made sense
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