Jump to content
Sign in to follow this  
evans d [16aa]

Forced landing script help

Recommended Posts

ok, I've got a script and I think I've butchered it to suit my needs. This is following on form my other post that just kinda... died.

I'm hoping that this will allow me to make my helo land even if it's underfire.

_HeliPilotGroup = createGroup WEST;
_HeliPilot = driver extractionHelo;
[_HeliPilot] join _HeliPilotGroup;
_HeliPilotGroup setCombatMode "blue";
_HeliPilotGroup setSpeedMode "full";
_HeliPilotGroup setBehaviour "careless";
_HeliPilot allowDamage FALSE;
extractionHelo allowDamage FALSE;


_lz = getpos player;
_lzSpot = "HeliHEmpty" createvehicle _lz;

waituntil {((extractionHelo distance _lz) < 200)};
sleep 3;
extractionHelo land "land";
waituntil {((getpos extractionHelo select 2) < 2)};
doStop _HeliPilot;

waituntil {(player in extractionHelo)};
_deleteVehicle _lzSpot;
_HeliPilot doMove extraction;

waituntil {((extractionHelo distance extraction) < 200)};
_lzSpot = "HeliHEmpty" createvehicle extraction;
"SmokeShellGreen" createVehicle extraction;
sleep 3;
extractionHelo land "land";
waituntil {(getpos extractionHelo select 2) < 2)};
doStop _HeliPilot;
sleep random 2;

Ok, where is this going wrong? Because I'm sure it is.

And I'll finish up with a nooby question, how do I initilize it? I've put execvm "forcedlanding.sqf"; in my penultimate waypoint and it's saying something along the lines of type script, expected nothing. I'd quite like it if it requires the player to pop a green smoke for the helo to land on. And if you can help me make it so that helo has to see the smoke that'd be great.

Share this post


Link to post
Share on other sites

Without having looked at the script, instead of:

execvm "forcedlanding.sqf";

try

[] execvm "forcedlanding.sqf";

or if from a trigger/waypoint within the game, you also need to assign it a handle, like:

xxx = [] execvm "forcedlanding.sqf";

The type script, expected nothing error is typical from not having a handle when called from within the editor.

Edited by CarlGustaffa

Share this post


Link to post
Share on other sites

I did get it to work, I think it's how it should be.

I'm not quite sure how your moving the helo at the start.

If your using a waypoint I had to remove [_HeliPilot] join _HeliPilotGroup; or it never moves.

I'm not really sure why you need all the group stuff at the start as you can do all that by just using the chopper name. Actually it made so that if it got hit it wouldn't land for some reason.

I had to change _lz to getpos player and move spawning of the pad beyond the first wait or you end up running back and fourth. Because when the landing pad is created may not be where the player is when the helo arrives.

deleteVehicle _lzSpot; had an underscore at the start of the line

I had to use a few getpos commands and I changed the distance to at least 600 to give the smoke a bit of time to started.

I also remeove a couple of () from the waituntils.

// nul=[] execvm "forceland.sqf"

//_HeliPilotGroup = createGroup WEST;
//_HeliPilot = driver extractionHelo;
//[_HeliPilot] join _HeliPilotGroup;
extractionHelo setCombatMode "blue";
extractionHelo setSpeedMode "full";
extractionHelo setBehaviour "careless";
//_HeliPilot allowDamage FALSE;
extractionHelo allowDamage FALSE;


waituntil {((extractionHelo distance getpos player) < 200)};
_lzSpot = "HeliHEmpty" createvehicle  getpos player;
sleep 3;
extractionHelo land "land";

waituntil {(getpos extractionHelo select 2) < 2};
doStop extractionHelo;

waituntil {(player in extractionHelo)};
deleteVehicle _lzSpot;
extractionHelo doMove getpos extraction;

waituntil {((extractionHelo distance extraction) <600)};
_lzSpot = "HeliHEmpty" createvehicle getpos extraction;
"SmokeShellGreen" createVehicle getpos extraction;
sleep 3;
extractionHelo land "land";

waituntil {(getpos extractionHelo select 2) <2};
doStop extractionHelo;
sleep random 2;

Edited by F2k Sel

Share this post


Link to post
Share on other sites
I'm not really sure why you need all the group stuff at the start as you can do all that by just using the chopper name. Actually it made so that if it got hit it wouldn't land for some reason.

Going by some of the parameter names I think he may be adapting one of my landing scripts - in which case the purpose is to separate the pilot from the gunnery crew so the pilot can remain careless/mode-green (so will fly and land regardless of fire) and the gunners still get to fire on targets of opportunity, so defending the helicopter.

It's the method I use when creating a vehicle with the BIS functions.

Share this post


Link to post
Share on other sites

Yeah, it is, sorry. Now I think about it I should've given credit. I'm going to try it out later today, but at the moment I'm a little pre-ocupied.

Thanks!

Share this post


Link to post
Share on other sites

Oh I'm not bothered about credit, I'm gratified enough seeing it used.

I assume you're using an object created in the editor? Is there a reason (ie, to allow it to die and become unavailable) you're not using the spawnVehicle function?

Share this post


Link to post
Share on other sites

Right, haven't been able to try it this weekend due to other commitments, but tomorow is a definate. I intend to utilize it.

And Wokstation, I'm using an object in the editor because that's what I orignialy started with. The extraction chopper was to wait at the base for 3 minutes after the call for extraction was sent then it flies to an invisible helipad in Porto Hazena and lands, waiting for the player and their squad to board, at which point it takes off again and RTBs.

I'm trying to find a script because when the chopper reaches the waypoint that tells it to land OPFOR small arms fire keeps it hovering.

What I should have probaly asked for was a script or some code that allows the chopper to ignore OPFOR fire and land. Is there some way I can set the drivers and gunners states in the initialzation box for the unit so it lands?

Thanks.

Share this post


Link to post
Share on other sites

I just went back to look at this script and it's got me baffled.

I have a waypoint placed over the chopper set to careless.

I call the chopper in using

extractionHelo  domove getpos player;nul=[] execvm "forceland.sqf"

I slightly changed the script.

// nul=[] execvm "forceland.sqf"


extractionHelo allowDamage FALSE;

{_x allowdamage false} foreach crew  extractionHelo ;


waituntil {((extractionHelo distance getpos player) < 200)};
_lzSpot = "HeliHEmpty" createvehicle  getpos player;
sleep 3;
extractionHelo land "land";

waituntil {(getpos extractionHelo select 2) < 2};
doStop extractionHelo;

waituntil {(player in extractionHelo)};
deleteVehicle _lzSpot;
extractionHelo doMove getpos extraction;

waituntil {((extractionHelo distance extraction) <600)};
_lzSpot = "HeliHEmpty" createvehicle getpos extraction;
"SmokeShellGreen" createVehicle getpos extraction;
sleep 3;
extractionHelo land "land";

waituntil {(getpos extractionHelo select 2) <2};
doStop extractionHelo;

What happens if the chopper moves in and lands at the correct place what is surprising is that it's returning fire on both units and tanks.

I thought careless stopped that?

Share this post


Link to post
Share on other sites

Hmm... the scripts didn't seem to work for some reason. I'm now experimenting with just putting some code in the initialization box.

So far I have

this flyInHeight 35; this allowDamage FALSE; driver extractionhelo CARELESS;

And when the helo gets to the land waypoint I'm putting some code in that won't let it go until the players squad is inside.

Can anyone think of a decent way to do this other than

player IN extractionhelo; squadMem1 IN extractionhelo...

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  

×