Code: Select all
ScenEdit_SetUnitDamage({side='Good Guys', unitname='F-111F Aardvark', components={{'type',type='sensor',comp_name='AN/AVQ-26 [Laser Designator',2}}})Can anyone please tell me what I'm doing wrong? Thank you in advance!
Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command
Code: Select all
ScenEdit_SetUnitDamage({side='Good Guys', unitname='F-111F Aardvark', components={{'type',type='sensor',comp_name='AN/AVQ-26 [Laser Designator',2}}})Brandon,ScenEdit_SetUnitDamage({side='Good Guys', unitname='F-111F Aardvark', components={{'type',type='sensor',comp_name='AN/AVQ-26 [Laser Designator',2}}})
Post by michaelm75au »
means change the damage level of a 'sensor' on the unit to 1{'type',type='sensor',1}
means change the damage level of the component '16a883a2-8e7f-4313-aae7-0af644c16337' on the unit to 1{'16a883a2-8e7f-4313-aae7-0af644c16337',1}
specific SRBOC showing light damage
Line 38: { [1] = { type = 'Mount', damage = Light, guid = 'ddbe1ca7-c298-45f9-b1f3-ade1d4d1f45c', status = Damaged, name = 'Mk36 SRBOC', dbid = 565 }, [2] = { status = Damaged, damage = Light, name = 'CIC' } }
Set damage for specific SRBOC to medium
Line 60: local a = ScenEdit_SetUnitDamage({name='AOE 421 Sagami', guid='004aa55d-d553-428d-a727-26853737c8f4',components={ {'ddbe1ca7-c298-45f9-b1f3-ade1d4d1f45c','Medium'},{'CIC','Light'} },flood=1})
Results in damage to specific component only
Line 64: { [1] = { comp_status = Operational, comp_dbid = 1175, comp_guid = '04beaf43-9750-41f9-aa20-13f3d23c5cb1', comp_type = 'Sensor', comp_name = 'J/OPS-16C' }, [2] = { comp_status = Operational, comp_dbid = 0, comp_guid = '73121410-96b8-40ad-a555-5c3346ef723e', comp_type = 'Sensor', comp_name = 'Mk1 Eyeball' }, [3] = { comp_status = Operational, comp_dbid = 565, comp_guid = '4e0c45b0-2ebf-4244-8b32-fabedb359a7d', comp_type = 'Mount', comp_name = 'Mk36 SRBOC' }, [4] = { comp_status = Damaged, comp_damage = Medium, comp_dbid = 565, comp_guid = 'ddbe1ca7-c298-45f9-b1f3-ade1d4d1f45c', comp_type = 'Mount', comp_name = 'Mk36 SRBOC' }, [5] = { comp_status = Operational, comp_dbid = 565, comp_guid = 'bca76fa9-a511-41ec-a410-a07014d9d393', comp_type = 'Mount', comp_name = 'Mk36 SRBOC' }, [6] = { comp_status = Operational, comp_dbid = 565, comp_guid = '864d0d3f-a11e-4f5d-a22a-65771d38c5d1', comp_type = 'Mount', comp_name = 'Mk36 SRBOC' }, [7] = { comp_status = Operational, comp_dbid = 72, comp_guid = '248b48...
Line 65: { [1] = { type = 'Mount', damage = Medium, guid = 'ddbe1ca7-c298-45f9-b1f3-ade1d4d1f45c', status = Damaged, name = 'Mk36 SRBOC', dbid = 565 }, [2] = { status = Damaged, damage = Light, name = 'CIC' } }
Code: Select all
ScenEdit_SetUnitDamage({side="NATO", unitname="[L 14] HMS Albion [LPD]", fires=1, components={{"6G4KQB-0HM16BU5RNE4P", 2}}});
ScenEdit_SetUnitDamage({side="NATO", unitname="[L 14] HMS Albion [LPD]", fires=1, components={{"6G4KQB-0HM16BU5RNE4Q", 2}}});
ScenEdit_SetUnitDamage({side="NATO", unitname="[L 14] HMS Albion [LPD]", fires=1, components={{"6G4KQB-0HM16BU5RNE4R", 2}}});
Code: Select all
ScenEdit_SetUnitDamage({side = "NATO", unitname='[L 14] HMS Albion [LPD]', components={ {'6G4KQB-0HM16BU5RNE4P','Medium'}},fires=1})
ScenEdit_SetUnitDamage({side = "NATO", unitname='[L 14] HMS Albion [LPD]', components={ {'6G4KQB-0HM16BU5RNE4Q','Medium'}},fires=1})
ScenEdit_SetUnitDamage({side = "NATO", unitname='[L 14] HMS Albion [LPD]', components={ {'6G4KQB-0HM16BU5RNE4R','Medium'}},fires=1})Post by KnightHawk75 »
Post by KnightHawk75 »
Code: Select all
local unit = SE_GetUnit({side="NATO", name="[L 14] HMS Albion [LPD]"});
for k,v in pairs(unit.components) do
if v.comp_name:find('Pad') ~=nil then --if the name includes the string 'Pad' do the following..
print(v.comp_name .. ': ' .. v.comp_guid) -- dump just the name and the guid to output
-- could just optionally do the damage right now too...
--ScenEdit_SetUnitDamage({unitname=unit.guid, fires=1,components={ {v.comp_guid,'Medium'}}})
end
end
