Create account / Log in

trigger action and && usage.

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

trigger action and && usage.

Postby jungleboie » March 21st, 2011, 4:29 am

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.
jungleboie
 
Posts: 11
Joined: April 2nd, 2008, 5:53 pm

Re: trigger action and && usage.

Postby DrNostromo » March 21st, 2011, 2:21 pm

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.


I don't believe you can use a Marker to in this way. A Marker is just a way of identifying piece as having a particular attribute (like PieceType = Tank) but it is not a numerical value that you can adjust or compare.

What I believe you need to do here is create a Dynamic Property trait called CripDam and give it a value of 3. If this is constant (unchangeable), then don't include any key commands.
User avatar
DrNostromo
 
Posts: 1061
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA

Re: trigger action and && usage.

Postby Tim M » March 21st, 2011, 2:46 pm

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.
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1812
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: trigger action and && usage.

Postby jungleboie » March 21st, 2011, 9:43 pm

thanks for the responce. as i can't get the trigger to fire as needed, i am dropping it for now. the mod is done and the trigger was a project that isn't required. will cont. to play with it. i do think the prob. is in the order in the comands.

i just don't understand why it was working.. then just stopped. the trigger is fireing anytime the watch for command is seen. ignoring the matched propertys. even if i change the trigger to just CurDam <= CripDam.

on a sidenote, anyone know why sympolic dice in a toolbar un-nest and make new buttons?
jungleboie
 
Posts: 11
Joined: April 2nd, 2008, 5:53 pm

Re: trigger action and && usage.

Postby mycenae » March 21st, 2011, 10:00 pm

I was wondering about the symbolic dice as well. The same thing happens with Random Text buttons, too. Neither likes to live on a toolbar. Bug?
mycenae
 
Posts: 394
Joined: May 16th, 2008, 6:41 pm


Return to Module Design

Who is online

Users browsing this forum: No registered users and 2 guests