Warning: include(/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php): failed to open stream: No such file or directory in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Warning: include(): Failed opening '/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Notice: Undefined index: OFPEC in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152
    Home   Help Login Register  

Author Topic: setwaypointstatements script help?  (Read 3784 times)

0 Members and 1 Guest are viewing this topic.

Offline Kocrachon

  • Members
  • *
setwaypointstatements script help?
« 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];
« Last Edit: 25 Feb 2010, 06:08:16 by Kocrachon »

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: setwaypointstatements script help?
« Reply #1 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!
« Last Edit: 25 Feb 2010, 20:44:55 by laggy »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Kocrachon

  • Members
  • *
Re: setwaypointstatements script help?
« Reply #2 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?