Zizzo wrote: ↑Sun Jun 14, 2020 9:04 pm
HousePet wrote:Since you'd have to loop over the race definitions and the subrace definitions to catch them all, and they are all identical anyway, I would consider just putting a Superload wrapper on mod\class\Player\onBirth() and redoing the Escort location assignment with your own revised restrictions after the current code has ran.
Yeah, that's what I do in
Escort Rescheduling, which is playing in basically the same area.
So, having completely forgotten this thread I was messing around yesterday with tweaking escort distribution and I ran into an issue I don't understand. The following logs that birther is non-nil, but when the original onBirth is run it errors out, complaining that birther is nil.
Code: Select all
local base_onBirth = _M.onBirth
-- change the permitted levels for escorts
function _M:onBirth(birther)
if birther == nil then
game.logSeen(self, "onBirth got a nil birther")
else
game.logSeen(self, "onBirth got a non-nil birther")
end
if world.name == "Maj'Eyal" then
world.random_escort_possibilities = { {"tier1.1", 1, 2}, {"tier1.2", 1, 2}, {"daikara", 1, 2}, {"old-forest", 1, 2}, {"dreadfell", 1, 2}, {"reknor", 1, 2}, }
end
return base_onBirth(birther)
end
return _M
Any ideas on what I'm missing? (I assume it would work to simply copy the definition of onBirth over rather than the above, but this seems like the better approach if viable.)