Page 1 of 1

Forcing a Transport to land

Posted: Sun Jan 23, 2011 1:56 am
by wishihadaname
Again, sorry for spamming the forums with questions but all i've been doing for the past two days is modding and i've reached yet another impass. Does anyone know how to make transports land? I know it can be done, i've seen it in the Geonosis Spire conversion map and in the campaign. The land hintnode doesn't seem to do anything.

Re: Forcing a Transport to land

Posted: Sun Jan 23, 2011 2:01 am
by THEWULFMAN
I think you need to set up FLYER SPLINES to the hint nodes, I'm not sure.

Re: Forcing a Transport to land

Posted: Sun Jan 23, 2011 10:49 am
by Fiodis
Transports land in stock campaigns as well - take a look at the Kamino campaign script for an example. It uses the line EntityFlyerInitAsLanded. I think that may be how Mav got AI to land in his Space Mon Cal, as well.

Re: Forcing a Transport to land

Posted: Sun Jan 23, 2011 3:19 pm
by wishihadaname
Tried both of those methods but nothing happend. The flyer just ignores the hintnodes.

Re: Forcing a Transport to land

Posted: Sun Jan 23, 2011 3:34 pm
by DarthD.U.C.K.
the hintnodes dont work as far as i know. maybe theres something else that make stme land in campaign..or they are just props animated in ze...

Re: Forcing a Transport to land

Posted: Sun Jan 23, 2011 4:25 pm
by SAMofBIA
im pretty sure that every transport that lands in stock is animated in ZE

Re: Forcing a Transport to land

Posted: Sun Jan 23, 2011 7:59 pm
by Fiodis
I don't see any lines referencing ZE animations in the stock campaign luas where transports land. I'm certain it's related to the lines EntityFlyerTakeOff and EntityFlyerInitAsLanded. I'll try a few tests of them tomorrow, when I no longer need to study for my US History midterm. :P

Re: Forcing a Transport to land

Posted: Sun Jan 23, 2011 10:32 pm
by wishihadaname
I'll save you the trouble, neither of those lines do anything, i've tested it out. If you look at the Deathstar campaign script, it actually looks like the deigners animated the vehicle spawn and then use the EntityFlyerInitAsLanded("trans01") line to make the craft switch from flying to landing mode as it moved along its animation. The animation was broken up into three parts that are set off by regions through which the player runs as he moves to the hanger, the first two regions are for approach, the last one takes exactly as long as the landing wing foldup animation for the troop transport and has it imitate a landing. This won't work for my mod so I think i'll jus replace the transport with a wing of TIE bombers, that should shake things up a bit.

Re: Forcing a Transport to land

Posted: Sun Jan 23, 2011 10:34 pm
by Sky_216
Fiodis wrote:I don't see any lines referencing ZE animations in the stock campaign luas where transports land. I'm certain it's related to the lines EntityFlyerTakeOff and EntityFlyerInitAsLanded. I'll try a few tests of them tomorrow, when I no longer need to study for my US History midterm. :P
Look at the maps in ZE then, they're flyers with a few odf tricks added. Can use them for all kind of tricks, including strafing gunships and moving platforms you can stand on.

Interested in this too for a map with LAATs, got a few ideas but need a way to check if a flyer has an AI or human pilot in 1st position......

Re: Forcing a Transport to land

Posted: Sun Jan 23, 2011 10:41 pm
by THEWULFMAN
tho its doubtfull he would tell you, you could ask mav how he did it, he can do pretty much anything with a lua script, he could turn a duck into a bear that eats your head.

Re: Forcing a Transport to land

Posted: Sun Jan 23, 2011 11:51 pm
by Jendo7
This question has been asked ad infinitum, and when I asked, the answer was a resounding no:

Landing flyers in land maps

... would be good though! :yes:

Re: Forcing a Transport to land

Posted: Mon Jan 24, 2011 12:06 am
by Sky_216
This is talking about through lua rather than splines or hintnodes though.....

idk, is there any lua command/group of commands to check when a flyer enters a region?

Re: Forcing a Transport to land

Posted: Mon Jan 24, 2011 12:12 am
by Firefang
Sky_216 wrote:is there any lua command/group of commands to check when a flyer enters a region?
Yes, there is an example in the BF2 scripting doc.

Re: Forcing a Transport to land

Posted: Mon Jan 24, 2011 12:14 am
by wishihadaname
It would be cool if someone could get this to work. For my part, i've decided to use a bombing run instead, its much easier to make self flying, accurate bombers and then have an AA guns that needs to be distroyed in order for them to reach their destination. Its just as fun of a gameplay mechanic as a gunship that drops flanking reinforcements albeit this requires alot less scripting.

Re: Forcing a Transport to land

Posted: Mon Jan 24, 2011 12:16 am
by Sky_216
Firefang wrote:
Sky_216 wrote:is there any lua command/group of commands to check when a flyer enters a region?
Yes, there is an example in the BF2 scripting doc.
Unless I'm very much mistaken that requires the transport to land first, which is a bit useless in this case......:(

Re: Forcing a Transport to land

Posted: Mon Jan 24, 2011 5:12 am
by Jendo7
Sky_216 wrote:This is talking about through lua rather than splines or hintnodes though.....
I see now. Sorry, I misunderstood, as I only read the first few posts :oops:

Re: Forcing a Transport to land

Posted: Mon Jan 24, 2011 7:50 am
by Fiodis
Might you use OnEnterRegion and GetCharacterVehicle?

Re: Forcing a Transport to land

Posted: Tue Jan 25, 2011 5:55 pm
by Sky_216
So far I've got this......
Hidden/Spoiler:
ActivateRegion("landzone")
land = OnEnterRegion(
function(region, character)
if GetEntityClass(GetCharacterVehicle(character) == "rep_fly_gunship") then
local flyerland = GetEntityName(GetCharacterVehicle(character))
EntityFlyerLand(flyerland)
end
end,
"landzone"
)
Problems are:
Firstly, need to get the actual name of the vehicle to land, not just the class. Don't think that works at the moment 'cos I keep getting an error about it.
Need a way to check if the pilot is an Ai or human, since don't want human pilots to be forced to land...

Re: Forcing a Transport to land

Posted: Tue Jan 25, 2011 6:14 pm
by DarthD.U.C.K.
in the utapau-camapign the flyer is accesed through the vehiclespawn
in the camapign.lyr:

Code: Select all

Object("LAATRider", "com_item_vehicle_spawn", -1085374665)
Object("LAATDrop01", "com_item_vehicle_spawn", 1354376034)
and in the lua:

Code: Select all

function Helpers()
	SetProperty("LAATDrop01", "MaxHealth", 1250)
	SetProperty("LAATDrop01", "CurHealth", 1250)
...
	EntityFlyerTakeOff("LAATDrop01")
	EntityFlyerTakeOff("LAATDrop02")
	EntityFlyerInitAsLanded("LAATAttack")
	EntityFlyerInitAsLanded("LAATRider")	
...
	EntityFlyerTakeOff("LAATDrop01")
	EntityFlyerTakeOff("LAATDrop02")

end
edit: i reckon the reason for this complex setup was that originally the player was supposed to enter a gunship and fly around with it, as seen in the ingamemovie. that would explain the troopermodel in the left ballturret of the gunships flying around.

edit2: im pretty sure that maveritchell animated the transporters in ZE like pandemic did on utapau, they always fly the same path to the enemy hangar.