Jump to content
Sign in to follow this  
pd3

Grabbing a list of entities from a trigger zone

Recommended Posts

I have an interesting idea for a mission in which you have a set of pre-existing objectives and conditions to be met, however instead of using the ambient warfare module, I would like to use the flashpoint MP dynamic battle framework.

The one issue I'm running into, is that I have a series of triggers which initiate a series of events based on the presence of units by side. The obvious conflict here would be that the flashpoint dynamic battle scripts will continue to generate AI that may prevent these triggers from functioning correctly.

I was wondering to circumvent this problem if there's a way for me to get a snapshot of sorts, a list of all the initial entities in the trigger and then use that list as a condition to execute specific triggers.

I'm thinking in this way it won't matter if the flashpoint scripts generate new AI because the condition for the trigger's execution is dependent upon a specific list.

Share this post


Link to post
Share on other sites

You could try setting up duplicate triggers (with a small offset do you can access them easily).

The first one of each pair would be run only once, activating a script that uses thisList to generate an array of starting units which you can either sort by side, or - possibly better - uses side to generate separate W & E arrays. The other trigger would (I guess, depending on exactly what you want to do) be set to operate repeatedly, activating a script that compares the current thisList array(s) with the starting array(s). Thus if you wanted something to happen after, e.g., 10 of the starting W units had been killed or moved out of the trigger area, you count the units in the current W array that were present at the start, & compare that with the count of W units in the start array.

Another more elegant approach would be to set variables - "Trig1", "Trig2" or whatever - on all units in the appropriate trigger areas at the start, count them by side & make the results constants; then repeatedly run a script that counts the number of units in the trigger's thisList array that have the appropriate variable & compare the results with the starting values.

Remember that Flashpoint may take 30 seconds or more from the start to generate the initial units, so the 'start trigger' script would need a 'sleep 60' or so before generating the array. Also ofc if you want to publish it you'll need thomsonb's permission.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×