Automatically turn on jetpacks when spawning

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
razac920
2nd Lieutenant
2nd Lieutenant
Posts: 365
Joined: Sun Jan 16, 2011 12:42 am

Automatically turn on jetpacks when spawning

Post by razac920 »

Has anyone been able to successfully do this? The best I could come up with is to give the unit a melee weapon and combo, and in the combo add Posture("Jet") to the IDLE state, and get rid of any transitions out of IDLE. This actually does "work", but the unit cannot use weapons and the game freezes if the unit dies.
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: Automatically turn on jetpacks when spawning

Post by AnthonyBF2 »

I've noticed Darktroopers activate their jetpack if they spawn in the air, and the same for jet troopers, but I'm not sure if you can keep them from deactivating it.
hunpeter12
Command Sergeant Major
Command Sergeant Major
Posts: 260
Joined: Mon Apr 18, 2011 2:53 pm
Projects :: Underground City The Complex [WIP]
Games I'm Playing :: SWBF2

Re: Automatically turn on jetpacks when spawning

Post by hunpeter12 »

I think if you set the fuel decrease rate to 0, they will stay in the air. There's already a map where you fight only in the air using jetpacks.
razac920
2nd Lieutenant
2nd Lieutenant
Posts: 365
Joined: Sun Jan 16, 2011 12:42 am

Re: Automatically turn on jetpacks when spawning

Post by razac920 »

Yeah, I've noticed that too, but that applies to AI only. If you yourself spawn as a dark trooper in the air, you will fall until you manually turn on your jetpack.

And setting the fuel decrease rate to zero will keep you from falling when you run out of fuel (which then never occurs), but won't automatically turn the jetpack on.
hunpeter12
Command Sergeant Major
Command Sergeant Major
Posts: 260
Joined: Mon Apr 18, 2011 2:53 pm
Projects :: Underground City The Complex [WIP]
Games I'm Playing :: SWBF2

Re: Automatically turn on jetpacks when spawning

Post by hunpeter12 »

I meant it for AI too. Is it so important to actually turn the jetpack on automatically, couldn't just the player do it himself? (I don't know what you exactly want to do)
razac920
2nd Lieutenant
2nd Lieutenant
Posts: 365
Joined: Sun Jan 16, 2011 12:42 am

Re: Automatically turn on jetpacks when spawning

Post by razac920 »

Sure, it's possible. It's more of an aesthetic thing than anything else for me: When my player dies, I want him to turn into an intangible ghost at the location of death. But since the ghost is intangible, it will fall through the floor and keep falling until the player activates the jetpack. It'd look much cooler for the ghost to hover over the body.
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Automatically turn on jetpacks when spawning

Post by Noobasaurus »

But the ghost doesn't have any weapons, does it? Your solution mentioned in the first post should work until the player decides to respawn.
razac920
2nd Lieutenant
2nd Lieutenant
Posts: 365
Joined: Sun Jan 16, 2011 12:42 am

Re: Automatically turn on jetpacks when spawning

Post by razac920 »

No, it doesn't have any weapons, and that is what I am planning to do. I just need to make sure there is NO way that this unit can die, since dying = game freezing, which is very bad. So far I've disabled the suicide function in the menu and now am working on code to teleport it away if it ever goes out of bounds. I just was wondering if there is a better way, since in general for other mods it could be nice to have permanently on jetpacks on units with weapons that can die.

EDIT: so it's not strictly dying that causes the game to freeze. If you die by falling through the bottom of the map, then your character just vanishes, no problem. Only if the game has to display a death animation is there any problem.

EDIT2: Another finding: If you deactivate the object just as the unit is killed, the game doesn't freeze (but I don't think you can spawn normally if your previous unit's body was deactivated, so you need LUA to force spawn back in).
nobody3
Rebel Sergeant
Rebel Sergeant
Posts: 188
Joined: Wed Jun 15, 2011 8:30 am

Re: Automatically turn on jetpacks when spawning

Post by nobody3 »

razac920 wrote:The best I could come up with is to give the unit a melee weapon and combo, and in the combo add Posture("Jet") to the IDLE state, and get rid of any transitions out of IDLE. This actually does "work", but the unit cannot use weapons and the game freezes if the unit dies.
Ive got a question, can you give .combo only to melee weapons? And if yes, which one did you use?
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: Automatically turn on jetpacks when spawning

Post by THEWULFMAN »

Only melee weapons can use .COMBO files.
Post Reply