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

Question About Remere's Mapeditor

destroyer667

Member
Joined
Nov 21, 2007
Messages
290
Reaction score
6
I noticed when you open a map with remere's mapeditor there is an option to set a door id to 1 which makes it a house door entrance. Well there isn't an option for that when you open a map with 7.6

So my question is. Is there a way to make door id "1221" and "1219" automatically have door id "1"? Maybe i can edit a file in remeres folder to make this happen? Other wise i have to set 850 house door id's to 1.... :/ and not every house has just 1 door.
 
As for 7.6 Open-Tibia servers I suppose it is all XML-based.
Therefore you will have to configurate your housetiles on your own (manually) in a placed XML file.

Correct me if I'm wrong! :)
 
Yeah I thought the same. Before when I was adding houses I was editing a file (houses.xml)? Where I manually write the from x,y,z to x,y,z and door cord. Same file where I add house number and name and such things.
 
well since i can compile now would it be that difficult to edit in the sources? not sure how i would go about doing so. If its really hard then ill just manually do it in rme but if its some what easy ill try editing it in sources.


i found this in house.cpp

i have 2 ideas on how maybe i could get this to work.
1: Some how make it so that doors 1221/1219 already have doorID 1 in game.
2: where is says doorID maybe take that out im not sure. i dont know how to read cpp yet im still learning

LUA:
Door* House::getDoorByNumber(uint32_t doorId)
{
	HouseDoorList::iterator it;
	for(it = doorList.begin(); it != doorList.end(); ++it){
		if((*it)->getDoorId() == doorId){
			return *it;
		}
	}
	return NULL;
}

Door* House::getDoorByNumber(uint32_t doorId) const
{
	HouseDoorList::const_iterator it;
	for(it = doorList.begin(); it != doorList.end(); ++it){
		if((*it)->getDoorId() == doorId){
			return *it;
		}
	}
	return NULL;
}
 
Last edited:
you were supposed to edit the part in maploader where it checks if the door is on a housetile and if it has an id
 
i looked in House.cpp/h map.cpp/h housetile.cpp/h cant find where to change 1 to 0 for house doorID

found some stuff though




EDIT: i was looking at it. Should i remove doorID all together? or would that mess everything up.
house.cpp
LUA:
void House::updateDoorDescription()
{
	std::stringstream houseDescription;
	houseDescription << "It belongs to house '" << houseName << "'. " << std::endl;

	if(houseOwner != 0){
		houseDescription << houseOwnerName;
	}
	else{
		houseDescription << "Nobody";
	}
	houseDescription << " owns this house." << std::endl;

	HouseDoorList::iterator it;
	for(it = doorList.begin(); it != doorList.end(); ++it){
		(*it)->setSpecialDescription(houseDescription.str());
	}
}

LUA:
void House::addDoor(Door* door)
{
	door->useThing2();
	doorList.push_back(door);
	door->setHouse(this);
	updateDoorDescription();
}

void House::removeDoor(Door* door)
{
	HouseDoorList::iterator it = std::find(doorList.begin(), doorList.end(), door);
	if(it != doorList.end()){
		(*it)->releaseThing2();
		doorList.erase(it);
	}
}
LUA:
Door* House::getDoorByNumber(uint32_t doorId)
{
	HouseDoorList::iterator it;
	for(it = doorList.begin(); it != doorList.end(); ++it){
		if((*it)->getDoorId() == doorId){
			return *it;
		}
	}
	return NULL;
}

Door* House::getDoorByNumber(uint32_t doorId) const
{
	HouseDoorList::const_iterator it;
	for(it = doorList.begin(); it != doorList.end(); ++it){
		if((*it)->getDoorId() == doorId){
			return *it;
		}
	}
	return NULL;
}
LUA:
bool Door::readAttr(AttrTypes_t attr, PropStream& propStream)
{
	if(ATTR_HOUSEDOORID == attr){
		unsigned char _doorId = 0;
		if(!propStream.GET_UCHAR(_doorId)){
			return false;
		}

		setDoorId(_doorId);
		return true;
	}
	else
		return Item::readAttr(attr, propStream);


Map.cpp

LUA:
bool Map::loadMap(const std::string& identifier, const std::string& type)
{
	IOMap* loader;

	if(type == "XML"){
		loader = new IOMapXML();
	}
	else if(type == "OTBM"){
		loader = new IOMapOTBM();
	}
	else{
		std::cout << "FATAL: Could not determine the map format!" << std::endl;
		std::cin.get();
		return false;
	}

	std::cout << ":: Loading map from: " << identifier << " " << loader->getSourceDescription() << std::endl;

	if(!loader->loadMap(this, identifier)){
        std::cout << "FATAL: [OTBM loader] " << loader->getLastErrorString() << std::endl;
        std::cin.get();
        return false;
    }

	if(!loader->loadSpawns(this)){
		std::cout << "WARNING: could not load spawn data." << std::endl;
	}

	if(!loader->loadHouses(this)){
		std::cout << "WARNING: could not load house data." << std::endl;
	}

	delete loader;

	IOMapSerialize* IOMapSerialize = IOMapSerialize::getInstance();
	IOMapSerialize->loadHouseInfo(this);
	IOMapSerialize->loadMap(this);

	return true;
}
 
still cant fix this i guess ill just do all doors by hands >.< but if i edit the map and save it again then the map changes all the doors back to 0 and i have to dl it all over again so there mus tbe a way around this.


it doesn't do this with the Avesta v4 files but i cant get those anymore bc the link is broken.
 
I just want to note for the record that I hope Remere gets hit by an asteroid, comet, or meteor, preferably all three for not releasing the source code for his latest version of RME and then straight up disappearing from the scene. Protect some new features my ass.

OP: Couldn't you edit the maploader to automatically assume the door has an ID of 1 if it's on a house tile?
 
@ Ckyotitan

I have to open the Map in 8.0 edit the doors and the convert the map over to 7.6 and save it. But if i ever want to edit the map or add something more to it and save it again the doors get set back to 0.

@ Lessaire
OP: Couldn't you edit the maploader to automatically assume the door has an ID of 1 if it's on a house tile?

Are you asking me if i could do that? Idk how


I looked in all my sources for my server to figure out if i can edit it some how to read that if doors have id 0 then its a house door.

Also i was thinking At what lessaire said is there a way in the map editor to make the door auto have id 1 if its set on a house tile?
 
OP: Couldn't you edit the maploader to automatically assume the door has an ID of 1 if it's on a house tile?
That's what I suggested, but he isn't posting any relevant code
you were supposed to edit the part in maploader where it checks if the door is on a housetile and if it has an id

it could be this (iomapotbm.cpp)
[cpp]//
// TESTING
if(isHouseTile){
Door* door = item->getDoor();
if(door && door->getDoorId() != 0){
house->addDoor(door);
}
}
//[/cpp]
but you can't make all the doors have ID 1, house lists wouldn't work correctly then and you would get SQL errors when the server tries to save them, if the house has multiple doors.
 
Last edited:
what if i took the doorID code out of the sources completely so then it doesn't even need to check if the house door has an ID? i could just place a door on the house tile and the door would say the name of the house and work like a house door.
 
what if i took the doorID code out of the sources completely so then it doesn't even need to check if the house door has an ID? i could just place a door on the house tile and the door would say the name of the house and work like a house door.

I'd imagine aleta som and aleta sio would both go out the window with the baby and the bathwater.
 
im just confused why if I load my map with Avesta v4 the houses work but when i load it with avesta 0.6.3 the houses dont work...

when i say dont work i mean the doors dont work(say the house name and ppl can open the doors like regular doors)
 
Back
Top