bpm91
Advanced OT User
- Joined
- May 23, 2019
- Messages
- 1,046
- Solutions
- 7
- Reaction score
- 180
- Location
- Brazil
- YouTube
- caruniawikibr
Are you using OTC?In global tibia we can observe the light that enters the lower floor of the cave, however how can we do this in a global way?
tfs 1.5
View attachment 84905
Post automatically merged:
Does anyone know how to make the light penetrate downstairs? from level 8 to 7 for example
void Game::checkLight()
yes otv8Are you using OTC?
This is a client sided feature with cipsoft official game clients I believe.
"Tile" Class:// tile.h
class Tile {
public:
Tile(bool allowLightToPass = false);
bool allowsLightToPass() const { return allowLightToPass; }
private:
bool allowLightToPass;
};
"Tile::Tile" Function:// tile.cpp
Tile::Tile(uint16_t id) {
ItemType& it = Item::items[id];
allowLightToPass = it.allowLightToPass;
}
"Game::PropagateLight" Function:// game.cpp
void Game::propagateLight(const Position& pos, LightInfo& lightInfo) {
Tile* tile = map->getTile(pos);
if (tile && tile->allowsLightToPass()) {
// Propagate light to the floor below
Position belowPos = pos;
belowPos.z += 1;
Tile* belowTile = map->getTile(belowPos);
if (belowTile) {
belowTile->applyLight(lightInfo);
}
}
}
"Map::drawLight" Function:// map.cpp
void Map::drawLight(const LightInfo& lightInfo) {
for (const auto& tile : tiles) {
if (tile->allowsLightToPass()) {
// Draw light on the current floor
drawTileLight(tile, lightInfo);
// Draw light on the floor below
Position belowPos = tile->getPosition();
belowPos.z += 1;
Tile* belowTile = getTile(belowPos);
if (belowTile) {
drawTileLight(belowTile, lightInfo);
}
}
}
}
void Map::drawTileLight(Tile* tile, const LightInfo& lightInfo) {
// Custom drawing logic for a tile
if (!tile) return;
// Determine the light intensity and color
int lightLevel = lightInfo.level;
int lightColor = lightInfo.color;
// Adjust light based on the position and level
int x = tile->getPosition().x;
int y = tile->getPosition().y;
int z = tile->getPosition().z;
// Draw the light
g_drawLight(x, y, z, lightLevel, lightColor);
}
items.xml:<!-- items.xml -->
<item id="12345" name="light-permeable tile" allowLightToPass="true" />
Looks like AI hallucination. Code above for sure will not work, as 'programmer' thought that OTCv8 and TFS 1.5 are parts of same code and share C++ variables.Though, I haven't tested it obviously, but it may give you an idea.
Any idea ?Looks like AI hallucination. Code above for sure will not work, as 'programmer' thought that OTCv8 and TFS 1.5 are parts of same code and share C++ variables.
There is nothing to change on server side. All items (from floor above = ground level) and items information from Tibia.dat are already in OTCv8. If it does not render light from level above, it's probably not implemented in client.
Best to do is to share the solution in the thread to be closed by any modI got information from a programmer who works on otcv8, would anyone know what is done to make this happen?