Page 1 of 1
Automatically turn on jetpacks when spawning
Posted: Sun Apr 26, 2015 3:06 am
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.
Re: Automatically turn on jetpacks when spawning
Posted: Sun Apr 26, 2015 7:37 am
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.
Re: Automatically turn on jetpacks when spawning
Posted: Sun Apr 26, 2015 10:41 am
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.
Re: Automatically turn on jetpacks when spawning
Posted: Sun Apr 26, 2015 12:55 pm
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.
Re: Automatically turn on jetpacks when spawning
Posted: Sun Apr 26, 2015 3:38 pm
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)
Re: Automatically turn on jetpacks when spawning
Posted: Sun Apr 26, 2015 3:53 pm
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.
Re: Automatically turn on jetpacks when spawning
Posted: Sun Apr 26, 2015 4:46 pm
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.
Re: Automatically turn on jetpacks when spawning
Posted: Sun Apr 26, 2015 4:52 pm
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).
Re: Automatically turn on jetpacks when spawning
Posted: Wed Apr 29, 2015 6:13 am
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?
Re: Automatically turn on jetpacks when spawning
Posted: Wed Apr 29, 2015 10:07 am
by THEWULFMAN
Only melee weapons can use .COMBO files.