|
Shattuc Beginner
Joined: 30 May 2007 Posts: 13
|
Posted: 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? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: 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 |
|
|
|
Shattuc Beginner
Joined: 30 May 2007 Posts: 13
|
Posted: Thu Jun 07, 2007 10:41 pm |
what do you mean different variables in different classes?
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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. |
|
|
|
skyinthesea Newbie
Joined: 07 Jun 2007 Posts: 1
|
Posted: Fri Jun 08, 2007 8:21 pm |
xianfu ! i'd love to have your msn contact ;)
|
|
|
|
|
|