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

