OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting Multiplayer => Topic started by: Kocrachon on 25 Feb 2010, 06:05:42

Title: setwaypointstatements script help?
Post by: Kocrachon on 25 Feb 2010, 06:05:42
Hello, I am working on this script and I am having just one simple issue... my helicopter will not land. EVERY other part of the script works except for the setwaypointstatements, no matter what i put in it, nothing seems to work. Wether it is "sidechat" or "land" nothing works.

Also note I am trying to make this script this way because this script is going to serve multiple purposes for future missions, I just need this last little part to work so please don't ask me to overhaul the whole thing. And as I said, the only part not working is the landing part, everything else functions perfectly.

Code: [Select]
_pos = position _smokeg;
_squad = helo1
_helo = bird1

_heli = "HeliHRescue" createVehicle _pos;
_heli setpos _pos;

deleteWaypoint [_squad, _wp1];
deleteWaypoint [_squad, 1];
deleteWaypoint [_squad, 2];
deleteWaypoint [_squad, 3];
deleteWaypoint [_squad, 4];

_wp1 = _squad addWaypoint [_pos, 0];
[_squad, _wp1] setWaypointPosition [_pos, 0];
[_squad, _wp1] setWaypointType "MOVE";
[_squad, _wp1] setWaypointStatements ["true", "_helo land 'LAND'"];
_squad setCurrentWaypoint [_squad, _wp1];
Title: Re: setwaypointstatements script help?
Post by: laggy on 25 Feb 2010, 20:39:23
As far as I know you can't use local variables (_helo) in WP statements. Also, the quotation marks look wrong, you need to double them in a script.

Instead of:
Code: [Select]
[_squad, _wp1] setWaypointStatements ["true", "_helo land 'LAND'"];

Try:
Code: [Select]
[_squad, _wp1] setWaypointStatements ["true", "bird1 land ""LAND"""];

Oh, and make sure you only run the script on the server, or at least only one computer. Otherwise the WPs will be multiplied with the number of computers playing the mission.

Good luck!
Title: Re: setwaypointstatements script help?
Post by: Kocrachon on 25 Feb 2010, 23:00:59
Ok... so new issue then... I was hoping to create a script that creates a helicopter that lands at that pad every time I throw a smoke. So it would be constantly executed. Is there another way to make any helicopter created land at a specific spot to pick up people every time?