Trigger not firing when moving between maps

G’day all,

I want to be able to stop players from moving some cards from a deck map to the main play map.

I have set CTRL P as the key that fires when a unit ends its turn on the main map. I then have a trigger in the card set to watch for CTRL P. To determine if a card has moved from the deck map to the main map, I have set up the trigger properties to only fire when CurrentMap!=OldMap. This will then fire a Report Action trait to let the players know what has happened.

The problem is that the Report Action always fires. What I believe should happen is that on the first placement of the card, the trigger should fire but further movement of the card on the main map won’t set off the trigger as CurrentMap would equal OldMap after this first movement. I then added 2 Text labels on the card to display the CurrentMap and the OldMap to make sure that they were working correctly and they were.

I can’t understand why the trigger action would be firing.

LB

P.S. I know I can use the “Auto report format for movement to this map” to display text however I would like to add more commands once this trigger gets sorted. Such as sending the card back to where it came from using the Send to location trait.

A Report Action produces a report that includes references to properties before and after the execution of a specific key.

In this case, you are reporting on properties before and after the execution of the Ctrl P command.

What is the state of the piece when the Ctrl P is executed? The manual drag-and-drop has completed and the piece is on the new map and then the Ctrl P is issued. Ctrl P does not actually cause any change in the counter, so, yes, CurrentMap will = OldMap. Even if Ctrl-P moves the counter, it is already on the new Map before it is executed.

B.

*********** REPLY SEPARATOR ***********

On 3/09/2009 at 7:56 AM LurchBrick wrote:


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

According to my tests, that isn’t correct Brent.

I tried another test to show this problem. This time I added a trigger action that fires on CTRL T. This has the same property match of CurrentMap!=OldMap. When this gets executed by the right click menu, it fires of a report action trait that displays the CurrentMap & OldMap using this format (Old map = $OldMap$ and Current map = $CurrentMap$).

So I move the card from the deck to the main map window. I then press CTRL T. The report action fires and displays “(Old map = Deckwindow and Current map = Mapwindow)”. So far so good.

I then move the card within the main map window. I press CTRL T again. The report action fires and displays “(Old map = Mapwindow and Current map = Mapwindow)”. Not so good. This trigger shouldn’t fire as the report action shows, but it does.

LB

You seem to be talking about two different things - a ‘Trigger Action’ and a ‘Report Action’ trait, but discussing them like they are related. The Report Action trait is dumb, it has no relation to a Trigger Action trait that happens to have the same key specified. The Report Action will always fire regardless of whether or not the Trigger Action property string is matched or not - the two are unrelated.

If you want to use a Report Action to report on the successful action of a Trigger, then you will need to change the Report Action to report on a Key Command that the Report Action issues, not on one that it reacts to.

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Of course, using the correct syntax of

CurrentMap!=$OldMap$

would probably help a lot too :slight_smile:


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Doh!

Thanks again Brent. All is understood.

How do we know when to use the $ signs for properties? Since in the trigger action CurrentMap does not have any whilst OldMap does.

The Help section on Trigger actions doesn’t show this as an example, perhaps it should?

There’s an entry in the FAQ:

vassalengine.org/wiki/doku.p … omparisons

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Funny you should mention the wiki as I was just looking at it and totally missed that section. Cheers.