Change character class but keep stats [Solved]

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
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Change character class but keep stats [Solved]

Post by Noobasaurus »

I'm trying to change a person's class when they enter a region, but keep all of their current stats. Right now, I'm killing them and respawning them so it gives them full health and ammo. It also leaves a dead body. What's the better way to do this?
Hidden/Spoiler:
[code]changer = OnEnterRegion(
function(region, character)
SetProperty(character, "IsVisible", 0)
KillObject(GetCharacterUnit(character))
SelectCharacterClass(character,"cis_inf_sniper")
SpawnCharacter(character, modeldes)
end,
"model"
)[/code]
Last edited by Noobasaurus on Mon Jul 14, 2014 12:21 pm, edited 1 time in total.
razac920
2nd Lieutenant
2nd Lieutenant
Posts: 365
Joined: Sun Jan 16, 2011 12:42 am

Re: Change character class but keep stats

Post by razac920 »

You can teleport them away, before killing so the body doesn't show up, and edit their health to keep the same the same fraction of health as before, like what I do with my Gun Game script. But I don't know how reduce their energy/ammo this way, or how to force someone to change class any other way, such as through a command post (humans might if you tell them but AI won't)
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Change character class but keep stats

Post by Noobasaurus »

Okay, I'll do all of that. Ammo/energy shouldn't really be too much of a problem then. Thanks!
User avatar
commanderawesome
Field Commander
Field Commander
Posts: 971
Joined: Tue Aug 13, 2013 11:58 pm
Projects :: Skin Changer - Warfront - Other stuff
Games I'm Playing :: SWBF SWTOR KotOR EaW
xbox live or psn: AaTc_CmdrAwesome
Location: The Universe

Re: Change character class but keep stats [Solved]

Post by commanderawesome »

Kinda Off-Topic: Working on another new mode, Noobasaurus?
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Change character class but keep stats [Solved]

Post by Noobasaurus »

Uh, yeah, maybe. It's actually a map this time because stock maps didn't want to work the way I wanted them to. Yes, I used ZE for the first time in forever.

If you want to see a preview of it, you can check my post in the videos archive section of the media forum.
Post Reply