Jump to content

KnockdownMod (a question)


OldWorld

Recommended Posts

Hey guys, I'm looking to modify the pistol damage as I'm trying to 'bypass' the effect of zombies playing dead after shot. I downloaded an item spawner mod as I wanted to fool around with sprinting zombies in Sandbox, to find that after zombies are shot, they always play dead, no exceptions. I had 20 sprinters.. sprint towards me, I shot them, for them all to lie dormant on the floor until I approached them.

I think it should be a random chance of them playing dead as opposed to always doing it, so I'm looking to raise pistol damage slightly to negate this effect.

Thanks in advance.

Okay so I found this: http://www.pzwiki.net/wiki/Pistol

Where is the code stored?

Found it.

Link to comment
Share on other sites

So I'm trying to stop zombies from playing dead when knocked down by a pistol, and I think I may have found something interesting. In scripts>items, there's a line that says: KnockdownMod = 2,

 

I haven't a clue about modding, but I'm guessing maybe this affects how often the zombies are knocked down? I've tried changing 2 to 1 or 0, but nothing changed.

 

Any ideas guys?

Link to comment
Share on other sites

Merged and moved to Mod Help section.

 

 

I haven't a clue about modding, but I'm guessing maybe this affects how often the zombies are knocked down? I've tried changing 2 to 1 or 0, but nothing changed.

 

Any ideas guys?

 

Yep, I have an idea: Do like all the others and read some tutorials, look at the source code, do a trial and error run or short: learn to mod.

Link to comment
Share on other sites

It seems that them playing dead is actually a different 'phase' in itself. You could set the damage of a weapon to 10,000, and they'd still be alive whilst knocked down.

 

Edit: What do you think I've been doing? Maybe you have some ideas, though? Help would be greatly appreciated.

Link to comment
Share on other sites

This is beyond me. I'm reading through it but I wouldn't know where to start. There's this 'asleep' Boolean, but I don't know if that's even relevant. I don't remember much from college, but isn't a Boolean either a yes/no thing? Only 2 choices?

Link to comment
Share on other sites

I.. honestly don't know what to say. I wish that meant something to me. I appreciate it though.

 

I don't suppose you would mind trying it out and seeing if it worked? That would be absolutely fantastic. Either that, or would you be happy to walk me through it?

Link to comment
Share on other sites

Here is the radius KillAllZombies code I'm using for various Xmod items:

XWeapons.KillAllZombies = function(target,radius)	local square = target:getSquare();	local squareAround = luautils.getNextTiles(getWorld():getCell(), square, radius);		for u,j in pairs(squareAround) do			for k,l in pairs(j:getLuaMovingObjectList()) do				if luautils.stringStarts(l:toString(), "zombie.characters.IsoZombie") then					l:setFakeDead(false);					l:setForceFakeDead(false);					l:setOnFloor(true);					l:Kill(getPlayer());					l:PlayAnim("ZombieStaggerBack");					l:Hit(null,getPlayer(),0,true,0);				end			end		endend

This was a really tough nut to crack, actually.  I first riffed off the nascent landmine code that is still in the Lua files somewhere.  You'd think "kill" would ... kill, but if it is a standing zombie that hasn't been set to the stagger state yet, it will get back up.

 

So the trick was to make the logic think it was an "onfloor" zombie, then knock it down (anim).  The hit call is required to make the zombie cough up inventory.  

Link to comment
Share on other sites

There's me thinking you had something worth contributing.

 

Well all the information is there ... and as all the others have said - go and read up about modding if you want to mod ... or pay me some money and I will do it :P

 

You probably could also use the OnZombieUpdate event to check if a zombie is a crawler and instakill him...

Link to comment
Share on other sites

I don't aspire to learn modding, I just thought someone wouldn't mind spending 5 minutes showing me how to modify a certain file. But if it's too much to ask, don't worry about it. I'll wait patiently until it's fixed.

 

I present you:

http://theindiestone.com/forums/index.php/topic/393-please-read-before-posting/

 

Show some effort

While we are glad to help any way we can, don't expect us to write your mods for you.

 

;)

Link to comment
Share on other sites

You download Xmod
You install it in PZ
You find and replace the function XWeapons.KillAllZombies
You test this to see if this is the result you want, likely by acquiring one of these 'Xmod items'
You then read one of RoboMat's tutorials on modding
You search this forum for Lua hooks and events
You read the Lua manual


You do your own due diligence.

Link to comment
Share on other sites

Thanks Enigma, never heard of Xmod before, where can I download it? I tried the forums, didn't find anything. Tried Google but all I found was Mac-related things.

Looks like you can't: http://theindiestone.com/forums/index.php/topic/912-wip-xmod/

I guess you'll just have to skip to  the "You then read one of RoboMat's tutorials on modding" step and proceed from there.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...