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


Joined: 23 Apr 2005
Posts: 57

PostPosted: Fri Mar 03, 2006 8:07 pm   

Comparing string-list variables - help needed
 
I'm trying to create an expression trigger that fires when "prone" exists within the string-list variable "afflictions", so I've got the pattern set as follows:

%ismember(prone,@afflictions)

However, there are various -other- afflictions which would prevent this from being cured (for example, being asleep or unconscious) and I've added these to another string-list variable called "preventstand".

What I need to do is create an expression trigger which only fires when "prone" is a member of the afflictions variable, but none of those listed in the preventstand variable are.

I tried adding the following value to the pattern shown above:

#FO @preventstand {#IF %ismember(%i, @currentafflictions) {} {stand}}

... but this isn't working, I guess because it's executing the command "stand" upon discovering that each of the @preventstand values isn't listed in @currentafflictions individually, rather than only doing so when -none- of them are.

I'd really appreciate some help with this specific example, and some advice on comparing string lists generally.
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Fri Mar 03, 2006 9:43 pm   
 
Seems like a logic error to me. Say you are unconcious, but not asleep. For unconcious it would not try to stand, but when it runs for asleep the next round, it would discover you are not asleep and try to stand. Seems you need to set a flag that you can set as your run through all the cases and only stand at the end if none of them flagged a prevention. Or just list all the conditions out in the line with OR or AND statements as appropriate. That is the approach taken by ACP from what I've seen.
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