Page 1 of 1

Change character class but keep stats [Solved]

Posted: Mon Jul 14, 2014 11:56 am
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]

Re: Change character class but keep stats

Posted: Mon Jul 14, 2014 12:17 pm
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)

Re: Change character class but keep stats

Posted: Mon Jul 14, 2014 12:20 pm
by Noobasaurus
Okay, I'll do all of that. Ammo/energy shouldn't really be too much of a problem then. Thanks!

Re: Change character class but keep stats [Solved]

Posted: Mon Jul 14, 2014 3:23 pm
by commanderawesome
Kinda Off-Topic: Working on another new mode, Noobasaurus?

Re: Change character class but keep stats [Solved]

Posted: Mon Jul 14, 2014 10:14 pm
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.