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

Outfits order in stack aren't right in Othire 1.0

Terotrificy

Veteran OT User
Joined
Oct 18, 2020
Messages
401
Solutions
13
Reaction score
254
Location
Santiago, Chile.
Hi, i have a problem with the outfit orders in Othire 1.0

When i use normal tibia client 7.72, when a player enter a stack in a ladder, rope hole, etc, the outfit of the last player to enter the stack goes to the bottom, instead of the top of the stack.

Is there any way to fix it from server sources? I managed to fix it from client side (otclient) as shown here: TFS 1.X+ - Creature is being drawn on top, even tho its not (https://otland.net/threads/creature-is-being-drawn-on-top-even-tho-its-not.270510/), but i don't think i will be able to fix it in tibia client.
 
Solution
The only thing i'm not sure about, is the "seeing and pushing" thing. I should be able to push and see the last person who entered in the stack right? (ie, if person a, b and c goes down a ladder, in that order, i should see and push the person c, then person b and at the last, person a right?)
Yes, you're pushing, seeing (by 'look' function) and using runes (uhtrap) on the last one who entered. That's why it's called a stack ("last in, first out" structure). But visually in the client it's reversed and the outfit of the first guy is drawn on top.
In your example you'll push 'c', 'b', 'a'; 'c' is also uhtrapping the other two. But the client draws 'a' on top (outfit, health bar and nick), then 'b' and 'a' on the bottom.
That is...
Hi, i have a problem with the outfit orders in Othire 1.0

When i use normal tibia client 7.72, when a player enter a stack in a ladder, rope hole, etc, the outfit of the last player to enter the stack goes to the bottom, instead of the top of the stack.

That is correct. For pushing, looking, using runes on etc. it worked like a stack (last in, first out), so when a new character was added it technically went to the top. But visually (on the client's side) the order was reversed and the first character was drawn on top. You can check it on any old recordings from real tibia.
So your stack is visually accurate, the only question is whether the order for actions is right.
 
That is correct. For pushing, looking, using runes on etc. it worked like a stack (last in, first out), so when a new character was added it technically went to the top. But visually (on the client's side) the order was reversed and the first character was drawn on top. You can check it on any old recordings from real tibia.
So your stack is visually accurate, the only question is whether the order for actions is right.
Thank you for always helping me with that. You're totally right about the outfit order (just checked it in this video
). The only thing i'm not sure about, is the "seeing and pushing" thing. I should be able to push and see the last person who entered in the stack right? (ie, if person a, b and c goes down a ladder, in that order, i should see and push the person c, then person b and at the last, person a right?)
 
The only thing i'm not sure about, is the "seeing and pushing" thing. I should be able to push and see the last person who entered in the stack right? (ie, if person a, b and c goes down a ladder, in that order, i should see and push the person c, then person b and at the last, person a right?)
Yes, you're pushing, seeing (by 'look' function) and using runes (uhtrap) on the last one who entered. That's why it's called a stack ("last in, first out" structure). But visually in the client it's reversed and the outfit of the first guy is drawn on top.
In your example you'll push 'c', 'b', 'a'; 'c' is also uhtrapping the other two. But the client draws 'a' on top (outfit, health bar and nick), then 'b' and 'a' on the bottom.
That is for the original client atleast, in otc it's different from what I've seen.
 
Last edited:
Solution
Yes, you're pushing, seeing (by 'look' function) and using runes (uhtrap) on the last one who entered. That's why it's called a stack ("last in, first out" structure). But visually in the client it's reversed and the outfit of the first guy is drawn on top.
In your example you'll push 'c', 'b', 'a'; 'c' is also uhtrapping the other two. But the client draws 'a' on top (outfit, health bar and nick), then 'b' and 'a' on the bottom.
That is for the original client atleast, in otc it's different from what I've seen.
Thank you! Yeah, indeed in otclient i managed to reverse the outfit stack thinking it was wrong, but it was working alright. Anyway, the othire actions in stack were working in reverse order than the original, so i reversed the iterators of "see" and "push" functions to make it work properly. Thank you very much buddy!

For anyone wondering how to manage the correct order in Othire:

In tile.ccp, you need to modify "begin()" to "rbegin()" and "end()" to "rend()", depending on what you want to show first.

Here are the lines for anyone who is interested: (also see Otclient runes target behaviour in stack (uh trap) (https://otland.net/threads/otclient-runes-target-behaviour-in-stack-uh-trap.274392/)), i was wrong in that thread at the end tho, it's working as expected (for the runes shoot in the stack, it's supposed to hit everyone on the stack except you).

For runes to hit the first creature/player in the stack:


Lua:
Creature* Tile::getTopCreature()
{
    if(CreatureVector* creatures = getCreatures()){
        if(!creatures->empty()){
            return *creatures->rbegin(); // Here you can reverse the stack order for runes cast spells
        }
    }

    return NULL;
}

For the "see" function in game:


Code:
Thing* Tile::getTopVisibleThing(const Creature* creature, bool checkVisibility/*=true*/)
{
    if(const CreatureVector* creatures = getCreatures()){
        for(CreatureVector::const_reverse_iterator cit = creatures->rbegin(); cit != creatures->rend(); ++cit){ // Here you control the order stack of  "see" function in game.
            if((*cit)->canBeSeen(creature, checkVisibility)){
                return (*cit);
            }
        }
    }

For the "push" function in game:


Code:
Creature* Tile::getTopVisibleCreature(const Creature* creature, bool checkVisibility/*=true*/)
{
    if(CreatureVector* creatures = getCreatures()){
        for(CreatureVector::const_reverse_iterator cit = creatures->rbegin(); cit != creatures->rend(); ++cit){ // Here you control the order stack of "push or move player" function in game.
            if ((*cit)->canBeSeen(creature, checkVisibility)){
                return (*cit);
            }
        }
    }

    return NULL;
}

And to change the "view" order of the outfits in the stack from the client side, you must edit the tile.cpp of the otclient, and change:


Lua:
        for(auto it = m_things.begin(); it != m_things.end(); ++it) { // Here you change the creature order in stack (outfits)
            const ThingPtr& thing = *it;
            if(!thing->isCreature())
                continue;
            CreaturePtr creature = thing->static_self_cast<Creature>();
            if(creature && (!creature->isWalking() || !animate))
                creature->draw(dest - m_drawElevation*scaleFactor, scaleFactor, animate, lightView);
        }
    }
 
Last edited:
And to change the "view" order of the outfits in the stack from the client side, you must edit the tile.cpp of the otclient, and change:


Lua:
        for(auto it = m_things.begin(); it != m_things.end(); ++it) { // Here you change the creature order in stack (outfits)
            const ThingPtr& thing = *it;
            if(!thing->isCreature())
                continue;
            CreaturePtr creature = thing->static_self_cast<Creature>();
            if(creature && (!creature->isWalking() || !animate))
                creature->draw(dest - m_drawElevation*scaleFactor, scaleFactor, animate, lightView);
        }
    }
Where exactly?
 
I did it back then on Edubart's otclient, inside of:
C++:
void Tile::draw(const Point& dest, float scaleFactor, int drawFlags, LightView *lightView)

Depending on the order of the stack you want, you can leave it as above:

C++:
for(auto it = m_things.begin(); it != m_things.end(); ++it) { // Here you change the creature order in stack (outfits)
            const ThingPtr& thing = *it;
            if(!thing->isCreature())
                continue;
            CreaturePtr creature = thing->static_self_cast<Creature>();
            if(creature && (!creature->isWalking() || !animate))
                creature->draw(dest - m_drawElevation*scaleFactor, scaleFactor, animate, lightView);
        }
    }
or all the other way:

C++:
        for(auto it = m_things.rbegin(); it != m_things.rend(); ++it) { // player outfit display priority in stack, "begin and end" for normal order, "rbegin and rend" for inverse order.
            const ThingPtr& thing = *it;
            if(!thing->isCreature())
                continue;
            CreaturePtr creature = thing->static_self_cast<Creature>();
            if(creature && (!creature->isWalking() || !animate))
                creature->draw(dest - m_drawElevation*scaleFactor, scaleFactor, animate, lightView);
        }
    }
It's around line 145.
 
Back
Top