Forcing a Transport to land

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
wishihadaname
Captain
Captain
Posts: 493
Joined: Fri Dec 28, 2007 2:10 pm
Projects :: The Corellian Resistance
Games I'm Playing :: Halo Reach and LOTRO
Location: Look to your left.... no, your other left....

Forcing a Transport to land

Post 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.
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: Forcing a Transport to land

Post by THEWULFMAN »

I think you need to set up FLYER SPLINES to the hint nodes, I'm not sure.
Last edited by THEWULFMAN on Wed Aug 29, 2012 7:49 pm, edited 1 time in total.
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Forcing a Transport to land

Post 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.
User avatar
wishihadaname
Captain
Captain
Posts: 493
Joined: Fri Dec 28, 2007 2:10 pm
Projects :: The Corellian Resistance
Games I'm Playing :: Halo Reach and LOTRO
Location: Look to your left.... no, your other left....

Re: Forcing a Transport to land

Post by wishihadaname »

Tried both of those methods but nothing happend. The flyer just ignores the hintnodes.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Forcing a Transport to land

Post 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...
User avatar
SAMofBIA
Major General
Major General
Posts: 649
Joined: Tue Jun 15, 2010 3:38 pm
Projects :: Nothing....nothing at all.
Games I'm Playing :: League of Legends
xbox live or psn: No gamertag set
Location: MIA and not stopping in often anymore.

Re: Forcing a Transport to land

Post by SAMofBIA »

im pretty sure that every transport that lands in stock is animated in ZE
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Forcing a Transport to land

Post 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
User avatar
wishihadaname
Captain
Captain
Posts: 493
Joined: Fri Dec 28, 2007 2:10 pm
Projects :: The Corellian Resistance
Games I'm Playing :: Halo Reach and LOTRO
Location: Look to your left.... no, your other left....

Re: Forcing a Transport to land

Post 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.
User avatar
Sky_216
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2086
Joined: Mon Feb 13, 2006 3:28 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Forcing a Transport to land

Post 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......
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: Forcing a Transport to land

Post 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.
User avatar
Jendo7
Sith
Sith
Posts: 1304
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Re: Forcing a Transport to land

Post 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:
User avatar
Sky_216
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2086
Joined: Mon Feb 13, 2006 3:28 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Forcing a Transport to land

Post 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?
User avatar
Firefang
Major
Major
Posts: 518
Joined: Mon Nov 15, 2010 8:55 pm
Location: California

Re: Forcing a Transport to land

Post 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.
User avatar
wishihadaname
Captain
Captain
Posts: 493
Joined: Fri Dec 28, 2007 2:10 pm
Projects :: The Corellian Resistance
Games I'm Playing :: Halo Reach and LOTRO
Location: Look to your left.... no, your other left....

Re: Forcing a Transport to land

Post 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.
User avatar
Sky_216
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2086
Joined: Mon Feb 13, 2006 3:28 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Forcing a Transport to land

Post 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......:(
User avatar
Jendo7
Sith
Sith
Posts: 1304
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Re: Forcing a Transport to land

Post 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:
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Forcing a Transport to land

Post by Fiodis »

Might you use OnEnterRegion and GetCharacterVehicle?
User avatar
Sky_216
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2086
Joined: Mon Feb 13, 2006 3:28 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Forcing a Transport to land

Post 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...
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Forcing a Transport to land

Post 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.
Post Reply