Purzel 35 Posted August 5, 2016 Hello there:What´s wrong with this script:(an AI-unit called "pablo" (and his AI-bodyguard) should spawn as cargo in a flying plane, which should land at Bala-airstrip on Tanoa, where "pablo" should get out and walk to a Jeep (jeep1) and get in it.I get the message "crew not defined"...script stops.) Whats wrong here??? Thanks for your help! if (isServer) then { // -------------- Spawn Helicopter and Crews ---------------------------------------------- _heli1crew = [[getMarkerPos "pablospawn" select 0, getMarkerPos "pablospawn" select 1], MarkerDir "pablospawn", "C_Heli_Light_01-civil_F", West] call Bis_fnc_spawnvehicle; // BIS_fnc_spawnCrew ??? _heli1 = _heli1crew select 0 ; _heli1 setPos [getpos _heli1 select 0, getpos _heli1 select 1, 400]; _heli1 allowdamage false; // (vehicle leader _heli1crew) flyInHeight 200; //_heli1crew setbehavior "CARELESS"; sleep 2; pablo assignAsCargo _heli1; bodyguard assignAsCargo _heli1; pablo MoveInCargo _heli1; bodyguard MoveInCargo _heli1; // -------------- Create waypoints for heli1crew ---------------------------------------------- _wp1a = _heli1crew addWaypoint [getMarkerPos "pablospawn", 0]; _wp1a setWaypointType "MOVE"; _wp1a setWaypointStatements ["true", ""]; _wp1a setWaypointBehaviour "SAFE"; //_wp1a setWaypointSpeed "LIMITED"; _wp1a setWaypointCombatMode "WHITE"; sleep 2; _wp2a = _heli1crew addWaypoint [getMarkerPos "pablokommt3", 0]; _wp2a setWaypointType "MOVE"; _wp2a setWaypointStatements ["true", ""]; _wp2a setWaypointBehaviour "SAFE"; //_wp2a setWaypointSpeed "LIMITED"; _wp2a setWaypointCombatMode "WHITE"; sleep 3; _wp3a = _heli1crew addWaypoint [getMarkerPos "pablokommt4", 0]; _wp3a setWaypointType "TR UNLOAD"; _wp3a setWaypointStatements ["true", ""]; _wp3a setWaypointBehaviour "SAFE"; //_wp3a setWaypointSpeed "LIMITED"; _wp3a setWaypointCombatMode "WHITE"; //_heli1crew setbehavior "AWARE"; while {pablo in _heli1} do {sleep 5}; pablo assignAsCargo jeep1; bodyguard assignAsCargo jeep1; [pablo] orderGetIn true; [bodyguard] orderGetIn true; }; Share this post Link to post Share on other sites
patpowercat 7 Posted August 6, 2016 Not 100% sure, but I believe you have the helicopter you're spawning as named _helicrew1. Try this: _helicrew1 = creategroup GUER; //Assuming they're IND faction _heli1 = [[getMarkerPos "pablospawn", MarkerDir "pablospawn", "C_Heli_Light_01-civil_F", _helicrew1] call Bis_fnc_spawnvehicle; _helicrew1 allowdamage false; _heli1 allowdamage false; //Disallow damage to helicopter, not just crew Also, delete the _wpa1 waypoint. They already spawned there, don't need a waypoint to move there. Then continue with your script. Fair warning: I'm pretty drunk, and haven't tested or double checked anything I've done or you have done. Share this post Link to post Share on other sites
Purzel 35 Posted August 6, 2016 Haha, this is one of my favorite answers... (...I'm pretty drunk...) thumbs up!!! Nevertheless... any suggestions..? Greetz Purzel Share this post Link to post Share on other sites
HallyG 239 Posted August 6, 2016 Hello there: What´s wrong with this script: (an AI-unit called "pablo" (and his AI-bodyguard) should spawn as cargo in a flying plane, which should land at Bala-airstrip on Tanoa, where "pablo" should get out and walk to a Jeep (jeep1) and get in it. I get the message "crew not defined"...script stops.) Whats wrong here??? Thanks for your help! if (isServer) then { // -------------- Spawn Helicopter and Crews ---------------------------------------------- _heli1crew = [[getMarkerPos "pablospawn" select 0, getMarkerPos "pablospawn" select 1], MarkerDir "pablospawn", "C_Heli_Light_01-civil_F", West] call Bis_fnc_spawnvehicle; // BIS_fnc_spawnCrew ??? _heli1 = _heli1crew select 0 ; _heli1 setPos [getpos _heli1 select 0, getpos _heli1 select 1, 400]; _heli1 allowdamage false; // (vehicle leader _heli1crew) flyInHeight 200; //_heli1crew setbehavior "CARELESS"; sleep 2; pablo assignAsCargo _heli1; bodyguard assignAsCargo _heli1; pablo MoveInCargo _heli1; bodyguard MoveInCargo _heli1; // -------------- Create waypoints for heli1crew ---------------------------------------------- _wp1a = _heli1crew addWaypoint [getMarkerPos "pablospawn", 0]; _wp1a setWaypointType "MOVE"; _wp1a setWaypointStatements ["true", ""]; _wp1a setWaypointBehaviour "SAFE"; //_wp1a setWaypointSpeed "LIMITED"; _wp1a setWaypointCombatMode "WHITE"; sleep 2; _wp2a = _heli1crew addWaypoint [getMarkerPos "pablokommt3", 0]; _wp2a setWaypointType "MOVE"; _wp2a setWaypointStatements ["true", ""]; _wp2a setWaypointBehaviour "SAFE"; //_wp2a setWaypointSpeed "LIMITED"; _wp2a setWaypointCombatMode "WHITE"; sleep 3; _wp3a = _heli1crew addWaypoint [getMarkerPos "pablokommt4", 0]; _wp3a setWaypointType "TR UNLOAD"; _wp3a setWaypointStatements ["true", ""]; _wp3a setWaypointBehaviour "SAFE"; //_wp3a setWaypointSpeed "LIMITED"; _wp3a setWaypointCombatMode "WHITE"; //_heli1crew setbehavior "AWARE"; while {pablo in _heli1} do {sleep 5}; pablo assignAsCargo jeep1; bodyguard assignAsCargo jeep1; [pablo] orderGetIn true; [bodyguard] orderGetIn true; }; Firstly, addWaypoint should be used with a group, not a vehicle (heli1). Try using the helicopter's group, third element in the returned array from bis_fnc_spawnVehicle: _heli1crew select 2; Share this post Link to post Share on other sites
Purzel 35 Posted August 6, 2016 Thanks for your help...! :D Seems logical...I changed it, but it does not work anyway...I don´t know, whats still wrong... Any suggestions??? Share this post Link to post Share on other sites
Purzel 35 Posted August 9, 2016 Sorry for pushing...but I really need help with this... I tried a lot of stuff, but it does not work... Maybe someone could be my hero...? ;) :P Share this post Link to post Share on other sites
mrcurry 505 Posted August 9, 2016 Could you post the exact error message from the rpt and I'll take a look in a few hours when I get off work. Share this post Link to post Share on other sites
Purzel 35 Posted August 9, 2016 So... here we go: I hope you can find the problem.I´ve tried_plane1 = _aircraftcrew select 1 (0 and 2 too!) -> nothing works... RPT-Error-message:Error in expression <aircraftcrew select 1 ;_plane1 setPos [getpos _plane1 select 0, getpos _plane1 >Error position: <getpos _plane1 select 0, getpos _plane1 >Error getpos: Typ Array, erwartet Objekt,Location << ---- Translated: Type Array, awaiting object,locationFile H:\Documents\Arma 3 - Other Profiles\Purzel\mpmissions\TMP-Schneefall.Tanoa\scripts\pabloscript2.sqf, line 10 Here´s the pabloscript2.sqf: // Pablo kommt per Cessna hint "Pablo Escobar kommt per Flugzeug!"; if (isServer) then { // -------------- Fahrzeuge und Crews spawnen ---------------------------------------------- _aircraftcrew = createGroup resistance; _aircraftcrew = [[getMarkerPos "pablospawn" select 0, getMarkerPos "pablospawn" select 1], MarkerDir "pablospawn", "C_Plane_Civil_01_F", West] call Bis_fnc_spawnvehicle; // BIS_fnc_spawnCrew ??? _plane1 = _aircraftcrew select 1 ; _plane1 setPos [getpos _plane1 select 0, getpos _plane1 select 1, 400]; _plane1 allowdamage false; // (vehicle leader _aircraftcrew) flyInHeight 200; //_aircraftcrew setbehavior "CARELESS"; sleep 1; pablo assignAsCargo _plane1; bodyguard assignAsCargo _plane1; pablo MoveInCargo _plane1; bodyguard MoveInCargo _plane1; // sleep 10; // -------------- OPZ-Funkspruch kommt rein. ------------------------------------------------------ // [] execVM "scripts\funkspruch2.sqf"; // -------------- Wegpunkte für Flugzeug erstellen ------------------------------------------------------ _wp1a = _aircraftcrew addWaypoint [getMarkerPos "pablospawn", 0]; _wp1a setWaypointType "MOVE"; _wp1a setWaypointStatements ["true", ""]; _wp1a setWaypointBehaviour "SAFE"; //_wp1a setWaypointSpeed "LIMITED"; _wp1a setWaypointCombatMode "WHITE"; sleep 2; _wp2a = _aircraftcrew addWaypoint [getMarkerPos "pablokommt3", 0]; _wp2a setWaypointType "MOVE"; _wp2a setWaypointStatements ["true", ""]; _wp2a setWaypointBehaviour "SAFE"; //_wp2a setWaypointSpeed "LIMITED"; _wp2a setWaypointCombatMode "WHITE"; sleep 3; _wp3a = _aircraftcrew addWaypoint [getMarkerPos "pablokommt4", 0]; _wp3a setWaypointType "TR UNLOAD"; _wp3a setWaypointStatements ["true", ""]; _wp3a setWaypointBehaviour "SAFE"; //_wp3a setWaypointSpeed "LIMITED"; _wp3a setWaypointCombatMode "WHITE"; //_aircraftcrew setbehavior "AWARE"; while {pablo in _plane1} do {sleep 5}; pablo assignAsCargo jeep1; bodyguard assignAsCargo jeep1; [pablo] orderGetIn true; [bodyguard] orderGetIn true; }; Share this post Link to post Share on other sites
R3vo 2654 Posted August 9, 2016 _plane1 = _aircraftcrew select 1 ; This has to be select 0; because bis_fnc_spawnVehicle returns and array like this: [vehicle,crew,crew's group] Additionally, the first line should be changed to createGroup resistance; don't declare variables when they are not used. Last but not least, I am not sure if the following line will work that way [[getMarkerPos "pablospawn" select 0, getMarkerPos "pablospawn" select 1] BIS_fnc_spawnVehicle needs a position I believe in [X,Y,Z], not in [X,Y], though the wiki lacks the details on this one. It's a good habit to write systemChat str _someVar; after every line where you define a new variable. That way you can immediately see what's wrong. Share this post Link to post Share on other sites
yacobmate 2 Posted August 10, 2016 _plane1 = _aircraftcrew select 1 ; This has to be select 0; because bis_fnc_spawnVehicle returns and array like this: [vehicle,crew,crew's group] Additionally, the first line should be changed to createGroup resistance; don't declare variables when they are not used. Last but not least, I am not sure if the following line will work that way [[getMarkerPos "pablospawn" select 0, getMarkerPos "pablospawn" select 1] BIS_fnc_spawnVehicle needs a position I believe in [X,Y,Z], not in [X,Y], though the wiki lacks the details on this one. It's a good habit to write systemChat str _someVar; after every line where you define a new variable. That way you can immediately see what's wrong. Thank you for this it's helped me in my own script Share this post Link to post Share on other sites