• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Question Respawn

Fortera Global

Intermediate OT User
Joined
Nov 20, 2015
Messages
1,180
Solutions
2
Reaction score
117
How to increase respawn time? Is there a way to change by server configuration or via rme only?

tfs 1.2
 
Solution
You have rateSpawn in your config.lua.. From looking at the spawn.cpp I found out that rateSpawn seems to be increasing the amount of monsters spawned..
Therefore you can't change it in config.lua (at this moment).
You have two options:
  1. Change the source and add spawn time modifier for your config
  2. Change the monster spawn times in RME or by opening world-spawn.xml in texteditor and using replace to quickly edit the spawn times

If you want a quick solution for the source:
  1. Go to configmanager.cpp and find integer[RATE_SPAWN] = getGlobalNumber(L, "rateSpawn", 1);
  2. Under that add new line with integer[RATE_SPAWNTIME] = getGlobalNumber(L, "rateSpawnTime", 1);
  3. Go to configmanager.h and find enum integer_config_t...
You have rateSpawn in your config.lua.. From looking at the spawn.cpp I found out that rateSpawn seems to be increasing the amount of monsters spawned..
Therefore you can't change it in config.lua (at this moment).
You have two options:
  1. Change the source and add spawn time modifier for your config
  2. Change the monster spawn times in RME or by opening world-spawn.xml in texteditor and using replace to quickly edit the spawn times

If you want a quick solution for the source:
  1. Go to configmanager.cpp and find integer[RATE_SPAWN] = getGlobalNumber(L, "rateSpawn", 1);
  2. Under that add new line with integer[RATE_SPAWNTIME] = getGlobalNumber(L, "rateSpawnTime", 1);
  3. Go to configmanager.h and find enum integer_config_t { under that find RATE_SPAWN,
  4. Under that add new line with RATE_SPAWNTIME,
  5. Now go to spawn.cpp and find line if (OTSYS_TIME() >= sb.lastSpawn + sb.interval) {
This what you will find at step 5:
C++:
spawnBlock_t& sb = it.second;
if (OTSYS_TIME() >= sb.lastSpawn + sb.interval) {
if (findPlayer(sb.pos)) {
sb.lastSpawn = OTSYS_TIME();
continue;
}
Change it to:
C++:
spawnBlock_t& sb = it.second;
uint32_t newInterval = (sb.interval / static_cast<uint32_t>(g_config.getNumber(ConfigManager::RATE_SPAWNTIME)));
if (OTSYS_TIME() >= sb.lastSpawn + newInterval) {
if (findPlayer(sb.pos)) {
sb.lastSpawn = OTSYS_TIME();
continue;
}
  • Now compile
  • Add rateSpawnTime = 2 to your config.lua (for example this will divide your spawntime by 2)
  • Enjoy
 
Solution
Open mapname-spawns.xml in Notepad++:
Ctrl+H
in Find what:
Code:
(<monster name="MONSTER NAME"[^>]*)(spawntime="CURRENT SPAWN TIME")([^>]*/>)
in Replace with:
Code:
\1spawntime="UPDATED SPAWN TIME"\3
Example:
XML:
    <spawn centerx="32104" centery="31133" centerz="0" radius="2">
        <monster name="Ice Golem" x="2" y="1" z="0" spawntime="120" />
    </spawn>
    <spawn centerx="32135" centery="31135" centerz="0" radius="2">
        <monster name="Ice Golem" x="1" y="-2" z="0" spawntime="120" />
    </spawn>
    <spawn centerx="32106" centery="31140" centerz="0" radius="2">
        <monster name="Ice Golem" x="2" y="0" z="0" spawntime="120" />
    </spawn>
    <spawn centerx="32129" centery="31141" centerz="0" radius="2">
        <monster name="Ice Golem" x="-1" y="0" z="0" spawntime="120" />
    </spawn>

Code:
(<monster name="Ice Golem"[^>]*)(spawntime="120")([^>]*/>)
\1spawntime="160"\3
click: Replace all

Result:
XML:
    <spawn centerx="32104" centery="31133" centerz="0" radius="2">
        <monster name="Ice Golem" x="2" y="1" z="0" spawntime="160" />
    </spawn>
    <spawn centerx="32135" centery="31135" centerz="0" radius="2">
        <monster name="Ice Golem" x="1" y="-2" z="0" spawntime="160" />
    </spawn>
    <spawn centerx="32106" centery="31140" centerz="0" radius="2">
        <monster name="Ice Golem" x="2" y="0" z="0" spawntime="160" />
    </spawn>
    <spawn centerx="32129" centery="31141" centerz="0" radius="2">
        <monster name="Ice Golem" x="-1" y="0" z="0" spawntime="160" />
    </spawn>

This change all Ice Golems spawn time in file if previous spawn time was 120.
Might be useful for someone.
 
You have rateSpawn in your config.lua.. From looking at the spawn.cpp I found out that rateSpawn seems to be increasing the amount of monsters spawned..
Therefore you can't change it in config.lua (at this moment).
You have two options:
  1. Change the source and add spawn time modifier for your config
  2. Change the monster spawn times in RME or by opening world-spawn.xml in texteditor and using replace to quickly edit the spawn times

If you want a quick solution for the source:
  1. Go to configmanager.cpp and find integer[RATE_SPAWN] = getGlobalNumber(L, "rateSpawn", 1);
  2. Under that add new line with integer[RATE_SPAWNTIME] = getGlobalNumber(L, "rateSpawnTime", 1);
  3. Go to configmanager.h and find enum integer_config_t { under that find RATE_SPAWN,
  4. Under that add new line with RATE_SPAWNTIME,
  5. Now go to spawn.cpp and find line if (OTSYS_TIME() >= sb.lastSpawn + sb.interval) {
This what you will find at step 5:
C++:
spawnBlock_t& sb = it.second;
if (OTSYS_TIME() >= sb.lastSpawn + sb.interval) {
if (findPlayer(sb.pos)) {
sb.lastSpawn = OTSYS_TIME();
continue;
}
Change it to:
C++:
spawnBlock_t& sb = it.second;
uint32_t newInterval = (sb.interval / static_cast<uint32_t>(g_config.getNumber(ConfigManager::RATE_SPAWNTIME)));
if (OTSYS_TIME() >= sb.lastSpawn + newInterval) {
if (findPlayer(sb.pos)) {
sb.lastSpawn = OTSYS_TIME();
continue;
}
  • Now compile
  • Add rateSpawnTime = 2 to your config.lua (for example this will divide your spawntime by 2)
  • Enjoy
I made these changes, build the .exe, replaced my server's .exe with the newly built one and I am seeing no difference in the spawn time.
 
Back
Top