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


Joined: 11 Mar 2002
Posts: 93

PostPosted: Thu Sep 29, 2005 11:21 pm   

Evaluate Function
 
I can't seem to get this evaluate to work right. If anyone can help I would appreciate it.


Code:
%eval( (!%ismember( "broken left arm", @Affliction) and !%ismember( "broken right arm", @Affliction)) and !%ismember( paralysed, @Affliction) and !%ismember( "pinned left leg", @Affliction) and !%ismember( "pinned right leg", @Affliction) and !%ismember( entangled, @Affliction) and !%ismember( webbed, @Affliction) and !%ismember( impaled, @Affliction))


What I want is if I have a broken left arm AND a broken right arm, to evaluate as 0. However it seems to evaluate as 0 if I have either or.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Sep 30, 2005 8:05 am   
 
Perhaps you should describe the full logic you want in words. As you have it now if any 1 of those conditions is true then the %eval will result in false. If this is what you want with the exception of the arm things then this would work.
Code:
%eval( !((%ismember( "broken left arm", @Affliction) and %ismember( "broken right arm", @Affliction)) or %ismember( paralysed, @Affliction)  or %ismember( "pinned left leg", @Affliction) or %ismember( "pinned right leg", @Affliction) or %ismember( entangled, @Affliction) or %ismember( webbed, @Affliction) or %ismember( impaled, @Affliction)))

_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Solaras
Wanderer


Joined: 11 Mar 2002
Posts: 93

PostPosted: Fri Sep 30, 2005 8:57 pm   
 
Vijilante wrote:
Perhaps you should describe the full logic you want in words. As you have it now if any 1 of those conditions is true then the %eval will result in false. If this is what you want with the exception of the arm things then this would work.
Code:
%eval( !((%ismember( "broken left arm", @Affliction) and %ismember( "broken right arm", @Affliction)) or %ismember( paralysed, @Affliction)  or %ismember( "pinned left leg", @Affliction) or %ismember( "pinned right leg", @Affliction) or %ismember( entangled, @Affliction) or %ismember( webbed, @Affliction) or %ismember( impaled, @Affliction)))
That's exactly what I want. If any one of those is true then evaluate as false, but both arms must be broken, not just a single arm.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Sep 30, 2005 9:32 pm   
 
The requirement that both arms be broken, but only when other things, actually make a very big difference on the logic. In my previous post there actually was no requirement that either arm be broken to make the statment evaluate to the value you want. All that is required is one of the other conditions, arms are only a factor if both are broken. Trying to be a mind reader here, but I am guessing you are looking at conditions for using a tree tatoo. I am also guessing that my previous post does not really provide the logic you want. Try this on for size:
Code:
%eval( !(%ismember( "broken left arm", @Affliction) and %ismember( "broken right arm", @Affliction) and (%ismember( paralysed, @Affliction)  or %ismember( "pinned left leg", @Affliction) or %ismember( "pinned right leg", @Affliction) or %ismember( entangled, @Affliction) or %ismember( webbed, @Affliction) or %ismember( impaled, @Affliction))))

I would suggest playing with it offline and manually setting different afflictions to make sure it evaluates how you want under ever condition. If you find any problem spots please post back the specific set of afflictions and how you want it to come out.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
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