Quick question,
When a player is not in the zone, do mobs despawn or stop roaming? I have a time based script that functions based on mob roaming behavior but I notice that if no one is in the zone, the behavior doesn't log (I have the LUA print code to the console).
Mob behavior when no one is in the zone
-
- Posts: 129
- Joined: Wed May 27, 2015 4:23 pm
Re: Mob behavior when no one is in the zone
Zones kinda freeze in time when empty then when a player occupies it again the first tick of the clock will sorta jump things forward to the present. This is normal and intended.
Hi, I run The Demiurge server.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
DO NOT PRIVATE MESSAGE ME ABOUT BUGSPLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
-
- Posts: 129
- Joined: Wed May 27, 2015 4:23 pm
Re: Mob behavior when no one is in the zone
Is there a way to prevent this from occuring in a specific zone? Looking into campaign like battles where fights can continue and have an outcome while no one is in the zone.
Edit: Nevermind figured it out. I added the "&& m_zoneID != 95" part in the code in zone.cpp to not "freeze" the timer in West Sarutabaruta {S}:
My question is if there are any side effects? I have this particular zone running on its own instance.
Edit: Nevermind figured it out. I added the "&& m_zoneID != 95" part in the code in zone.cpp to not "freeze" the timer in West Sarutabaruta {S}:
Code: Select all
void CZone::DecreaseZoneCounter(CCharEntity* PChar)
{
m_zoneEntities->DecreaseZoneCounter(PChar);
if (ZoneTimer && m_zoneEntities->CharListEmpty() && m_zoneID != 95)
{
ZoneTimer->m_type = CTaskMgr::TASK_REMOVE;
ZoneTimer = nullptr;
m_zoneEntities->HealAllMobs();
}
else
{
m_zoneEntities->DespawnPC(PChar);
}
CharZoneOut(PChar);
}
Re: Mob behavior when no one is in the zone
Probably safe if you don't mind the extra processing and resources it uses to stay running 24/7
Hi, I run The Demiurge server.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
DO NOT PRIVATE MESSAGE ME ABOUT BUGSPLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE