• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Feature Instance System

:eek:

Wtf, if first check is false, it will make comparision of the second part which is the same as first...
C++:
if (creature->getInstanceID() != getInstanceID()) {
return false;
}

There you go bud. Nice and easy for you now.
 
Congratulations for the contribution, currently there are few people to encourage and many to fill the bag, keep up the good work, I await updates, big hug.
 
Because I'm done releasing stuff for free for this community full of leechers, they deserve nothing. Other than maintaining OTCv8, I'm not contributing to anything anymore.
haha you are so lame, trying to make this a job... its a jobbie for all of us... I'm sure that much of us have regular jobs on our real life... this is just an instance to have some fun. Dont take it that serious.. thanks for still being here @Itutorial
 
@Itutorial Would you not be willing to continue with this system?
We need Tiles e Map and getQTNode... for suport instances.
Using class Thing to apply all instanceID do all objects.
class: Thing->{Creatures, Item, Tile etc...}
ex:
C++:
creatures->getInstanceID();
player->getInstanceID();
item->getInstanceID();

map.h
std::map<uint32_t, std::unique_ptr<QTreeNode>> instances;
std::unordered_map<uint32_t, SpectatorCache> spectatorCacheInstances;
std::unordered_map<uint32_t, SpectatorCache> playersSpectatorCacheInstances;

// tiles
const Tile* tile = getTile(start.x, start.y, start.z, instanceId);
setTile(x, y, z, clonedTile, targetInstanceId);

finally ex:
C++:
Position fromPos(32055, 32220, 0);
Position toPos(32061, 32227, 15);
uint32_t instance = 3;
map.createMapInstance(
    instance, fromPos, toPos
);
player->setInstanceID(instance);
g_game.internalTeleport(player, Position(32058, 32223, 9), false);
This creates an empty map with the same position as the selected region, but for small regions.
Depending on the size, there may be some issues when creating an instance, depending on the host configuration.
Its very work and requires a lot of testing.
There are other ways, but this one is the least work.
 
Back
Top