trigger that fires after X time

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
orca
Posts: 545
Joined: Wed Nov 06, 2013 4:59 pm

trigger that fires after X time

Post by orca »

Is there a lua code that can fire and be used to trigger an action after a set amount of time?

For example:

I want to launch a fighter strike (mission name- "fighter strike 2") 60 minutes after a different fighter strike is launched (mission- "fighter strike 1"). The goal is to coordinate the strikes so that they both arrive at the target at the same time.

thanks
Whicker
Posts: 664
Joined: Tue Jun 19, 2018 9:54 pm

RE: trigger that fires after X time

Post by Whicker »

why not use the activation time for the missions? is there something that triggers strike 1 that you don't actually know the time of strike 2?

If you look in here for the in-game timer that I posted it has an example of how to make an event with a time trigger that the user sets.
orca
Posts: 545
Joined: Wed Nov 06, 2013 4:59 pm

RE: trigger that fires after X time

Post by orca »

Thanks for the reply. Strike 1 is triggered when a naval group comes within a certain range so the time is not known in advance.

I’ll try to look at your in-game timer. Would the timer be used as an ”condition” in an event to activate strike 2?

ORIGINAL: Whicker

why not use the activation time for the missions? is there something that triggers strike 1 that you don't actually know the time of strike 2?

If you look in here for the in-game timer that I posted it has an example of how to make an event with a time trigger that the user sets.
Whicker
Posts: 664
Joined: Tue Jun 19, 2018 9:54 pm

RE: trigger that fires after X time

Post by Whicker »

the timer would just be an example of how to set up an event with a time trigger of a variable nature. As it is it would not do much for you but is an example of some of what you would need I think.
I can see how to set the time for the second strike in lua, but not sure what would trigger the lua if the strike is just based on distance and if the enemy is detected. I wonder is there is a trigger for a strike launching? or maybe it is the strike 1 ac leaves the area (base)?

Maybe the triggers could be based on unit enters area rather than time/distance? if the ships are already detected this might be easier, then the strike 1 could be unit enters area, strike 2 could be unit stays in area for 60 minutes?

I'm still trying to figure out strike missions, they seem a little complicated.
orca
Posts: 545
Joined: Wed Nov 06, 2013 4:59 pm

RE: trigger that fires after X time

Post by orca »

I currently do something similar. I have strike 1 launch and then strike 2 activates when it flies past the strike 2 base with a unit it enters area trigger. Then both arrive at target at a similar time. I guess this works fine but was wondering if there were a more elegant method.

ORIGINAL: Whicker

the timer would just be an example of how to set up an event with a time trigger of a variable nature. As it is it would not do much for you but is an example of some of what you would need I think.
I can see how to set the time for the second strike in lua, but not sure what would trigger the lua if the strike is just based on distance and if the enemy is detected. I wonder is there is a trigger for a strike launching? or maybe it is the strike 1 ac leaves the area (base)?

Maybe the triggers could be based on unit enters area rather than time/distance? if the ships are already detected this might be easier, then the strike 1 could be unit enters area, strike 2 could be unit stays in area for 60 minutes?

I'm still trying to figure out strike missions, they seem a little complicated.
hasler
Posts: 39
Joined: Mon Jul 31, 2017 8:28 pm

RE: trigger that fires after X time

Post by hasler »

Sort of. You can do a few things. One is set the missions to inactive. Set a trigger with whatever your first mission is. Then in the Lus action set missions to active, set the units assigned to the second mission to a 60 minute ready timer. I believe that is the simplest way to ensure you get the one hour second launch.
Post Reply

Return to “Lua Legion”