RS30002 28 Posted June 5, 2022 Hi...want to spawn a plane with only AA loadout. Unfortunately the plane i want comes with a mixed bag of missiles and it engages a ship which i don't want it to. Here is the code, everything works, except it completely ignores the loadout portion. I know this format should work because i have almost the same script for an insta flight mode for myself. (pylons are named correctly, getting the names from GOM airplane loadout scripts) Any advice pls? Thanks in advance! 🍻 _crew1 = []; _airframe1 = ["J16"]; if (isServer) then { _crew1 = creategroup INDEPENDENT; _airframe1 = [getMarkerPos "PLANairEntry", 500, "VME_PLA_J11", _crew1] call BIS_fnc_spawnVehicle; //_airframe1 = J16; J16 setPylonLoadout ["Pylon1", "PylonRack_PL9_AA_Wingtip"]; J16 setPylonLoadout ["Pylon2", "PylonRack_PL9_AA_Wingtip"]; J16 setPylonLoadout ["Pylon3", "PylonRack_PL9_AA_Single"]; J16 setPylonLoadout ["Pylon4", "PylonRack_PL9_AA_Single"]; //J16 setPylonLoadout ["Pylon5", ""]; //J16 setPylonLoadout ["Pylon6", ""]; //J16 setPylonLoadout ["Pylon7", ""]; //J16 setPylonLoadout ["Pylon8", ""]; J16 setPylonLoadout ["Pylon9", ""]; //J16 setPylonLoadout ["Pylon10", "PylonRack_PL8_AA_Single"]; //J16 setPylonLoadout ["Pylon11", "PylonRack_PL8_AA_Wingtip"]; _wp1 = _crew1 addWaypoint [(getmarkerpos "PLANairWP1"), 0]; _wp1 setWaypointType "MOVE"; _wp1 setWaypointSpeed "LIMITED"; _wp2 = _crew1 addWaypoint [(getmarkerpos "PLANairWP2"), 0]; _wp2 setWaypointType "MOVE"; _wp2 setWaypointSpeed "LIMITED"; _wp3 = _crew1 addWaypoint [(getmarkerpos "PLANairWP3"), 0]; _wp3 setWaypointType "MOVE"; _wp3 setWaypointSpeed "LIMITED"; _wp4 = _crew1 addWaypoint [(getmarkerpos "PLANairWP4"), 0]; _wp4 setWaypointType "CYCLE"; _wp4 setWaypointSpeed "LIMITED"; }; Share this post Link to post Share on other sites
Harzach 2517 Posted June 5, 2022 _crew1 = []; _airframe1 = ["J16"]; if (isServer) then { _crew1 = creategroup INDEPENDENT; _airframe1 = [getMarkerPos "PLANairEntry", 500, "VME_PLA_J11", _crew1] call BIS_fnc_spawnVehicle; //_airframe1 = J16; J16 setPylonLoadout ["Pylon1", "PylonRack_PL9_AA_Wingtip"]; //J16 UNDEFINED The result of this is that J16 is not defined in your setPylonLoadout lines. Cleaner: if (isServer) then { _crew1 = creategroup INDEPENDENT; _airframe1 = [getMarkerPos "PLANairEntry", 500, "VME_PLA_J11", _crew1] call BIS_fnc_spawnVehicle; _airframe1 setPylonLoadout ["Pylon1", "PylonRack_PL9_AA_Wingtip"]; //etc. 1 Share this post Link to post Share on other sites
RS30002 28 Posted June 5, 2022 51 minutes ago, Harzach said: The result of this is that J16 is not defined in your setPylonLoadout lines. Cleaner: if (isServer) then { _crew1 = creategroup INDEPENDENT; _airframe1 = [getMarkerPos "PLANairEntry", 500, "VME_PLA_J11", _crew1] call BIS_fnc_spawnVehicle; _airframe1 setPylonLoadout ["Pylon1", "PylonRack_PL9_AA_Wingtip"]; //etc. It says typed array, expected object for the first line of loadouts 😔 _airframe1 setPylonLoadout ["Pylon1", "PylonRack_PL9_AA_Wingtip"]; Share this post Link to post Share on other sites
Harzach 2517 Posted June 5, 2022 (edited) Ah, sorry. The function returns an array, unlike createVehicle which returns just the vehicle. if (isServer) then { _crew1 = creategroup INDEPENDENT; _airframe1 = [getMarkerPos "PLANairEntry", 500, "VME_PLA_J11", _crew1] call BIS_fnc_spawnVehicle; _vehicle = airframe1 #0; _vehicle setPylonLoadout ["Pylon1", "PylonRack_PL9_AA_Wingtip"]; //etc. Also, it seems like the forums are being particularly "corrupt-y" today - copying clean code is introducing corrupt characters for me. Make sure to check any copied code by pasting it into a code block, deleting any red dots, then recopying the newly clean code. You can then just close that code block without posting. Edited June 6, 2022 by Harzach Whar space, WHAR? 1 Share this post Link to post Share on other sites
RS30002 28 Posted June 6, 2022 8 hours ago, Harzach said: Ah, sorry. The function returns an array, unlike createVehicle which returns just the vehicle. if (isServer) then { _crew1 = creategroup INDEPENDENT; _airframe1 = [getMarkerPos "PLANairEntry", 500, "VME_PLA_J11", _crew1] call BIS_fnc_spawnVehicle; _vehicle = airframe1#0; _vehicle setPylonLoadout ["Pylon1", "PylonRack_PL9_AA_Wingtip"]; //etc. Also, it seems like the forums are being particularly "corrupt-y" today - copying clean code is introducing corrupt characters for me. Make sure to check any copied code by pasting it into a code block, deleting any red dots, then recopying the newly clean code. You can then just close that code block without posting. Sad to say it doesn't work, it just keeps spawning with AG missiles. "" at the end to mark a pylon as empty doesn't appear to be working and on some pylons i can't put anything other than AG missiles/bombs-addon made this way. if (isServer) then { _crew1 = creategroup INDEPENDENT; _airframe1 = [getMarkerPos "PLANairEntry", 500, "VME_PLA_J11", _crew1] call BIS_fnc_spawnVehicle; _vehicle = airframe1#0; _vehicle setPylonLoadout ["Pylon1", "PylonRack_PL9_AA_Wingtip"]; _vehicle setPylonLoadout ["Pylon2", "PylonRack_PL9_AA_Wingtip"]; _vehicle setPylonLoadout ["Pylon3", "PylonRack_PL9_AA_Single"]; _vehicle setPylonLoadout ["Pylon4", "PylonRack_PL9_AA_Single"]; _vehicle setPylonLoadout ["Pylon5", ""]; _vehicle setPylonLoadout ["Pylon6", ""]; _vehicle setPylonLoadout ["Pylon7", ""]; _vehicle setPylonLoadout ["Pylon8", ""]; _vehicle setPylonLoadout ["Pylon9", ""]; //[_vehicle, ["J11_TEX_GREY",1], true] call BIS_fnc_initVehicle; _wp1 = _crew1 addWaypoint [(getmarkerpos "PLANairWP1"), 0]; _wp1 setWaypointType "MOVE"; _wp1 setWaypointSpeed "LIMITED"; _wp2 = _crew1 addWaypoint [(getmarkerpos "PLANairWP2"), 0]; _wp2 setWaypointType "MOVE"; _wp2 setWaypointSpeed "LIMITED"; _wp3 = _crew1 addWaypoint [(getmarkerpos "PLANairWP3"), 0]; _wp3 setWaypointType "MOVE"; _wp3 setWaypointSpeed "LIMITED"; _wp4 = _crew1 addWaypoint [(getmarkerpos "PLANairWP4"), 0]; _wp4 setWaypointType "CYCLE"; _wp4 setWaypointSpeed "LIMITED"; }; Share this post Link to post Share on other sites
pierremgi 4898 Posted June 6, 2022 _vehicle = airframe1#0; ??? Perhaps _airFrame1 #0 BIS_fnc_spawnVehicle has few added value on createVehicle, especially if you spawn on a due place like a marker. 1 1 Share this post Link to post Share on other sites
RS30002 28 Posted June 6, 2022 2 hours ago, pierremgi said: _vehicle = airframe1#0; ??? Perhaps _airFrame1 #0 BIS_fnc_spawnVehicle has few added value on createVehicle, especially if you spawn on a due place like a marker. Nice. It works. Many thanks to both full code: if (isServer) then { _crew1 = creategroup INDEPENDENT; _airframe1 = [getMarkerPos "PLANairEntry", 500, "VME_PLA_J11", _crew1] call BIS_fnc_spawnVehicle; _vehicle = _airframe1 #0; _vehicle setPylonLoadout ["Pylon1", "PylonRack_PL9_AA_Wingtip"]; _vehicle setPylonLoadout ["Pylon2", "PylonRack_PL9_AA_Wingtip"]; _vehicle setPylonLoadout ["Pylon3", "PylonRack_PL9_AA_Single"]; _vehicle setPylonLoadout ["Pylon4", "PylonRack_PL9_AA_Single"]; _vehicle setPylonLoadout ["Pylon5", ""]; _vehicle setPylonLoadout ["Pylon6", ""]; _vehicle setPylonLoadout ["Pylon7", ""]; _vehicle setPylonLoadout ["Pylon8", ""]; _vehicle setPylonLoadout ["Pylon9", ""]; [_vehicle, ["J11_TEX_GREY",1], true] call BIS_fnc_initVehicle; _wp1 = _crew1 addWaypoint [(getmarkerpos "PLANairWP1"), 0]; _wp1 setWaypointType "MOVE"; _wp1 setWaypointSpeed "LIMITED"; _wp2 = _crew1 addWaypoint [(getmarkerpos "PLANairWP2"), 0]; _wp2 setWaypointType "MOVE"; _wp2 setWaypointSpeed "LIMITED"; _wp3 = _crew1 addWaypoint [(getmarkerpos "PLANairWP3"), 0]; _wp3 setWaypointType "MOVE"; _wp3 setWaypointSpeed "LIMITED"; _wp4 = _crew1 addWaypoint [(getmarkerpos "PLANairWP4"), 0]; _wp4 setWaypointType "CYCLE"; _wp4 setWaypointSpeed "LIMITED"; }; Share this post Link to post Share on other sites
RS30002 28 Posted June 6, 2022 AI still going on attack runs towards the ship. 😔 Gonna have to take his bullets away... 😂 Share this post Link to post Share on other sites