Arrays, Points, and Repeatable Events

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
Bashkire
Posts: 81
Joined: Mon Feb 23, 2015 6:28 pm

Arrays, Points, and Repeatable Events

Post by Bashkire »

Hello all!

I come to you with a question about events and how best to assign points.

I'm working on a mission that requires the player to evacuate troops and civilians from the mainland to a ship via shipborne aircraft.

My basic sequence of events would be:
1) The players is told to evacuate friendlies from site A.
2) The player launches a helo from their ship and sends it to the LZ.
3) The helo arrives, stays in the area for a couple of minutes, then starts to return to the ship.
4) When the helo arrives and lands onboard the player is assigned points for a successful mission.
5) Crucially, the event resets to be ready for the player's next order to evacuate a unit.

The way I'm trying to do it at the moment is with an area around the host ship that gives points when the helo returns. The problem is that the helo constantly earns points while landed on deck which rather negates the idea of letting it take off at all.

I have an idea of how I might solve this, but no idea how I can achieve it.
I am also very open to new ideas if anyone can think of something different.

Idea:
1) The helo takes off and enters a zone designated "Airborne Zone" and is entered into an array.
2) The helo gets to the LZ, loiters and starts to return.
3) On the return leg the helo re-enters "Airborne Zone" and is checked against the array. If it's in the array, points are assigned and it's removed from the array. If it's not, they aren't.
4) The event resets.

Does anyone have any other suggestions or some help on how I might achieve it?

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Edit 1 (10 2115Z MAR 26):
In the Discord chat I have been recommended to try the "Unit Cargo Moved" trigger. I'm going to give that a go now.
- As of this date, the Unit Cargo Moved trigger is Beta only. I'm on stable build, so this issue will need to wait until the beta become current.
- Thank you for your help, Kushan and Lake-End!
Post Reply

Return to “Lua Legion”