[messages] [Module Design] Re: trigger action and && usage.

Tim M timothy.mccarron at sbcglobal.net
Mon Mar 21 07:46:17 MST 2011


"jungleboie" wrote:
> i am finally delving into the world or property managment.. and i have
> hit a snag.
> 
> i have a trigger for placing a token on a token to show that a ship is
> crippled.
> 
> the original trigger was (CurDam <= CripDam) and it worked.. but if i
> did it again.. guess what.. it fired again.. turning off the cripple
> marker.
> 
> so i remade the triger as followes.. (CurDam <= CripDam &&
> Crippled_Name = NotCrippled)
> 
> i do have a layer called "Crippled" with the layer names NotCrippled
> and Crippled. it was working.. but all of a sudden the trigger fires
> before the <= is true.
> 
> example.. a ship has a CurDam (dynamic) of 12 and a CripDam (marker)
> of 3. with the above trigger should fire when CurDam becomes 3 or less
> AND the layer Name is Currently NotCrippled. but the trigger is firing
> with CurDam of 11 or any number above the CripDam.
> 
> don't know if i lost it in the positioning of the triggers and the
> other parts of the proto types, as i was moving stuff around tring to
> fix a reporting bug that was reporting the wrong piece names. now i
> have working piece names, but my trigger isn't working right.


Based on your expression for a start it's not working because you aren't
evaluating out the values of either CurDam or CripDam.

This - CurDam <= CripDam && Crippled_Name = NotCrippled - (what you
wrote) means in part that "CurDam <= CripDam" not "CurDam <= the value
of CripDam" which is what I suspect you intend

It should probably read - "CurDam <= $CripDam$ && Crippled_Name =
NotCrippled". This really means then  "CurDam <= 3 and Crippled_Name =
NotCrippled"

you use $xxxx$ format to evalute the value of the property in question. 

As another example you could do "$CurDam$ <= $CripDam$ && Crippled_Name
= NotCrippled" which would mean "12 <= 3 and Crippled_Name =
NotCrippled"

Marker traits do evaluate numeric values as numeric although there is no
reference to this fact.

Finally I also have some suspicion of your layer/DP usage based on the
comparison use in this context but that is something different
altogether.

_______________________________________________
Read this topic online here:
http://www.vassalengine.org/forum/viewtopic.php?p=22322#p22322


More information about the messages mailing list