Jump to content

Customizable random zombie speeds

Recommended Posts

Choose your own % of Runners, Walkers, Shamblers - and Crawlers! You missed those, didn't you. 

By default, you should get ~5% Runners, 60% Walkers, ~33% Shamblers, and ~2% Crawlers.


Only works if you choose "Random" for zombie speeds in Sandbox.


Not sure if this is 100% reliable, but it seems to work so far.


ZombieSpeeds = {}
ZombieSpeeds.counter = 0 -- counter to delay execution, otherwise it doesn't seem to work

ZombieSpeeds.randomizeSpeed = function(zombie)

	ZombieSpeeds.counter = ZombieSpeeds.counter + 1
	if ZombieSpeeds.counter ~= 200 then
	ZombieSpeeds.counter = 0

	local data = zombie:getModData();

	if data.zombieType == nil then -- we didn't set a zombieType yet
		 -- so lets set a zombieType
		local random = ZombRand(101)
		if random > 98 then
			zombie:toggleCrawling(); -- how to set, not toggle?
			data.zombieType = "crawler"
		-- elseif random > 97 then
		-- 	zombie:setForceFakeDead(true); -- not working?
		-- 	data.zombieType = "fakedead"
		elseif random > 95 then
			data.zombieType = "runner"
		elseif random > 60 then
			data.zombieType = "shambler"
			data.zombieType = "walker"

		 -- now do something with the zombieTypes
		 if data.zombieType == "runner" then
		elseif data.zombieType == "walker" then
		elseif data.zombieType == "shambler" then

		zombie:DoZombieStats() -- doesn't seem to work without applying the stats like this



Edited by ZombiesLoveBrainiacs

Share this post

Link to post
Share on other sites

To enable fakedead zombies:


To make sure a zombie isn't a crawler before toggling crawler:
if zombie:getSeppedMod() >= 0.55 then


Note that fakedead and crawlers zombies are persistent, so between moving between to cells, and loading saves, the population of them will accumulate.

I find that I have to redo, and possibly reset the zombie speed when moving between cells. So I do this at then end of the equivalent function I use to do what you do:

if data.SpecialZedType == "Shambler" then
             if ZombRand(999) == 0

        if data.SpecialZedType == "Runner" then
            if ZombRand(999) == 0 then

Edited by Planet Algol
I was stoned when I first posted this and included extraneous code.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...