another trigger problem in 3.1?

My game pieces each have an attack command that plays a random sound. I set it up like so:

  1. The attack command triggers a roll of a die.
  2. A set of other triggers watches for the attack command, and checks the result of the die roll. Whichever one matches the result plays its corresponding sound.

This all worked fine under versions up to 3.0.17. I’ve since tried 3.1 betas 3, 5 and 6, and it’s been broken in all of them. I know the trigger to roll the die still works, because I can set the dice button to report its result, and it does so when I use the attack command. I can also play the sounds manually using the associated keystrokes. So I guess it’s the triggers that watch for the dice results that aren’t working. I have no idea why or how to fix it. Help?

Here’s the stripped-down module: rapidshare.com/files/168515815/t … .vmod.html

Start a new game on Test Board, and grab the first game piece found in ‘Objects’, a Hive Tyrant. Up top you’ll see three graphical buttons with grayscale symbols on them; click the left one to advance to the shooting phase. Now in the Hive Tyrant’s right-click menu, use Actions → Declare Ranged Attack (voiced). You’ll get a sound in 3.0.17, but not in 3.1.

Hi Feddy,

I had a look and the fact that it worked under 3.0.17 is the result of a bug, as your Trigger Action Property Expressions are incorrect. The bug was fixed in 3.1.

For example, the expression on the ‘echo 1’ trigger in the ‘Tyrannid MC Sounds’ prototype is

$Rand5_result$ = 1

The correct expression is

Rand5_result = 1

The first part of a property expression is always evaluated to get the value of te named property. Adding the $ signs on the first part causes it to be ‘pre-evaluated’, so after this step, your expression looks like this (assuming a “1” was rolled)

1 = 1

Now the actual evaluation happens and “1” is looked up as a property value, which of course returned nothing, so the expression fails.

Have a look at the exmaple in the reference manual:

Hitpoints_Level < 2 && Wound_Active != true

No $ signs.

You use the $ signs in two situations

  1. To compare a property to another property, use the $ signs in the second part e.g.

Rand5_result = $Another_property$

  1. To indirection, where one property contains the name of a property to compare

$prop1$ = 2

when Property prop1 contains the name of the property we want to compare to 2.

Regards,
Brent.


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

Post generated using Mail2Forum (mail2forum.com)

Ah, that’s an easy fix then. Thanks very much for the help!