Targetting a location (not a contact)

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
jkgarner
Posts: 175
Joined: Thu Apr 30, 2020 12:42 pm

Targetting a location (not a contact)

Post by jkgarner »

OK,
In the documentation (under Event Handling, I found the following:
TargetType
Aircraft 1
Ship 2
Submarine 3
Facility 4
Aimpoint 5
Weapon 6
Satellite 7
This applies to the target filter, but it got me thinking...

Sometimes an artillery unit (for example, but cold be a ship) will shell a location (lat/lon) or an area and not a specific contact.

Granted this is not as common as it was before expensive smart-weapons, but it is still done possible and it is still done.

I am not seeing how to get units to behave this way in Command, either through the GUI, or scripting Lua. It's possible that I missed something somewhere, or the documentation is not quite complete.

Does anyone have any ideas on how to do this: get a unit to target a location- or aim-point and not a contact. (hint: Lua would be preferred)
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Targetting a location (not a contact)

Post by KnightHawk75 »

Only been able to do with attackcontact, when trying to do lat\lon's I usually just fake with add_exposition and removing munitions from those I pretend-launch'em from.
tiag
Posts: 131
Joined: Thu Jun 21, 2018 8:33 am

RE: Targetting a location (not a contact)

Post by tiag »

You can simulate an attack to coordinates by adding a marker via LUA. In CMO there are 3 of them you can use: Bombing Target, Target and Training Target.
For each unit I want to attack a coordinate, I add one of these markers and make the corresponding unit to attack it. Baseline, I am attacking a "contact" (=marker), but my unit /AI moves it via LUA that marker around according to its logic.

An example of use:
I plan a naval assault to a beach. I know there are enemy units hidden on the terrain but I cant see them. So, my ships generate these markers following some logic and start firing at thes markers.

Hope it helps.
Post Reply

Return to “Lua Legion”