Hi,
I'm new to plugin development and thought I'd try my hand at fixing something I always thought needed fixing.
The plugin I'm developing lets you take over from a bot on your team when you die. So if you're in a survivor team with two bots and you die, you get to take over from one of the bots (rather than waiting to be rescued) This works great.
The problem I'm having is that I'm trying to do the same thing for the special infected - when you die and there are other bot-controlled SI around then I'd like the player to take over from the bots. This actually makes for a better game experience for the SI since the pace is a little faster (without significantly changing the original game experience)
A more detailed summary of the problem is in the attached .sp file, but basically the problem is that when you POSSESS a bot-controlled SI you'll end up with a blend of SI capabilities as you retain some abilities from your FIRST SI spawn.
For example, when the game first starts lets say you spawn as a boomer. You die, and a bot controlled smoker SI is available. You manage to possess that smoker. Now you're a blend of the boomer and smoker classes. You can grab with your tongue and run at the same time. When when you get killed you'll explode, covering the area with vomit. From your point of view you'll LOOK like a smoker, with smoker hands, but you'll SOUND like a boomer - and everyone else see's you as a boomer. (Incidentally it's hilarious seeing a jockey vomit on you, or having spitter charge you, or a boomer jockey you... etc)
Now lets say that after you die there are no bots available.... so you have to wait to respawn. You respawn as a spitter, and die, and manage to possess a jockey. Now you're a blend of BOOMER (not spitter) and jockey... It seems to carry attributes of the FIRST SI you play as.
There are other symptoms, but that's the most apparent.
I've tried a bunch of things (pre-spawning before possessing, timers, V10's InfectedAPI, changing models, m_zombieClass, State_Transition) but they've all failed. I had high hopes for the TakeOverZombieBot method, but crashes the server (I musn't be using it properly)
Anyway, I thought I'd release my code in case someone else can figure out how to fix it. As it stands, it works great for the survivors, and it's buggy for the SI (but at the same time it's a hell of a lot of fun seeing jockeys vomit on people and spitters grab the survivors with their tongue, etc)
If someone does end up fixing this then I'm considering making a second plugin with this class-merging as feature and not a bug!
Oh, and if you can think of any other features that would go well here, I'd be happy to hear them - also any code improvements (ie, don't do X, do Y instead because it's leaner/faster/better), though please remember the code is unfinished, so there's lots of redundant code around the place.
(for the benefit of those that don't know, the .txt file goes in your gamedata directory while the .smx goes in the plugins dir)
Graven
|