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

Range of Creatures;

IgoR lYCAN

New Member
Joined
Dec 1, 2018
Messages
169
Reaction score
4
Im trying to make the Range from Players and monsters get higher than 10 sqms.
( if a monster runs from the player, the max range of it, is 10 sqms ). (so the monster get stuck in the air, only moving, when the players join the screen again).
I would like to make it 24~26 sqms.


1579665839207.png


Where should I take a look at?
 
Solution
In map.h you have this:
C++:
static const int32_t maxViewportX = 11; //min value: maxClientViewportX + 1
static const int32_t maxViewportY = 11; //min value: maxClientViewportY + 1

Which is used to determine if creatures try to move, among other things.
creature.cpp
C++:
bool Creature::canSee(const Position& pos) const
{
    return canSee(getPosition(), pos, Map::maxViewportX, Map::maxViewportY);
}

Changing those values should give you what you want.
thanks for providing as much information as needed 😁
 
Post what server version and what client version you are using so users can help you accordingly. Read the board rules if you're unsure about what to include when asking for help.

For this particular issue, this thread might be of help to you:
 
In map.h you have this:
C++:
static const int32_t maxViewportX = 11; //min value: maxClientViewportX + 1
static const int32_t maxViewportY = 11; //min value: maxClientViewportY + 1

Which is used to determine if creatures try to move, among other things.
creature.cpp
C++:
bool Creature::canSee(const Position& pos) const
{
    return canSee(getPosition(), pos, Map::maxViewportX, Map::maxViewportY);
}

Changing those values should give you what you want.
 
Solution
In map.h you have this:
C++:
static const int32_t maxViewportX = 11; //min value: maxClientViewportX + 1
static const int32_t maxViewportY = 11; //min value: maxClientViewportY + 1

Which is used to determine if creatures try to move, among other things.
creature.cpp
C++:
bool Creature::canSee(const Position& pos) const
{
    return canSee(getPosition(), pos, Map::maxViewportX, Map::maxViewportY);
}

Changing those values should give you what you want.


Changed the formula of map.h to 21, instead of 11, but doenst work.
C++:
    public:
        static constexpr int32_t maxViewportX = 21; //min value: maxClientViewportX + 1
        static constexpr int32_t maxViewportY = 21; //min value: maxClientViewportY + 1
        static constexpr int32_t maxClientViewportX = 8;
        static constexpr int32_t maxClientViewportY = 6;


1579786252981.png
 
C++:
bool Monster::canSee(const Position& pos) const
{
    return Creature::canSee(getPosition(), pos, 10, 10);
}

That's a function on monsters.cpp that can help you out, just raise the number there and the monsters will be able to see more tiles.

About players, you can use OTC/OTCV8 with the extendedMapView to add more tiles to the screen
 
C++:
bool Monster::canSee(const Position& pos) const
{
    return Creature::canSee(getPosition(), pos, 10, 10);
}

That's a function on monsters.cpp that can help you out, just raise the number there and the monsters will be able to see more tiles.

About players, you can use OTC/OTCV8 with the extendedMapView to add more tiles to the screen

When I put any number, for example: 21 ,21 the monsters they stop walking. Will make a small video showing it.
Post automatically merged:

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

That's a function on monsters.cpp that can help you out, just raise the number there and the monsters will be able to see more tiles.

About players, you can use OTC/OTCV8 with the extendedMapView to add more tiles to the screen
Actually, After made this change, with the changes of Leo, worked fine =)

thanks guys.
 
Last edited:
Back
Top