Jump to content
Sign in to follow this  

Recommended Posts

I'm trying to get a c130 to land at the Balota airstrip on Chernarus. If I place it on the map and use "this landat 2;" in the init line then it does this no problem. I start to get issues when I spawn the c130 with a script and put a pilot in, he just doesn't want to land there. He always goes off at a weird angle.

c130group = creategroup west;
c1301 = createVehicle ["c130j", [(getMarkerPos "c130spawn") select 0,(getMarkerPos "c130spawn") select 1,50], [], 0, "FLY"];
c1301pilot = c130group createUnit ["USMC_soldier_pilot", [0,0,0], [], 0, "CAN_COLLIDE"];
c1301pilot moveInDriver c1301;
c1301 setdir 300;
c1301 flyinheight 50;
c130group setbehaviour "careless";
c1301 allowdamage false;
c1301pilot allowdamage false;
c1301pilot landat 2;

Share this post


Link to post
Share on other sites

Hi,

Try giving the landAt command to the C130, not the pilot.

_neo_

Share this post


Link to post
Share on other sites
Hi,

Try giving the landAt command to the C130, not the pilot.

If I do that then the plane just flies round in circles over Chernogorsk. Given the other things going on in the mission at the time, this is probably the worst tactical decision the pilot could make.

Share this post


Link to post
Share on other sites
If I do that then the plane just flies round in circles over Chernogorsk. Given the other things going on in the mission at the time, this is probably the worst tactical decision the pilot could make.

Yes, was just like a test.

_neo_

Share this post


Link to post
Share on other sites
Hi,

Try giving the landAt command to the C130, not the pilot.

_neo_

c1301 landat 2;

Yes that works here, it circles once then lands.

Share this post


Link to post
Share on other sites

Ok brilliant thanks guys. Next question then, how do I stop him from doing all the pointless circling and just land the thing?

Share this post


Link to post
Share on other sites

I used LandAt in a mission I'm working on. You have to start the landing process at just the right spot. Took me about an hour to figure out where that spot was in Takistan so he'd just land rather than fly around in order to land.

Taxi'ing is even worse, since once he lands he'll turn around and take off again. But during the landing and taxi'ing phases if ANYTHING is ANYWHERE near him he'll veer off into the grass or slow/stop repeatedly.

Share this post


Link to post
Share on other sites
Ok brilliant thanks guys. Next question then, how do I stop him from doing all the pointless circling and just land the thing?

As it shows in the Wiki.

Planes approach all airports from SouthEast

_neo_

Share this post


Link to post
Share on other sites
As it shows in the Wiki.

_neo_

If you look at the script I posted you will see the "setdir 300" which implies a southeasterly approach.

The plane spawns south of Chernogorsk on a direct line with the end of the runway.

Share this post


Link to post
Share on other sites
The plane spawns south of Chernogorsk on a direct line with the end of the runway.

Adjust it's range from the airport. Here's a screenshot of my C-130 landing:

approac.jpg

If I move the C-130 basically even a 100m in any other direction it'll have a hill or something in it's path and will circle around to line up for a landing again. If I move it closer it will think it doesn't have enough time to land and will circle around again. There's gonna be a sweet spot, hopefully, for the airport you want, just gotta find it. Even that one there it does some crazy banking on the approach, but at least heads right in.

Share this post


Link to post
Share on other sites

Ah, in your script do you have a c130 that is on the map to start with? If I place a c130 on the map at the start then tell him to land it works... If I spawn one and tell that to land it messes up.

Share this post


Link to post
Share on other sites

Yeah, preplaced.

Maybe pre-place it, enableSimulation False, perhaps even hideObject, then when you need it enable and show it and have it do it's thing?

Share this post


Link to post
Share on other sites

Maybe that's the way to go, seems a bit too much like I'm trying to find a workaround for a bug but it's all good. Thanks for your help guys.

Share this post


Link to post
Share on other sites

Does anyone know the landAt IDs for OA? I'm trying to get a C-130 to land at the northern airfield so I put a C-130 on the south airfield but no matter what ID I enter it circles the south airfield.

I then made a move WP to the North airfield with this landAt 0; on the Act field but it just circles that WP.

However I'm on board, grouped to the plane and eject over the airfield it lands, taxis stops next to me in the control tower and powers down. If I climb down, it taxis and takes off (??).

I've also tried this land "LAND"; with same result. I'm not using any scripts btw.

Anyone got any ideas to how I can get it to land? I could always place a trigger next to the hangar and setFuel 0, but for now it just circles the airfield for hours...

Share this post


Link to post
Share on other sites

D'oh. I obviously suck at searching, how ever it doesn't seem to matter what number you put in there, it will land (well circle) at the closest one anyways, but thanks.

Also, if I use Get out and landAt <whatever number> it will land, while only get out WP will make it circle it seems. It stops by the control tower instead of hangar but the pilot stays outside, so that's cool.

Share this post


Link to post
Share on other sites

I'm having trouble with landAt aswell. Basically the same problem as TechnoTerrorist303. When placing the plane in the editor and giving it waypoints it works absolutely fine, but when i try to do it by script, it simply keeps circling it's last waypoint without executing the landAt command.

I took Kylania's advice to heart and placed the markers exactly where I placed the waypoints ingame, so I wouldn't lose that "sweet spot"...

createCenter CIVILIAN;
private ["_hiv","_plane","_planegrp"];
_hiv = [[1264,8522,100], 170 , "An2_1_TK_CIV_EP1" , CIVILIAN] call BIS_fnc_spawnVehicle;
_plane = _hiv select 0;
_planegrp = _hiv select 2;
_plane flyInHeight 200;

_plane addEventHandler ["LandedTouchDown","_plane setFuel 0"];

_wp0 = _planegrp addWaypoint [(getMarkerPos "waypointA"), 0];
_wp0 setWaypointType "MOVE";
_wp0 setWaypointSpeed "FULL";
_wp0 setWaypointBehaviour "CARELESS";  
_wp0 setWaypointFormation "LINE";
[_planegrp,0] setWaypointStatements ["true", "_plane landAt 0"];

Is there something wrong with how I set up the WaypointStatements...?

Oh, and the airfield is the one in Zargabad, so I think 0 is the correct ID for it.

Edited by Antigoon

Share this post


Link to post
Share on other sites

I've managed to get the plane to land at the airport by using this

createCenter CIVILIAN;
	private ["_hiv","_plane"];
	_hiv = [[1264,8522,100], 170 , "An2_1_TK_CIV_EP1" , CIVILIAN] call BIS_fnc_spawnVehicle;
	_plane = _hiv select 0;
	_plane flyInHeight 300;
	_plane addEventHandler ["LandedTouchDown","_plane setFuel 0"];

	_plane doMove (getMarkerPos "waypointA");
	_plane landAt 0;

However, I can't seem to get the eventhandler to work and I have no idea why.... The idea is to force the aircraft to stop and after taking someone on board, setFuel to 1 and continue on it's path...

Edited by Antigoon

Share this post


Link to post
Share on other sites

Try this.

_plane addEventHandler ["LandedTouchDown","_this select 0 setFuel 0"];

Share this post


Link to post
Share on other sites
Try this.

_plane addEventHandler ["LandedTouchDown","_this select 0 setFuel 0"];

Yes, that worked! Thx a lot, F2k Sel

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  

×