Special Action to Create a target anywhere (on land)

Post new mods and scenarios here.

Moderator: MOD_Command

Post Reply
Whicker
Posts: 665
Joined: Tue Jun 19, 2018 9:54 pm

Special Action to Create a target anywhere (on land)

Post by Whicker »

How do you bomb a specific spot where you know there is something, but you have not detected it?

Put a ref point there, highlight it, and then run a special action to convert any highlighted ref point into a target unit.

Works pretty well, other than it takes about a minute of game time to show up - and I wish there were other targets out there that were a little harder to destroy - thus there would be more splatter to hopefully kill the hidden unit.

Attached scen has the special action and a few units to fight against each other, there are 2 hidden artillery units that are having a field day with the ships.

code - just requires a side called 'Targets' set to blind and what not, target dbid differs between CWDB and DB3000, note the comment for that:
local side=ScenEdit_PlayerSide()
local targetSide = 'Targets'
local sideCheck =ScenEdit_GetSideOptions({side=targetSide})
print(sideCheck)
if sideCheck == nil then
ScenEdit_MsgBox ('Target Side does not exist, please create a side named Targets', 1)
return
end
local targetDBID = 1633 --cwdb is 1633 db3000 is 2434
local s = VP_GetSide({side=side})
local noRefPoints = true
local w_targetCounter = ScenEdit_GetKeyValue('w_targetCounter')
if w_targetCounter == '' then w_targetCounter =1
else
counter=tonumber(w_targetCounter)
end

for k,v in ipairs(s.rps) do
if v.highlighted == true then
ScenEdit_AddUnit({side=targetSide,name='Target-'..w_targetCounter,type='Facility',lat=v.latitude, lon=v.longitude,dbid=targetDBID,autodetectable='true'})
ScenEdit_DeleteReferencePoint({side=side,guid=v.guid})
--_SetReferencePoint({side=side,guid=v.guid,newname='target'})
print(v.highlighted)
w_targetCounter=w_targetCounter +1
noRefPoints=false
end --end looping thru ref points
end
if noRefPoints then
ScenEdit_MsgBox ('No Ref Points selected', 1)
end --if norefpoints
Attachments
CreateTar..fPoints.zip
(16.63 KiB) Downloaded 39 times
Rory Noonan
Posts: 2418
Joined: Thu Dec 18, 2014 1:53 am
Location: Brooklyn, NY

RE: Special Action to Create a target anywhere (on land)

Post by Rory Noonan »

Marker (Bombing Target [Bullseye]) -- Generic (Generic), DBID #3166 in the DB3K has 100,000DP which should stand up to a fair beating.
Image
User avatar
Randomizer
Posts: 1535
Joined: Sat Jun 28, 2008 8:31 pm

RE: Special Action to Create a target anywhere (on land)

Post by Randomizer »

@ Whicker, sweet! Am developing a Vietnam scenario where the Player manages ARC LIGHT strikes for a week or so and every day Lua scripts automatically generate target markers and the invisible things to destroy around them. Had not thought of a special action so thanks for posting it.

@ Apache85, you also want to have a target marker that will be destroyed if hit, the old Target Marker had 5-DP as I recall, which allowed for only a single strike. I can think of uses for a fragile marker I suppose that a persistent one might find a use representing something like a jungle road junction where repeated strikes are needed and Lua can generate invisible targets around the marker as needed.

Perhaps all structures, buildings and markers should be universal across the two data bases but have not audited them so see.

-C
Post Reply

Return to “Mods and Scenarios”