Jump to content

Recommended Posts

I have 3 variables for heli's sarheli0, sarheli1 and sarheli2 imported from the mission. how would I put them into the near objects so I can assign an AI to get in the heli in the trigger zone (script is triggered from another script)

this is my code

casGroup = _this select 0;
casPos = _this select 1;
casSpawn = _this select 2;
sarheli = _this select 3;
sarheli1 = _this select 4;
sarheli2 = _this select 5;

_heliTypeSearch = casPos nearObjects [['sarheli0','sarheli1','sarheli2'],40];
_heliType = _heliTypeSearch select 0;
casSpawn assignAsCargo _heliType;
[casSpawn] orderGetIn true;

Cheers.

Share this post


Link to post
Share on other sites
22 minutes ago, felipechapmanfromm said:

this is my code, fix it

WOW dude...you're on a good start with that statement....just wait and see:there's gonna be plenty of peoples willing to help ya, brotha!

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites

I solved it with

casGroup = _this select 0;
casPos = _this select 1;
casSpawn = _this select 2;

_getIn = casGroup addWaypoint [position player, 0];
[casGroup, 1] setWaypointType "GETIN NEAREST";

 

  • Like 2

Share this post


Link to post
Share on other sites

Glad you figured it out! Suggestion(s):

- Use params command

https://community.bistudio.com/wiki/params

- Make those variables local, no need for them to be global.

params ["_casGroup", "_casPos", "_casSpawn"];

_getIn = _casGroup addWaypoint [position player, 0];
[_casGroup, 1] setWaypointType "GETIN NEAREST";

From your last snippet. You don't need to pass _casPos and _casSpawn unless you are going to use them.

  • Like 1

Share this post


Link to post
Share on other sites
9 hours ago, HazJ said:

Glad you figured it out! Suggestion(s):

- Use params command

https://community.bistudio.com/wiki/params

- Make those variables local, no need for them to be global.


params ["_casGroup", "_casPos", "_casSpawn"];

_getIn = _casGroup addWaypoint [position player, 0];
[_casGroup, 1] setWaypointType "GETIN NEAREST";

From your last snippet. You don't need to pass _casPos and _casSpawn unless you are going to use them.

Thanks for the help, _casPos and _casSpawn are used later in the script.

Share this post


Link to post
Share on other sites

when I fly a helicoper to the AI he won't get in, but with a boat it has. I have not tried with a car. (the heli was a hellenic mod one)

what is wrong with the code that makes this happen, or is it the mod

ps. with waypoints in the editor the AI happily get into the heli

Share this post


Link to post
Share on other sites

Out on mobile. Make sure heli is friendly, etc... Try to reveal it as well.

Share this post


Link to post
Share on other sites

how do you mean by reveal

Edit: found it, could I use {casSpawn reveal _x} forEach allUnits; to reveal everyone to the ai?

Edited by felipechapmanfromm

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×