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
Shattuc
Beginner


Joined: 30 May 2007
Posts: 13

PostPosted: Thu Jun 07, 2007 7:42 pm   

Trigger setting variable issues
 
I have a few triggers set up to recognize certain sentences and then to set a variable
ie I have one that works perfectly, when I hold a certain weapon it sets the var @weap to the current weapon I'm holding so I can use the @weap variable in certain attack aliases. works fine.

I was trying to set a variable when I come across certain NPC's
ie #trig (Wally is standing here) {#var npc wally}

for the first npc I set the trigger up for, it set the variable npc fine, I check it in game by typing #echo @npc which returns Wally
now I set up a second one and I used the same style
#trig (Waldo is standing here) {#var npc waldo}
however when I echo @npc I still get wally, and when I just type #var npc waldo into to the mud, and then echo the var, I still get wally. What the hell is going on?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Thu Jun 07, 2007 10:02 pm   
 
it should be the curly brackets {} around the pattern, not parenthesis ()

also, it should be: #VAR npc {value}

not sure that would mess it up seeing as its only one word, but still

Another thing, check to make sure you dont have two different @npc variables in differant classes/packages
_________________
Discord: Shalimarwildcat
Reply with quote
Shattuc
Beginner


Joined: 30 May 2007
Posts: 13

PostPosted: Thu Jun 07, 2007 10:41 pm   
 
what do you mean different variables in different classes?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu Jun 07, 2007 10:50 pm   
 
Inside your zMUD settings, you can have folders to separate different scripts - they're called classes. What might be happening is that you have a class structure like this:

Code:
root
|
\- SomeClass
|
\- Some Other Class

And each folder could contain its own npc variable. This can cause problems when using the #var command, especially from within aliases and such - the alias could be setting the version of @npc that's in the SomeClass class, but when you refer to @npc in your scripts, it finds the version in the root first.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
skyinthesea
Newbie


Joined: 07 Jun 2007
Posts: 1

PostPosted: Fri Jun 08, 2007 8:21 pm   
 
xianfu ! i'd love to have your msn contact ;)
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