Jump to content
Sign in to follow this  
williampett

Getting a unit into cargo space

Recommended Posts

Hi, I am trying to make a search and rescue mission. The idea is, is that you fly out to find the casualty, get them into the heli, and then fly back home.

I have tried a few scripts to do this, linked to a trigger, however they aren't working.

The first script I tried was:

_sar = sarunit1; 
_heli = heli1;

_sar assignAsCargo _heli;
[_sar] orderGetIn true; 

This did not work, the guy doesnt move at all.

Another way that I tried to do it was

_heli = heli1;
_sarwp = sargroup1 addWaypoint [_heli, 0, 1];
[sargroup1, 2] setWaypointType "GETIN";

This did not work, the casualty unit moves towards the helicopter, but does not get in.

Please can someone tell me what I am doing wrong and/or how I can get this to work?

Share this post


Link to post
Share on other sites

Is sarunit1 in your player group? Your code as written at the top works perfectly if the unit is NOT in your group. If it IS in your group just tell the guy to get in the heli.

Share this post


Link to post
Share on other sites

No, sarunit1 is not in my player group, I think my problem is something to do with the heli...

_heli = heli1;

heli1 is the name of a unit I have already placed on the map. So I think it needs speech marks on it for example:

_heli = "heli1";

I tried doing this, but it creates an error with the script, stopping it from working.

Share this post


Link to post
Share on other sites

Nope, "heli1" would just be the word "heli1", not the object.

What vehicle is heli1? Does it have free cargo positions?

Share this post


Link to post
Share on other sites

That's bizarre, even with the bird specifically Locked that code still makes an AI get into an empty Mi-17.

Share this post


Link to post
Share on other sites

Thanks for that, I shall try incorporating this into my mission to see if it works :)

---------- Post added at 23:17 ---------- Previous post was at 23:14 ----------

Ye, i think it may be related to another sqf where i created the sarunit1, do i have to use the allowGetin command? or is that different?

Share this post


Link to post
Share on other sites

Plop down a radio trigger and do:

player setPos getPos sarunit1

Then run that trigger and see if you land on the guy. If not your name isn't getting assigned correctly when you spawn it. :)

Share this post


Link to post
Share on other sites

I tried the radio trigger, and i didnt land on the guy, how do I get the name to be assigned correctly?

Share this post


Link to post
Share on other sites

Could you post the script wy which you create that unit?

By the way, this:

_heli = heli1;

is not wrong but seems useless here. Since your chopper is named, you have only one chopper and that variable is not gonna be modified, you could stick with heli1.

Share this post


Link to post
Share on other sites

Try changing the "GETIN" to "GETIN NEAREST"

Edited by Kempco

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
Sign in to follow this  

×