Jump to content

"OnPostMapLoad" not firing?


iwishforducks

Recommended Posts

I was working on a mod that made it so building zombies would spawn in as soon as the chunk would spawn in. But I'm having trouble hooking an event to when cells are loaded. It seems like the OnPostMapLoad event isn't firing in the first place, or so I think; The "cell loaded!" print is not firing off. Should I be using another event in this case? I've tried making the script a Server, Client, and Shared, so I think I've covered my bases. (The script cannot be on the client anyhow because the roomSpotted method only works on the server)

 

local function DucksBZSF_CellLoaded(cell,x,y)
	
	print("cell loaded!")
	local rooms = cell:getRoomList() -- Returns an ArrayList
	for index=0, rooms:size()-1, 1 do
		local room = rooms:get(index)
		print("room loaded!")
		VirtualZombieManager:roomSpotted(room)
	end
end

Events.OnPostMapLoad.Add(DucksBZSF_CellLoaded)
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...