Event Question (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion



Message


vettim89 -> Event Question (7/10/2019 2:41:41 AM)

Not really a Lua question here but this is about the best place I can guess to put this:

I am designing a scenario where a sub has to lay a minefield. I want to have an event trigger when the minefield is complete. I tried setting up a zone and then have an event triggered by "unit enters area" with the type "weapon" selected. Unfortunately the game does not seem to recognize the mines as weapons.

Can any one give me a hint on how to set this up?




Whicker -> RE: Event Question (7/10/2019 3:16:43 AM)

you might be able to dig into the unit wrapper to see if the sub has mines still?

the mines themselves seem to be invisible/uneditable/unreachable via lua.

If you print out the units mounts, if it has mines on it you should be able to drill down and see how many are left. I just did a quick example with a sub I added mines to and this shows how many are left after it has been laying some down:

local u = SE_GetUnit({name='PLA-971 Akula I Improved [Shchuka-B]', guid='9b79c57f-0095-47e3-b2e7-e2aecddece75'})
print(u.mounts[13].mount_weapons[1].wpn_current)

if you just print u.mounts you can then look in the list and see what number the record is for the mine magazine and change the 13 to whatever yours is and see if that works. Then once that is 0 the ship should be done laying mines.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.78125