Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Event Question

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> Event Question Page: [1]
Login
Message << Older Topic   Newer Topic >>
Event Question - 7/10/2019 2:41:41 AM   
vettim89


Posts: 3615
Joined: 7/14/2007
From: Toledo, Ohio
Status: offline
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?

_____________________________

"We have met the enemy and they are ours" - Commodore O.H. Perry
Post #: 1
RE: Event Question - 7/10/2019 3:16:43 AM   
Whicker

 

Posts: 664
Joined: 6/20/2018
Status: offline
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.

(in reply to vettim89)
Post #: 2
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> Event Question Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.688