• 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!

CIP Files Spawns (monster.db) - Location, radius, etc.

TibiCAM

Advanced OT User
Joined
Feb 3, 2020
Messages
165
Reaction score
213
Hello,

I am trying to use the "monster.db" file to output spawns on my map.
I have the locations, I have all of the monster id/names and the amount etc...

But in what order should I place them? It seems CipSoft's files took blocked paths into consideration and then moved them accordingly?
Is there a such feature in Remeres Map Editor?

Look at this example:
46GOasS.png


In the CipSoft files, these three spawns have these lines:

Code:
Race X Y Z Radius Amount Regen.
21 32369 32189  8     50      3    300
21 32367 32216  8     50      4    300
30 32377 32208  8     50      3    500

So this basically just translated to:
21 = rat
30 = spider

Place 3 rats at 32369 32189 8.
Place 4 rats at 32367 32216 8.
Place 3 spiders at 32377 32208 8.

But as you can see, some end up on walls.
So what order should they be placed in?

Right now, I have it like this:
IDHF4a4.png


Okay so.. let's say there is NO blocking path/wall etc...
What would be the correct way of doing it?

And what if there IS a blocking path? Then what?
Here's an example of the 10x snake spawn in Thais east troll spawn:

a1WFDjQ.png
 
AFAIK, the spawn center + radius is used to determine the valid tiles where the N creatures are able to spawn.
Take a radius of 3 and suppose it yields the following possible tiles:
( X valid . clear # blocked )
. . . . . X . . . . . . . . . # X X . . . . . . . X X # X X . . . . . X # X C X X X . . . . . X X X X # . . . . . . . X # X . . . . . . . . . # . . . . .

With # as the blocked tiles. One possible approach to this is to just choose randomly from all the possible spots and retry if it's blocked.
But if you think about the following:
( # walls | door Z interesting spot )
. . . . . X . . . . . . . . . X X X # # # # . . . X X X X # . . # . . X X X C X # Z . | . . . X X X X # . . # . . . . X X X # # # # . . . . . X . . . . .

We could potentially randomly be placing the creature in Z, which is not a valid place, since there is no way it would even walk into on it's own.
Therefore, yes- pathwandering from the center to any of the valid tiles is the right way to solve it.
Furthermore, there is at least one edge case we can think about: what if the center is actually blocked? A solution is to extend the pathwander solution with the assumption that blocking tiles are fine to wander to (but not actually place the creature), IFF we are wandering from a blocked tile as well, until we find a suitable spot.

I don't know if the map editor handles this case, but in any case it seems like a problem you'd want to solve on the sever side, while actually placing the creatures.
 
You did not specify what Tibia version you're referring to. There's a whole difference between 7.4 (judging by sprites) and 7.7 (cipsoft files).
Either way, you can't solve it in RME, not only because it lacks such function, but more importantly because it would assaign each monster to a separated specified square, which is not correct. This has to be handled server-side.
 
I made a function in LUA that teleported to all of these coordinates. And on each coordinate, I would loop through all tiles around it (depending on the "Amount"-variable). If any of the tiles contained any of blocked item id's (yes I added these item id's by hand(!) into array), it would simply print out the location. I would then go through them manually in RME and change them accordingly to make them not appear on any blocked tile.

It took time but it's absolutely perfect right now!

I don't code at all, so my code is messy as shit.
I also had to do a parser in C# for this.

You probably won't understand anything of this C# shit, and I kept changing it every 5 minutes and shit.
BUT I got it to work in the end by running it through like 12 times, keep excluding tiles that did not exist in 7.4, then loop through the "good coordinates".

Messiest shit you've ever seen. I'm not even going to begin to explain it.

>> Code here (Pastebin) <<


And here is my LUA to just teleport to the tiles, but again this is messy as fuck so don't even bother with this shit.
But basically, it will go to all of the spawn coordinates.
I spawn them like this picture:

So if I have "amount:2", I only check the tile 1 and 2.
So I don't scan other tiles around that isn't even needed.
Cus that would just be unneccessary.

IDHF4a4.png



YES: I added these item id by myself. It even includes shit like fire fields. But obviously some monsters CAN spawn on them, like the demon skeleton spawn in banshee quest cave!

LUA:
spawnPositions = {
    { x = 32364, y = 31664, z = 7, amount = 4 },
    { x = 32366, y = 31668, z = 7, amount = 2 },
    { x = 32363, y = 31669, z = 7, amount = 1 },
    { x = 32368, y = 31672, z = 7, amount = 3 },
    { x = 32360, y = 31673, z = 7, amount = 5 },
    { x = 32475, y = 32217, z = 7, amount = 10 },
    { x = 32458, y = 32217, z = 7, amount = 12 },
    { x = 32367, y = 32216, z = 8, amount = 4 }
}
 
groundIds = { 1277, 1280, 1281, 1282, 1283, 383, 392, 2595, 2596, 1360, 1361, 1362, 1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1414, 1417, 1418, 1419, 1420, 1423, 1424, 1425, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1434, 1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473, 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 2334, 2555, 2593, 2601, 2602, 2603, 2604, 2605, 2610, 2611, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 100, 101, 460, 459, 490, 598, 602, 493, 708, 1509, 464, 466, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 1621, 1622, 1623, 1624, 1625, 1626, 1627, 1628, 1629, 1630, 1631, 1632, 1633, 1634, 1635, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1649, 1650, 1651, 1652, 1653, 1654, 1655, 1656, 1657, 1658, 1659, 1660, 1661, 1662, 1663, 1664, 1665, 1666, 1667, 1668, 1669, 1670, 1671, 1672, 1673, 1674, 1675, 1676, 1677, 1710, 1711, 1712, 1713, 1714, 1715, 1716, 1717, 1718, 1719, 1720, 1721, 1722, 1723, 1724, 1725, 1726, 1727, 1728, 1729, 1730, 1731, 1732, 1733, 1734, 1735, 1736, 1737, 1738, 1739, 1740, 1741, 1742, 1743, 1744, 1745, 1746, 1747, 1748, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 1759, 1760, 1761, 1762, 1763, 1764, 1765, 1766, 1767, 1768, 1769, 1770, 1771, 1772, 1773, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1783, 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 2034, 2080, 2081, 2082, 2083, 2084, 2085, 2589, 2590, 2591, 2592, 2594, 2606, 2607, 2608, 2609, 2614, 2615, 386, 387, 388, 389, 390, 391, 1499, 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, 1353, 1354, 1355, 1356, 1357, 1358, 1359, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 2735, 2736, 2737, 2738, 2739, 2762, 2763, 2764, 2765, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2782, 2783, 2784, 2785, 2786, 469, 470, 482, 484, 489, 369, 370, 408, 409, 410, 411, 423, 427, 428, 429, 432, 433, 461, 462, 475, 476, 479, 480, 924, 1386, 1385, 1396, 293, 294, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 422, 421, 463,491, 492, 599, 600, 601, 603, 604, 605, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 709, 710, 711, 873, 874, 875, 876, 877, 878, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 919, 921, 922, 923, 925, 928, 930, 931, 932, 933, 934, 935, 938, 940, 941, 942, 943, 944, 945, 949, 950, 951, 952, 953, 954, 955, 959, 960, 961, 962, 963, 964, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1219, 1220, 1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 1404, 1405, 1487, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1510, 1511, 1512, 1513, 1514, 1515, 1516, 1517, 1518, 1519, 1520, 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1594, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1809, 1810, 1811, 1812, 1813, 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, 1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 1833, 1834, 1835, 1836, 1837, 1838, 1839, 1840, 1841, 1842, 1843, 1844, 1845, 1846, 1847, 1848, 1849, 1850, 1855, 1856, 1909, 1910, 1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 1943, 1944   }

function onSay(cid, words, param) 
    addEvent(teleportMe, 100, cid)
    return 1
end

local tps = 1

function teleportMe(cid, current)
    if tps < 8000 then
        doTeleportThing(cid, spawnPositions[tps])
     
        if (not canSpawn(spawnPositions[tps], cid)) then
            print(spawnPositions[tps].x .. " " .. spawnPositions[tps].y .. " " .. spawnPositions[tps].z)
            doPlayerSendTextMessage(cid, 22, spawnPositions[tps].x .. " " .. spawnPositions[tps].y .. " " .. spawnPositions[tps].z)
        end
     
        tps = tps + 1
     
        addEvent(teleportMe, 100, cid)
    end
 
    return 1
end

function canSpawn(pos, creature)
    -- Get 12 SQM item ids
    local center = { x = pos.x, y = pos.y, z = pos.z, stackpos = 0 }
    local topleft = { x = pos.x-1, y = pos.y-1, z = pos.z, stackpos = 0 }
    local top = { x = pos.x, y = pos.y-1, z = pos.z, stackpos = 0 }
    local topright = { x = pos.x+1, y = pos.y-1, z = pos.z, stackpos = 0 }
    local left = { x = pos.x-1, y = pos.y, z = pos.z, stackpos = 0 }
    local right = { x = pos.x+1, y = pos.y, z = pos.z, stackpos = 0 }
    local bottomleft = { x = pos.x-1, y = pos.y+1, z = pos.z, stackpos = 0 }
    local bottom = { x = pos.x, y = pos.y+1, z = pos.z, stackpos = 0 }
    local bottomright = { x = pos.x+1, y = pos.y+1, z = pos.z, stackpos = 0 }
    local ten = { x = pos.x+2, y = pos.y-1, z = pos.z, stackpos = 0 }
    local eleven = { x = pos.x+2, y = pos.y, z = pos.z, stackpos = 0 }
    local twelve = { x = pos.x+2, y = pos.y+1, z = pos.z, stackpos = 0 }
 
 
    if (pos.amount == 1) then
        -- Iterate through all items on each tile
        for i=1,#groundIds do
            local find = getTileItemById(center, groundIds[i]).itemid
            if find ~= 0 then
                -- Item found. Not walkable. Return false.
                return false
            end
        end
    elseif (pos.amount == 2) then
        -- Iterate through all items on each tile
        for i=1,#groundIds do
            local find1 = getTileItemById(center, groundIds[i]).itemid
            local find2 = getTileItemById(right, groundIds[i]).itemid
            if find1 ~= 0 or find2 ~= 0 then
                -- Item found. Not walkable. Return false.
                return false
            end
        end
    elseif (pos.amount == 3) then
        -- Iterate through all items on each tile
        for i=1,#groundIds do
            local find1 = getTileItemById(center, groundIds[i]).itemid
            local find2 = getTileItemById(right, groundIds[i]).itemid
            local find3 = getTileItemById(bottomright, groundIds[i]).itemid
            if find1 ~= 0 or find2 ~= 0 or find3 ~= 0 then
                -- Item found. Not walkable. Return false.
                return false
            end
        end
    elseif (pos.amount == 4) then
        -- Iterate through all items on each tile
        for i=1,#groundIds do
            local find1 = getTileItemById(center, groundIds[i]).itemid
            local find2 = getTileItemById(right, groundIds[i]).itemid
            local find3 = getTileItemById(bottomright, groundIds[i]).itemid
            local find4 = getTileItemById(bottom, groundIds[i]).itemid
            if find1 ~= 0 or find2 ~= 0 or find3 ~= 0 or find4 ~= 0 then
                -- Item found. Not walkable. Return false.
                return false
            end
        end
    elseif (pos.amount == 5) then
        -- Iterate through all items on each tile
        for i=1,#groundIds do
            local find1 = getTileItemById(center, groundIds[i]).itemid
            local find2 = getTileItemById(right, groundIds[i]).itemid
            local find3 = getTileItemById(bottomright, groundIds[i]).itemid
            local find4 = getTileItemById(bottom, groundIds[i]).itemid
            local find5 = getTileItemById(bottomleft, groundIds[i]).itemid
            if find1 ~= 0 or find2 ~= 0 or find3 ~= 0 or find4 ~= 0 or find5 ~= 0 then
                -- Item found. Not walkable. Return false.
                return false
            end
        end
    elseif (pos.amount == 6) then
        -- Iterate through all items on each tile
        for i=1,#groundIds do
            local find1 = getTileItemById(center, groundIds[i]).itemid
            local find2 = getTileItemById(right, groundIds[i]).itemid
            local find3 = getTileItemById(bottomright, groundIds[i]).itemid
            local find4 = getTileItemById(bottom, groundIds[i]).itemid
            local find5 = getTileItemById(bottomleft, groundIds[i]).itemid
            local find6 = getTileItemById(left, groundIds[i]).itemid
            if find1 ~= 0 or find2 ~= 0 or find3 ~= 0 or find4 ~= 0 or find5 ~= 0 or find6 ~= 0 then
                -- Item found. Not walkable. Return false.
                return false
            end
        end
    elseif (pos.amount == 7) then
        -- Iterate through all items on each tile
        for i=1,#groundIds do
            local find1 = getTileItemById(center, groundIds[i]).itemid
            local find2 = getTileItemById(right, groundIds[i]).itemid
            local find3 = getTileItemById(bottomright, groundIds[i]).itemid
            local find4 = getTileItemById(bottom, groundIds[i]).itemid
            local find5 = getTileItemById(bottomleft, groundIds[i]).itemid
            local find6 = getTileItemById(left, groundIds[i]).itemid
            local find7 = getTileItemById(topleft, groundIds[i]).itemid
            if find1 ~= 0 or find2 ~= 0 or find3 ~= 0 or find4 ~= 0 or find5 ~= 0 or find6 ~= 0 or find7 ~= 0 then
                -- Item found. Not walkable. Return false.
                return false
            end
        end
    elseif (pos.amount == 8) then
        -- Iterate through all items on each tile
        for i=1,#groundIds do
            local find1 = getTileItemById(center, groundIds[i]).itemid
            local find2 = getTileItemById(right, groundIds[i]).itemid
            local find3 = getTileItemById(bottomright, groundIds[i]).itemid
            local find4 = getTileItemById(bottom, groundIds[i]).itemid
            local find5 = getTileItemById(bottomleft, groundIds[i]).itemid
            local find6 = getTileItemById(left, groundIds[i]).itemid
            local find7 = getTileItemById(topleft, groundIds[i]).itemid
            local find8 = getTileItemById(top, groundIds[i]).itemid
            if find1 ~= 0 or find2 ~= 0 or find3 ~= 0 or find4 ~= 0 or find5 ~= 0 or find6 ~= 0 or find7 ~= 0 or find8 ~= 0 then
                -- Item found. Not walkable. Return false.
                return false
            end
        end
    elseif (pos.amount == 9) then
        -- Iterate through all items on each tile
        for i=1,#groundIds do
            local find1 = getTileItemById(center, groundIds[i]).itemid
            local find2 = getTileItemById(right, groundIds[i]).itemid
            local find3 = getTileItemById(bottomright, groundIds[i]).itemid
            local find4 = getTileItemById(bottom, groundIds[i]).itemid
            local find5 = getTileItemById(bottomleft, groundIds[i]).itemid
            local find6 = getTileItemById(left, groundIds[i]).itemid
            local find7 = getTileItemById(topleft, groundIds[i]).itemid
            local find8 = getTileItemById(top, groundIds[i]).itemid
            local find9 = getTileItemById(topright, groundIds[i]).itemid
            if find1 ~= 0 or find2 ~= 0 or find3 ~= 0 or find4 ~= 0 or find5 ~= 0 or find6 ~= 0 or find7 ~= 0 or find8 ~= 0 or find9 ~= 0 then
                -- Item found. Not walkable. Return false.
                return false
            end
        end
    elseif (pos.amount == 10) then
        -- Iterate through all items on each tile
        for i=1,#groundIds do
            local find1 = getTileItemById(center, groundIds[i]).itemid
            local find2 = getTileItemById(right, groundIds[i]).itemid
            local find3 = getTileItemById(bottomright, groundIds[i]).itemid
            local find4 = getTileItemById(bottom, groundIds[i]).itemid
            local find5 = getTileItemById(bottomleft, groundIds[i]).itemid
            local find6 = getTileItemById(left, groundIds[i]).itemid
            local find7 = getTileItemById(topleft, groundIds[i]).itemid
            local find8 = getTileItemById(top, groundIds[i]).itemid
            local find9 = getTileItemById(topright, groundIds[i]).itemid
            local find10 = getTileItemById(ten, groundIds[i]).itemid
            if find1 ~= 0 or find2 ~= 0 or find3 ~= 0 or find4 ~= 0 or find5 ~= 0 or find6 ~= 0 or find7 ~= 0 or find8 ~= 0 or find9 ~= 0 or find10 ~= 0 then
                -- Item found. Not walkable. Return false.
                return false
            end
        end
    elseif (pos.amount == 11) then
        -- Iterate through all items on each tile
        for i=1,#groundIds do
            local find1 = getTileItemById(center, groundIds[i]).itemid
            local find2 = getTileItemById(right, groundIds[i]).itemid
            local find3 = getTileItemById(bottomright, groundIds[i]).itemid
            local find4 = getTileItemById(bottom, groundIds[i]).itemid
            local find5 = getTileItemById(bottomleft, groundIds[i]).itemid
            local find6 = getTileItemById(left, groundIds[i]).itemid
            local find7 = getTileItemById(topleft, groundIds[i]).itemid
            local find8 = getTileItemById(top, groundIds[i]).itemid
            local find9 = getTileItemById(topright, groundIds[i]).itemid
            local find10 = getTileItemById(ten, groundIds[i]).itemid
            local find11 = getTileItemById(eleven, groundIds[i]).itemid
            if find1 ~= 0 or find2 ~= 0 or find3 ~= 0 or find4 ~= 0 or find5 ~= 0 or find6 ~= 0 or find7 ~= 0 or find8 ~= 0 or find9 ~= 0 or find10 ~= 0 or find11 ~= 0 then
                -- Item found. Not walkable. Return false.
                return false
            end
        end
    elseif (pos.amount == 12) then
        -- Iterate through all items on each tile
        for i=1,#groundIds do
            local find1 = getTileItemById(center, groundIds[i]).itemid
            local find2 = getTileItemById(right, groundIds[i]).itemid
            local find3 = getTileItemById(bottomright, groundIds[i]).itemid
            local find4 = getTileItemById(bottom, groundIds[i]).itemid
            local find5 = getTileItemById(bottomleft, groundIds[i]).itemid
            local find6 = getTileItemById(left, groundIds[i]).itemid
            local find7 = getTileItemById(topleft, groundIds[i]).itemid
            local find8 = getTileItemById(top, groundIds[i]).itemid
            local find9 = getTileItemById(topright, groundIds[i]).itemid
            local find10 = getTileItemById(ten, groundIds[i]).itemid
            local find11 = getTileItemById(eleven, groundIds[i]).itemid
            local find12 = getTileItemById(twelve, groundIds[i]).itemid
            if find1 ~= 0 or find2 ~= 0 or find3 ~= 0 or find4 ~= 0 or find5 ~= 0 or find6 ~= 0 or find7 ~= 0 or find8 ~= 0 or find9 ~= 0 or find10 ~= 0 or find11 ~= 0 or find12 ~= 0 then
                -- Item found. Not walkable. Return false.
                return false
            end
        end
    end
 
    return true
end

function contains(list, x)
    for _, v in pairs(list) do
        if v == x then return true end
    end
    return false
end

function isWalkable(pos, creature)
        for key, value in ipairs(groundIds) do
            if value ~= getThingFromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid then
                -- Tile is not walkable
                print("Value: " .. value .. ", TileId: " .. getThingFromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid .. ", Pos: " .. pos.x .. ", " .. pos.y .. ", " .. pos.z)
                return key
            end
        end
    return true
end

Instead of just those few spawn positions it was all of the spawn coordinates. Like 8000 lines.


To go through all blockable items: 1.5h.. (?)
To go through all the shit of coding this shit (im a 100% noob): 3h
To then go through all tiles in map editor and edit the spawn locations (move X/Y coordinate): 5h
So... maybe 10 hours total for this shit!

And I KNOW u can probably take a diarrhea shit and code this in a one-liner in 20 seconds. But HEY! Im not that good. And fuck it... this works!

End result: IM HAPPY. Got fucking full respawn. Yes this is 7.4. And yes, my hands are hurting.
Semi-automatic solution.

And YES: my variable names is cancerous cus I kept changing my approach but kept the same damn variable names. "groundid" should now be "item_id_of_blockable_stuff". I probably put some extra stuff in there, but hey... better to have too many than too few!

I probably lost 78% of my hair on my head during these hours, from utter frustration. So now Im BALD as well and need a new keyboard.

FUCK im so happy though.
Post automatically merged:

Gif of my script. Any coordinate output in chat = it has a blocked item.
Then I open the damn map and go to it and edit it.
But I didnt edit in RME. I edit my "output.txt" file (which is really input - yes. nice name!?). Which then generate my spawn xml file.
Because if I save in RME; it will fuck up the spawns a bit. I dont like it.
Same with NPC.

 
Last edited:
As far i can know you need a new spawn system which requires you to change code in remeres and tfs. You need to remove the pink fire thing with the spawn area and replace it with a creature which will set the spawn data(spawn center, monster type name and spawn amount). Then tfs will read this data and using the center position it find the available positions and spawn the monster.
 
As far i can know you need a new spawn system which requires you to change code in remeres and tfs. You need to remove the pink fire thing with the spawn area and replace it with a creature which will set the spawn data(spawn center, monster type name and spawn amount). Then tfs will read this data and using the center position it find the available positions and spawn the monster.

Another approach is to just make the raid system spawn the monsters on server start.
There I can use randomization. But I already resolved this issue with lots of manual work and some automation :)
 
Back
Top