walder/Skynet-IADS

FYI - cannot use "CP SKP-11 ATC Mobile Command Post" as Command Center

Closed this issue · 2 comments

i tried to create a mission using skynet and added a "CP SKP-11 ATC Mobile Command Post" to the mission and added the name of that group to the script as being the command Center:

commandCenter = StaticObject.getByName('Command-Center') redIADS:addCommandCenter(commandCenter)

but i didn't get the IADS info messages in the mission and in the log file got an error:

ERROR SCRIPTING: MIST|doScheduledFunctions|1019: Error in scheduled function: $1[string "C:\Users\ladis\AppData\Local\Temp\DCS.openbeta-ME\/~mis000012CF.lua"]:1335: attempt to index a nil value

which then referred to:

function SkynetIADSAbstractElement:isDestroyed()
return self:getDCSRepresentation():isExist() == false
end

changing the vehicle to a static object of the type command center seemed to have fixed the issue
not sure if it is by design, if it is maybe a warning in the docs might be a good idea; i didn't see it mentioned

thanks, will look into it.

I just tested it. When using the CP SKP-11 ATC Mobile Command Post ad a unit you must reference it like this:

commandCenter = Unit.getByName('Command-Center')
redIADS:addCommandCenter(commandCenter)

This is not an issue of Skynet. If you try to fetch a StaticObject that does not exist the script will through an error.