Lua enable/disable missions.

Post new mods and scenarios here.

Moderator: MOD_Command

Post Reply
User avatar
tjhkkr
Posts: 2430
Joined: Wed Jun 02, 2010 11:15 pm
Contact:

Lua enable/disable missions.

Post by tjhkkr »

I have been looking through the LUA commands...
Is there a way to enable/disable missions through LUA.

I though that there was, but I have been unable to find it.
Remember that the evil which is now in the world will become yet more powerful, and that it is not evil which conquers evil, but only love -- Olga Romanov.
User avatar
kevinkins
Posts: 2465
Joined: Wed Mar 08, 2006 11:54 am

RE: Lua enable/disable missions.

Post by kevinkins »

Hi there ...

You can use the syntax ScenEdit_AssignUnitToMission (unit, mission) Others may have a more direct way but you can move units to and from active and inactive missions via a loop:
e.g.
for i=1,4 do
ScenEdit_AssignUnitToMission('Redcock #'..i, "Activate Carrier Gulf")
end
for i=1,4 do
ScenEdit_AssignUnitToMission('Redcock #'..i, "Inactivate Carrier Gulf")
end

Where those two missions are set-up in the editor - one active and other not. Cumbersome so I hope there is a better method.

Kevin
“The study of history lies at the foundation of all sound military conclusions and practice.”
Alfred Thayer Mahan
User avatar
tjhkkr
Posts: 2430
Joined: Wed Jun 02, 2010 11:15 pm
Contact:

RE: Lua enable/disable missions.

Post by tjhkkr »

Thank you KevinKin...
EXCELLENT idea!
Remember that the evil which is now in the world will become yet more powerful, and that it is not evil which conquers evil, but only love -- Olga Romanov.
Post Reply

Return to “Mods and Scenarios”