clydefrog 3 Posted April 10, 2013 Hi, I'm scripting waypoints for a vehicle that's spawned but I'm having a problem in both scripts I'm trying where the vehicle stops at the first waypoint and doesn't proceed to the next one. Here's one of the scripts, what do I need to change so it goes to waypoint _wp1? // null = [_spawnPos, _MovePos, _TargetPos] execVM "scripts\ifrit.sqf"; if (!isServer) exitWith {}; _spawnPos = markerPos (_this select 0); _MovePos = markerPos (_this select 1); _TargetPos = markerPos (_this select 2); // create ifrit _sv = [[_spawnPos select 0,_spawnPos select 1,1], random 360, "O_Ifrit_MG_F", EAST] call BIS_fnc_spawnVehicle; // Name the vehicle and group _ifrit = _sv select 0; // vehicle spawned. _ifritgrp = _sv select 2; // group of vehicle so waypoints work. _ifritdriver = (driver _ifrit); // get driver of ifrit _ifritgunner = (gunner _ifrit); // get gunner of ifrit _ifritdriver setSkill 1; // set high skill on driver _ifritgunner setSkill 1; // set high skill on gunner // waypoints _wp0 = _ifritgrp addWaypoint [[_MovePos select 0,_MovePos select 1,1], 10]; _wp0 setWaypointType "MOVE"; _wp0 setWaypointSpeed "LIMITED"; _wp0 setWaypointBehaviour "SAFE"; _wp0 setWaypointFormation "COLUMN"; [_ifritgrp,0] setWaypointStatements ["true", ""]; _wp1 = _ifritgrp addWaypoint [[_TargetPos select 0,_TargetPos select 1,1], 10]; _wp1 setWaypointType "CYCLE"; _wp1 setWaypointSpeed "LIMITED"; _wp1 setWaypointBehaviour "SAFE"; _wp1 setWaypointFormation "COLUMN"; // activate first move for driver incase something stops 1st wp to be executed somehow _ifritdriver doMove (getWPPos _wp0); Share this post Link to post Share on other sites
f2k sel 164 Posted April 10, 2013 I think you still need an actual 2nd waypoint and then a cycle wp // null = [_spawnPos, _MovePos, _TargetPos] execVM "scripts\ifrit.sqf"; if (!isServer) exitWith {}; _spawnPos = markerPos (_this select 0); _MovePos = markerPos (_this select 1); _TargetPos = markerPos (_this select 2); // create ifrit _sv = [[_spawnPos select 0,_spawnPos select 1,1], random 360, "O_Ifrit_MG_F", EAST] call BIS_fnc_spawnVehicle; // Name the vehicle and group _ifrit = _sv select 0; // vehicle spawned. _ifritgrp = _sv select 2; // group of vehicle so waypoints work. _ifritdriver = (driver _ifrit); // get driver of ifrit _ifritgunner = (gunner _ifrit); // get gunner of ifrit _ifritdriver setSkill 1; // set high skill on driver _ifritgunner setSkill 1; // set high skill on gunner // waypoints _wp0 = _ifritgrp addWaypoint [[_MovePos select 0,_MovePos select 1,1], 10]; _wp0 setWaypointType "MOVE"; _wp0 setWaypointSpeed "LIMITED"; _wp0 setWaypointBehaviour "SAFE"; _wp0 setWaypointFormation "COLUMN"; [_ifritgrp,0] setWaypointStatements ["true", ""]; _wp1 = _ifritgrp addWaypoint [[_TargetPos select 0,_TargetPos select 1,1], 10]; _wp1 setWaypointType "move"; _wp1 setWaypointSpeed "LIMITED"; _wp1 setWaypointBehaviour "SAFE"; _wp1 setWaypointFormation "COLUMN"; _wp2 = _ifritgrp addWaypoint [[_TargetPos select 0,_TargetPos select 1,1], 10]; _wp2 setWaypointType "cycle"; // activate first move for driver incase something stops 1st wp to be executed somehow //_ifritdriver doMove (getWPPos _wp0); Share this post Link to post Share on other sites
clydefrog 3 Posted April 10, 2013 Yeah thanks, after trying a few things I realised this and it's fine now. I have another question though. In another version of this script I've decided to make it possible to select behaviour type etc. through the script call, for example: // null = [_spawnPos, _MovePos1, _MovePos2, _MovePos3, _MovePos4, _TargetPos, _speed, _beh, _form, _cbtmode, _class, _side] execVM "scripts\ifrit_custom.sqf"; _SPEED = (_this select 6); _BEH = (_this select 7); _FORM = (_this select 8); _CBTMODE = (_this select 9); _class = (_this select 10); _side = (_this select 11); _wp0 = _ifritgrp addWaypoint [[_MovePos1 select 0,_MovePos1 select 1,1], 10]; _wp0 setWaypointType "MOVE"; _wp0 setWaypointSpeed _SPEED; _wp0 setWaypointBehaviour _BEH; _wp0 setWaypointFormation _FORM; _WP0 setWaypointCombatMode _CBTMODE; _wp0 setWaypointStatements ["true", ""]; How would I go about making setting default values for these things, like set _Speed to default as limited, so if you don't put "limited" in the appropriate part of the script call array it will just default to that anyways? Share this post Link to post Share on other sites
clydefrog 3 Posted April 11, 2013 Problem solved, nevermind. Share this post Link to post Share on other sites