Raised This Month: $12 Target: $400
 3% 

[L4D2] StayNPlay - Issues with TakeOverBot on Special Infected


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Graven
New Member
Join Date: May 2010
Old 05-02-2010 , 05:54   [L4D2] StayNPlay - Issues with TakeOverBot on Special Infected
Reply With Quote #1

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
Attached Files
File Type: sp Get Plugin or Get Source (l4d2staynplay.sp - 388 views - 21.4 KB)
File Type: txt l4d2staynplay.txt (2.1 KB, 269 views)
Graven is offline
mi123645
Veteran Member
Join Date: Feb 2009
Old 05-03-2010 , 18:59   Re: [L4D2] StayNPlay - Issues with TakeOverBot on Special Infected
Reply With Quote #2

I suggest checking all available infected bots on the field using a for loop, then save the class of the bot, kick the bot and z_spawn the class that the bot previously was.
mi123645 is offline
Graven
New Member
Join Date: May 2010
Old 05-03-2010 , 22:07   Re: [L4D2] StayNPlay - Issues with TakeOverBot on Special Infected
Reply With Quote #3

Hi, thanks for responding.

That would certainly work, but it's not what I'm trying to achieve. I'm trying to get the player to possess an existing special infected character. The reason it won't work is that it won't replicate the scenario the existing SI character was in - for example, if the bot was a hunter and had pounced on a survivor then kicking them and spawning a new hunter would be undesired.

Thanks for thinking about it though.
Graven is offline
dirka_dirka
Veteran Member
Join Date: Nov 2009
Old 05-04-2010 , 01:04   Re: [L4D2] StayNPlay - Issues with TakeOverBot on Special Infected
Reply With Quote #4

i was gonna say - how about moving the person to spec first.. but it seems you already are.

so how about resetting all the propinfo? like you do with the dead state for survivors.
dirka_dirka is offline
Graven
New Member
Join Date: May 2010
Old 05-04-2010 , 01:15   Re: [L4D2] StayNPlay - Issues with TakeOverBot on Special Infected
Reply With Quote #5

I'd love to try that - but I'm not 100% on the whole plugin development thing. Is there a list of propinfo entries that I can query? I've tried searching for 'propinfo list' or 'propinfo infected' but I don't get any relevant matches.

TBH, after discovering m_zombieClass I thought I'd solved it, but that proved to be a dead end... so if it's a property thing it'll be in some other area.

If you could show me how to get the propinfo info I need then I'd appreciate it.
Graven is offline
dirka_dirka
Veteran Member
Join Date: Nov 2009
Old 05-04-2010 , 12:17   Re: [L4D2] StayNPlay - Issues with TakeOverBot on Special Infected
Reply With Quote #6

this? http://wiki.alliedmods.net/Left_4_Dead_Netprops
dirka_dirka is offline
Graven
New Member
Join Date: May 2010
Old 05-04-2010 , 14:40   Re: [L4D2] StayNPlay - Issues with TakeOverBot on Special Infected
Reply With Quote #7

Simply awesome. Thanks! Not sure how I missed that (I'm assuming netprops are the same as propinfo values?)

I'll see what I can find out. Thanks again.
Graven is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:13.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode