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

TFS 1.X+ Wrong Monster View Range

enemyy

Member
Joined
Aug 11, 2017
Messages
28
Reaction score
5
Base: The Forgotten Server 1.3 (Mark Samman/gustavo contreiras), Versão: 10.98. sources repository used -- > SRC (Gustavo Contreiras)

Hey friends,


I have a little problem with monsters' vision radius,


I'm trying to get the Monsters to be able to see the Players from a distance compatible with the number of tiles added to my server / client (x.15, y.9)

but monsters are only activated over short distances, like a Tibia original tiles range.

SQM PROBLEMA.png

Currently the values of my map.h are like this:

C++:
class Map

{

    public:

        static constexpr int32_t maxViewportX = 15; //min value: maxClientViewportX + 1

        static constexpr int32_t maxViewportY = 9; //min value: maxClientViewportY + 1

        static constexpr int32_t maxClientViewportX = 14;

        static constexpr int32_t maxClientViewportY = 8;



And in creature.cpp like this:

C++:
bool Creature::canSee(const Position& pos) const

{

    return canSee(getPosition(), pos, Map::maxViewportX, Map::maxViewportY);

}


That was to make the activity range of monsters x = 15 and y = 9 respectively from his position, right?
But monsters remain limited to standard distances...




already tried to replace the line :

C++:
return canSee(getPosition(), pos, Map::maxViewportX, Map::maxViewportY);
for:

C++:
return canSee(getPosition(), pos, 15, 9);


it didn't work for me,

I'm forgetting something?
 
Solution
First before i reply, wrong section this should go into support.

Secondly to reply you question check


C++:
bool Monster::canSee(const Position& pos) const
{
    return Creature::canSee(getPosition(), pos, 9, 9);
}

under monster.cpp
Post automatically merged:

also put this
C++:
return canSee(getPosition(), pos, 15, 9);
back to this
C++:
return canSee(getPosition(), pos, Map::maxViewportX, Map::maxViewportY);
First before i reply, wrong section this should go into support.

Secondly to reply you question check


C++:
bool Monster::canSee(const Position& pos) const
{
    return Creature::canSee(getPosition(), pos, 9, 9);
}

under monster.cpp
Post automatically merged:

also put this
C++:
return canSee(getPosition(), pos, 15, 9);
back to this
C++:
return canSee(getPosition(), pos, Map::maxViewportX, Map::maxViewportY);
 
Solution
First before i reply, wrong section this should go into support.

Secondly to reply you question check


C++:
bool Monster::canSee(const Position& pos) const
{
    return Creature::canSee(getPosition(), pos, 9, 9);
}

under monster.cpp
Post automatically merged:

also put this
C++:
return canSee(getPosition(), pos, 15, 9);
back to this
C++:
return canSee(getPosition(), pos, Map::maxViewportX, Map::maxViewportY);

Oh, my fault! ... i'm sorry


and i checked all these entries, but the problem remains
 
First before i reply, wrong section this should go into support.

Secondly to reply you question check


C++:
bool Monster::canSee(const Position& pos) const
{
    return Creature::canSee(getPosition(), pos, 9, 9);
}

under monster.cpp
Post automatically merged:

also put this
C++:
return canSee(getPosition(), pos, 15, 9);
back to this
C++:
return canSee(getPosition(), pos, Map::maxViewportX, Map::maxViewportY);

thanks man! after I understood how it works, I realized that the problem was exactly this
solved
 
Back
Top