Event activation via script

Take command of air and naval assets from post-WW2 to the near future in tactical and operational scale, complete with historical and hypothetical scenarios and an integrated scenario editor.

Moderator: MOD_Command

Post Reply
HorgeTheFlier
Posts: 4
Joined: Fri Sep 26, 2014 6:25 pm
Location: Italy

Event activation via script

Post by HorgeTheFlier »

Hi everyone, I'm having trouble with an event trigger script.

I would like an action to trigger an event upon the death of a specific unit, how can I do it via LUA?

Thanks in advance.
User avatar
Randomizer
Posts: 1535
Joined: Sat Jun 28, 2008 8:31 pm

RE: Event activation via script

Post by Randomizer »

Why not use the "Unit is Destroyed" trigger function?

-C
HorgeTheFlier
Posts: 4
Joined: Fri Sep 26, 2014 6:25 pm
Location: Italy

RE: Event activation via script

Post by HorgeTheFlier »

ORIGINAL: Randomizer

Why not use the "Unit is Destroyed" trigger function?

-C

yes I used it, but then how do I activate with an action an event that at the beginning of the scenario is deactivated?
User avatar
Randomizer
Posts: 1535
Joined: Sat Jun 28, 2008 8:31 pm

RE: Event activation via script

Post by Randomizer »

I do not understand what you're trying to do. You can use Lua to activate an event but destroying a unit when the scenario loads seems an odd approach without seeing what you are trying to achieve. You might do better posting the scenario in the Lua Legion forum here:Lua Legion

-C
User avatar
Sharana
Posts: 347
Joined: Wed Feb 03, 2016 9:58 pm

RE: Event activation via script

Post by Sharana »

It's possible to kill unit with LUA and to activate/deactivate events, but you should describe exactly what are you trying to do in order to get LUA examples.
Image
HorgeTheFlier
Posts: 4
Joined: Fri Sep 26, 2014 6:25 pm
Location: Italy

RE: Event activation via script

Post by HorgeTheFlier »

Sorry my English, I try to explain myself better.
I would like to know only the command string to make a certain event trigger.
User avatar
Sharana
Posts: 347
Joined: Wed Feb 03, 2016 9:58 pm

RE: Event activation via script

Post by Sharana »

ScenEdit_SetEvent('Event Name',{isactive=true})

This will make specific event active (if it is disabled on loading as you say). Is that what you need?
Image
Post Reply

Return to “Command: Modern Operations series”