chromium Posted December 7, 2014 Posted December 7, 2014 (edited) Hello, I'm trying to set-up a couple of functions for spawning AI flights, which should provide a basic CAP mission and a basic Bombing mission. I got the CAP one to work as expected, but I can't make the Bombing aircraft to effectively bomb the wanted point. Those are my try for the bombing task: 1: [1] = { ["number"] = 1, ["auto"] = false, ["id"] = "Bombing", ["enabled"] = true, ["params"] = { ["point"] = {x = FlightAreaPos.x, y = FlightAreaPos.z}, ["weaponType"] = 1073741822, ["attackQty"] = 5, ["expend"] = "Auto", ["direction"] = 0, ["groupAttack"] = true, }, -- end of ["params"] }, -- end of [1] 2: [1] = { ["number"] = 1, ["auto"] = false, ["id"] = "Bombing", ["enabled"] = true, ["params"] = { ["direction"] = 0, ["attackQtyLimit"] = true, ["attackQty"] = 1, ["expend"] = "Auto", ["y"] = FlightAreaPos.z, ["directionEnabled"] = false, ["groupAttack"] = false, ["altitude"] = 2000, ["altitudeEnabled"] = false, ["weaponType"] = 1073741822, ["x"] = FlightAreaPos.x, }, -- end of ["params"] }, -- end of [1] neither of those is working... any suggestion? (this is the chunk used for a Mig-27K) Edited December 8, 2014 by chromium Author of DSMC, mod to enable scenario persistency and save updated miz file Stable version & site: https://dsmcfordcs.wordpress.com/ Openbeta: https://github.com/Chromium18/DSMC The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.
chromium Posted December 8, 2014 Author Posted December 8, 2014 (reworked the code content for better readability) Author of DSMC, mod to enable scenario persistency and save updated miz file Stable version & site: https://dsmcfordcs.wordpress.com/ Openbeta: https://github.com/Chromium18/DSMC The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.
SNAFU Posted December 8, 2014 Posted December 8, 2014 For me it is mostly try & error, getting the AI to the things I want with scripting and with the ME functions. In my AFAC script I use the following code: [important to have the Group-Task to be set to CAS} local RunningIn = { id = 'Mission', params = { route = { points = { [1] = { ["alt"] = _strikeralt, ["type"] = "Turning Point", ["action"] = "Fly Over Point", ["alt_type"] = "BARO", ["formation_template"] = "", ["properties"] = { ["vnav"] = 1, ["scale"] = 0, ["angle"] = 0, ["vangle"] = 0, ["steer"] = 2, }, -- end of ["properties"] ["ETA"] = 0, ["y"] = IPTangoz, ["x"] = IPTangox, ["speed"] = _strikerspeed, ["ETA_locked"] = true, ["task"] = { ["id"] = "ComboTask", ["params"] = { ["tasks"] = { [1] = { ["enabled"] = true, ["auto"] = false, ["id"] = "Bombing", ["number"] = 1, ["params"] = { ["direction"] = 0, ["attackQtyLimit"] = false, ["attackQty"] = 1, ["expend"] = "All", ["altitude"] = _pricklealt, ["directionEnabled"] = false, ["groupAttack"] = true, ["y"] = WPMarkerPos.z, ["altitudeEnabled"] = true, ["weaponType"] = 1073741822, ["x"] = WPMarkerPos.x, }, -- end of ["params"] }, -- end of [1] [2] = { ["enabled"] = true, ["auto"] = false, ["id"] = "WrappedAction", ["number"] = 2, ["params"] = { ["action"] = { ["id"] = "Option", ["params"] = { ["variantIndex"] = 1, ["name"] = 5, ["formationIndex"] = 4, ["value"] = 262145, }, -- end of ["params"] }, -- end of ["action"] }, -- end of ["params"] }, -- end of [1] [3] = { ["number"] = 3, ["auto"] = false, ["id"] = "WrappedAction", ["enabled"] = true, ["params"] = { ["action"] = { ["id"] = "Option", ["params"] = { ["value"] = 2, ["name"] = 1, }, -- end of ["params"] }, -- end of ["action"] }, -- end of ["params"] }, -- end of [2] [4] = { ["number"] = 4, ["auto"] = false, ["id"] = "WrappedAction", ["enabled"] = true, ["params"] = { ["action"] = { ["id"] = "Option", ["params"] = { ["value"] = 1, ["name"] = 4, }, -- end of ["params"] }, -- end of ["action"] }, -- end of ["params"] }, -- end of [3] [5] = { ["number"] = 5, ["auto"] = false, ["id"] = "WrappedAction", ["enabled"] = true, ["params"] = { ["action"] = { ["id"] = "Option", ["params"] = { ["value"] = 2, ["name"] = 3, }, -- end of ["params"] }, -- end of ["action"] }, -- end of ["params"] }, -- end of [4] }, -- end of ["tasks"] }, -- end of ["params"] }, -- end of ["task"] ["speed_locked"] = true, }, -- end of [1] }, } } } local activestrikergrpctrl = activestrikergrp:getController() Controller.setTask(activestrikergrpctrl, RunningIn) Looks similar to yours, but without the rest of the task-code and the context it is just guessing. Maybe the example above helps... [sIGPIC][/sIGPIC] Unsere Facebook-Seite
chromium Posted December 8, 2014 Author Posted December 8, 2014 [important to have the Group-Task to be set to CAS} This may be a game changer!!! I'l try asap. thanks!!! Author of DSMC, mod to enable scenario persistency and save updated miz file Stable version & site: https://dsmcfordcs.wordpress.com/ Openbeta: https://github.com/Chromium18/DSMC The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.
chromium Posted December 14, 2014 Author Posted December 14, 2014 That works, thanks! Author of DSMC, mod to enable scenario persistency and save updated miz file Stable version & site: https://dsmcfordcs.wordpress.com/ Openbeta: https://github.com/Chromium18/DSMC The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.
Recommended Posts