duplicate victory points

Post bug reports and ask for game support here.

Moderator: MOD_Command

Post Reply
Fluellen
Posts: 1
Joined: Mon Sep 30, 2024 12:02 am

duplicate victory points

Post by Fluellen »

I am developing a scenario in which a merchant vessel, MV Boonaroo, must reach one of four possible destinations. The victory/end scenerio results in multiple awards of victory points,

At scenario start, a Lua script randomly selects one destination and stores it as the scenario key `MissionDestination`.

A separate event checks whether the merchant has reached the selected destination. When it is within 5 nautical miles, the event should award Pirene Force 40 victory points and end the scenario.

The delivery event has unexpectedly awarded the 40 points more than once. In testing, the score log has recorded two or three separate 40-point awards, despite the intended one-time delivery award.

## Current delivery event configuration

**Event:** Exercise conclusion - Pirene Force successful (Random Destination)

**Trigger:** Check Merchant Destination - Every Minute (Regular Time trigger).

**Condition:** Lua script checks:
- `PireneDeliveryAwarded` is not already `"Yes"`;
- `MissionDestination` matches the selected destination;
- MV Boonaroo is within 5 nm of that destination.

When the conditions are satisfied, the script sets `PireneDeliveryAwarded` to `"Yes"` and returns `true`.

**Actions in the current test copy:**
1. Mark Pirene Delivery Complete (Lua): `ScenEdit_SetKeyValue("PireneDeliveryAwarded", "Yes")`
2. Pirene Delivery Congratulations (Lua): displays a message to Pirene Force.
3. End the scenario.

Importantly, the standard 40-point scoring action has been removed from this event in the current test copy.

## Tests performed

1. The original delivery event, with the 40-point action included, awarded 40 points multiple times.
2. A marker guard was added to prevent the event from awarding points again after delivery. The marker was confirmed as `"Yes"` after the first successful delivery, but duplicate awards still occurred.
3. The marker was moved into the condition itself, so it was set immediately when the delivery condition became true. Duplicate awards still occurred.
4. The standard 40-point action was removed from the delivery event, the scenario copy was saved and reloaded, and a fresh test was conducted. The score log nevertheless recorded two 40-point awards attributed to `Pirene Force Victory points`, associated with the delivery event.
5. The congratulations message was removed in a further test. This made no difference.
6. Other scoring events have been tested and appear to work as configured.

## Other scenario scoring

The scenario contains other scoring events, including:
- Freighter damaged: +30 to Pirene Force.
- Patrol boat sunk: −12.
- Escort damaged: −15.
- Escort destroyed: −30.
- Destroyer damaged: −20.
- Destroyer destroyed: −50 to Pirene Force.
- Danaus Force victory conditions: +50 to Danaus Force.

These other events have behaved as expected in testing. No other event has an obvious +40-point award for Pirene Force.

## Questions

1. Is there a known issue with repeatable Regular Time triggers or Lua event conditions causing an event action to execute more than once?
2. Can an action remain associated with an event after it has been removed from the event's visible Actions list?
3. Is there a known issue involving shared or duplicated event-action definitions?
4. Could the event engine retain a stale action reference after an event has been edited, saved and reloaded?
5. Are there any diagnostic tools or recommended procedures for identifying which event or action is actually changing a side's score?


I am not assuming this is necessarily an engine bug. I would appreciate advice on whether there is a scenario configuration issue I have overlooked, or whether this behaviour warrants investigation by the developers.
Post Reply

Return to “Tech Support”