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)