BB. Posted April 27, 2018 Share Posted April 27, 2018 (edited) Hello DCS crashes when spawn helicopter with script. Version DCS OpenBeta 2.5.1.16543 Is this Lua written correctly? function HeliSpawn() local ZoneTable = trigger.misc.getZone("TestZone1") local Altitude = land.getHeight( {x = ZoneTable.point.x , y = ZoneTable.point.z} ) Altitude = Altitude + 100 local groupData = { ["modulation"] = 0, ["tasks"] = { }, -- end of ["tasks"] ["task"] = "Transport", ["uncontrolled"] = false, ["route"] = { ["points"] = { [1] = { ["alt"] = Altitude, ["action"] = "Turning Point", ["alt_type"] = "BARO", ["speed"] = 55.555555555556, ["task"] = { ["id"] = "ComboTask", ["params"] = { ["tasks"] = { }, -- end of ["tasks"] }, -- end of ["params"] }, -- end of ["task"] ["type"] = "Turning Point", ["ETA"] = 0, ["ETA_locked"] = true, ["y"] = ZoneTable.point.z, ["x"] = ZoneTable.point.x, ["name"] = "", ["formation_template"] = "", ["speed_locked"] = true, }, -- end of [1] }, -- end of ["points"] }, -- end of ["route"] ["groupId"] = 1, ["hidden"] = false, ["units"] = { [1] = { ["alt"] = Altitude, ["hardpoint_racks"] = true, ["alt_type"] = "BARO", ["livery_id"] = "Army Standard", ["skill"] = "High", ["ropeLength"] = 15, ["speed"] = 55.555555555556, ["AddPropAircraft"] = { ["GunnersAISkill"] = 90, ["ExhaustScreen"] = true, }, -- end of ["AddPropAircraft"] ["type"] = "UH-1H", ["unitId"] = 1, ["psi"] = 0, ["y"] = ZoneTable.point.z, ["x"] = ZoneTable.point.x, ["name"] = "UnitName1", ["payload"] = { ["pylons"] = { }, -- end of ["pylons"] ["fuel"] = "631", ["flare"] = 60, ["chaff"] = 0, ["gun"] = 100, }, -- end of ["payload"] ["heading"] = 0, ["callsign"] = { [1] = 1, [2] = 1, [3] = 1, ["name"] = "Enfield11", }, -- end of ["callsign"] ["onboard_num"] = "050", }, -- end of [1] }, -- end of ["units"] ["y"] = ZoneTable.point.z, ["x"] = ZoneTable.point.x, ["name"] = "GroupName1", ["communication"] = true, ["start_time"] = 0, ["frequency"] = 251, } coalition.addGroup(country.id.USA, Group.Category.AIRPLANE, groupData) end HeliSpawn() UnitSpawn.miz dcs.log-20180427-134354.zip Edited April 27, 2018 by BB. konnichiwa Link to comment Share on other sites More sharing options...
BB. Posted April 28, 2018 Author Share Posted April 28, 2018 (edited) I can spawn without problems if it is an airplane. Please tell me if there are other values needed to spawn the helicopter. Or is it a bug? function PlaneSpawn() local ZoneTable = trigger.misc.getZone("TestZone1") local Altitude = land.getHeight( {x = ZoneTable.point.x , y = ZoneTable.point.z} ) Altitude = Altitude + 100 local groupData = { ["modulation"] = 0, ["tasks"] = { }, -- end of ["tasks"] ["task"] = "Transport", ["uncontrolled"] = false, ["route"] = { ["points"] = { [1] = { ["alt"] = Altitude, ["action"] = "Turning Point", ["alt_type"] = "BARO", ["speed"] = 55.555555555556, ["task"] = { ["id"] = "ComboTask", ["params"] = { ["tasks"] = { }, -- end of ["tasks"] }, -- end of ["params"] }, -- end of ["task"] ["type"] = "Turning Point", ["ETA"] = 0, ["ETA_locked"] = true, ["y"] = ZoneTable.point.z, ["x"] = ZoneTable.point.x, ["name"] = "", ["formation_template"] = "", ["speed_locked"] = true, }, -- end of [1] }, -- end of ["points"] }, -- end of ["route"] ["groupId"] = 1, ["hidden"] = false, ["units"] = { [1] = { ["alt"] = Altitude, ["alt_type"] = "BARO", ["livery_id"] = "USAF 364th FS", ["skill"] = "High", ["speed"] = 138.88888888889, ["type"] = "TF-51D", ["unitId"] = 1, ["psi"] = 0, ["y"] = ZoneTable.point.z, ["x"] = ZoneTable.point.x, ["name"] = "DictKey_UnitName_17", ["payload"] = { ["pylons"] = { }, -- end of ["pylons"] ["fuel"] = 340.68, ["flare"] = 0, ["chaff"] = 0, ["gun"] = 100, }, -- end of ["payload"] ["heading"] = 0, ["callsign"] = { [1] = 1, [2] = 1, [3] = 1, ["name"] = "Enfield11", }, -- end of ["callsign"] ["onboard_num"] = "010", }, -- end of [1] }, -- end of ["units"] ["y"] = ZoneTable.point.z, ["x"] = ZoneTable.point.x, ["name"] = "GroupName1", ["communication"] = true, ["start_time"] = 0, ["frequency"] = 251, } coalition.addGroup(country.id.USA, Group.Category.AIRPLANE, groupData) end PlaneSpawn() UnitSpawn_Plane.miz Edited April 28, 2018 by BB. konnichiwa Link to comment Share on other sites More sharing options...
Recommended Posts