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

/Ghost be seen by party

Swiftxd

Member
Joined
Apr 5, 2014
Messages
85
Reaction score
5
hello, have some way to who uses /ghost talkaction can be seen by party members too ?
i think its in player.cpp in this function: bool Player::canSeeCreature(const Creature* creature) const, but i failed to create. the closest i got is this :
Code:
bool Player::canSeeCreature(const Creature* creature) const
{
if(creature == this)
return true;
if(const Player* player = creature->getPlayer())
return !player->isGhost() || (getAccess() > 2 && getGhostAccess() >= player->getGhostAccess());
return !creature->isInvisible() || canSeeInvisibility();
if(party)
party->isPlayerMember(const Player*)
return !creature->isInvisible() || canSeeInvisibility();
}


if someone could help me ,i'll be glad
 
Last edited:
@whitevo no it isnt, its the client who sends if you see or not.
@mpa no it isnt too.

i know is in PLAYER.CPP in this funct: bool Player::canSeeCreature(const Creature* creature) const, but i really dont know how to do it :/
 
Hello OTLanders,

I think that to do this modfication you don't even need to change stuff on player.cpp:

Code:
bool Player::canSeeInvisibility() const
{
    return hasFlag(PlayerFlag_CanSenseInvisibility);

It's given as a Flag, so you can use a Flag calculator and write a Lua script on talkactions to give players on the same party to get this flag on players inside this party.
 
Is it not client thing?
if creature has condition, then you wont see it

Don't be silly, you should never let the client decide important things.

@topic
Code:
bool Player::canSeeCreature(const Creature* creature) const
{
   if(creature == this)
     return true;

   if(const Player* player = creature->getPlayer())
   {
     if(player->isGhost())
     {
       if(isPartner(player))
         return true;
       
       return ((getAccess() > 2) && (getGhostAccess() >= player->getGhostAccess()));
     }
     return true;
   }
   return !creature->isInvisible() || canSeeInvisibility();
}
 
@Jano thanks a lot dude, but have one problem, with this code, the party member only can be seen if uses ghost far from you, if uses next to you it will disapear , because of talkaction ghost, so i think needs change something in bool TalkAction::ghost(Creature* creature, const std::string&, const std::string&), can u help me ?
https://github.com/Swiftxd/player.cpp/blob/master/talkaction.cpp
 
@Jano thanks again. You're right
i've looking in
Code:
 void Game::internalCreatureChangeVisible(Creature* creature, Visible_t visible)

but idk what to do here :
Code:
    Player* tmpPlayer = NULL;
    for(it = list.begin(); it != list.end(); ++it)
    {
        if((tmpPlayer = (*it)->getPlayer()))
            tmpPlayer->sendCreatureChangeVisible(creature, visible);
    }
to say the true i do not understood what the code want to do :/
 
try

Code:
  Player* tmpPlayer = NULL;
   Player* playerCreature = creature->getPlayer();

   for(it = list.begin(); it != list.end(); ++it) {
     if((tmpPlayer = (*it)->getPlayer())) {
       if((visible == VISIBLE_GHOST_DISAPPEAR) && playerCreature && playerCreature->isPartner(tmpPlayer))
         continue;

       tmpPlayer->sendCreatureChangeVisible(creature, visible);
     }
   }
 
Actually it worked, but if have more than 2 in a party it happens:
new.png
 
if youre in a party with 2 or more players, and use the ghost, they will see you, but you left a copy behind, like in the picture 1.
 
ok getting a bit bored of this game, can you post full game.cpp, player.cpp, player.h and talkaction.cpp, upload it to your git if you want
 
Back
Top