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

Server log shows how much other player hits (remove)

Lopaskurwa

Active Member
Joined
Oct 6, 2017
Messages
873
Solutions
2
Reaction score
49
Hi, by default tfs 1.2 have this function if you stand to next player you can see his dmg in server-log which makes no sense because it should only show yours not someone else who stands next to you and deals so dmg to monster. Im not talking about when he hits you.
 
Look like kinda harsh move, but w/e. I got
1>..\src\game.cpp(3923): error C2065: 'damageString': undeclared identifier
1>..\src\game.cpp(3927): error C2065: 'damageString': undeclared identifier
1>..\src\game.cpp(3929): error C2065: 'damageString': undeclared identifier
1>..\src\game.cpp(3931): error C2065: 'damageString': undeclared identifier
1>..\src\game.cpp(3936): error C2065: 'spectatorMessage': undeclared identifier
1>..\src\game.cpp(3943): error C2059: syntax error: 'return'
1>..\src\game.cpp(3944): error C2059: syntax error: '}'
1>..\src\game.cpp(3944): error C2143: syntax error: missing ';' before '}'
1>..\src\game.cpp(3947): error C2143: syntax error: missing ';' before '{'
1>..\src\game.cpp(3947): error C2447: '{': missing function header (old-style formal list?)

Whoops, too many lines to delete.

Try one more time:

C++:
            if (attacker) {
                spectatorMessage += " due to ";
                if (attacker == target) {
                    spectatorMessage += (targetPlayer ? (targetPlayer->getSex() == PLAYERSEX_FEMALE ? "her own attack" : "his own attack") : "its own attack");
                } else {
                    spectatorMessage += "an attack by " + attacker->getNameDescription();
                }
            }
            spectatorMessage += '.';
 
Whoops, too many lines to delete.

Try one more time:

C++:
            if (attacker) {
                spectatorMessage += " due to ";
                if (attacker == target) {
                    spectatorMessage += (targetPlayer ? (targetPlayer->getSex() == PLAYERSEX_FEMALE ? "her own attack" : "his own attack") : "its own attack");
                } else {
                    spectatorMessage += "an attack by " + attacker->getNameDescription();
                }
            }
            spectatorMessage += '.';
So now spectator sees only A Bag loses 5 hitpoints
so it still sends a message.
 
i think if u disable in console, u disable damage that u got too

3zHYY3f.jpg


Is there a reason why this player choice is not good enough? It has been around for quite a while (I think since 10.x in general?).
If you really need to remove it completely then you will need to search for any use of MESSAGE_DAMAGE_OTHERS, MESSAGE_HEALED_OTHERS, and MESSAGE_EXPERIENCE_OTHERS
 
3zHYY3f.jpg


Is there a reason why this player choice is not good enough? It has been around for quite a while (I think since 10.x in general?).
If you really need to remove it completely then you will need to search for any use of MESSAGE_DAMAGE_OTHERS, MESSAGE_HEALED_OTHERS, and MESSAGE_EXPERIENCE_OTHERS
So it will delete when you fight 1x1 player message to, its not what i need.
 
I guess you need to start editing those things by yourself. Almost every compilation error gives you all the information you need to solve it. Try editing the text messages and when you see the difference then you will start to understand. Also what you trying to do is really simple, all that text is just in one place.
 
I guess you need to start editing those things by yourself. Almost every compilation error gives you all the information you need to solve it. Try editing the text messages and when you see the difference then you will start to understand. Also what you trying to do is really simple, all that text is just in one place.
If people with decent knowledge cant solve it, how can i solve it with my own knowledge? It makes no sense isn't it?
 
If people with decent knowledge cant solve it, how can i solve it with my own knowledge? It makes no sense isn't it?
Well, it is not like everyone knows everything, but you should start with something, almost all your threads you looking for help but there is no progress with yourself. I think you should start there. You are trying to build a wall with no bricks and you dont want to learn how to do bricks.
I also had a tough start just to let you know.

btw. this is where it happens

C++:
for (Creature* spectator : spectators) {
                    Player* tmpPlayer = spectator->getPlayer();
                    if (tmpPlayer->getPosition().z != targetPos.z) {
                        continue;
                    }

                    if (tmpPlayer == attackerPlayer && attackerPlayer != targetPlayer) {
                        ss.str({});
                        ss << ucfirst(target->getNameDescription()) << " loses " << damageString + " mana due to your attack.";
                        message.type = MESSAGE_DAMAGE_DEALT;
                        message.text = ss.str();
                    } else if (tmpPlayer == targetPlayer) {
                        ss.str({});
                        ss << "You lose " << damageString << " mana";
                        if (!attacker) {
                            ss << '.';
                        } else if (targetPlayer == attackerPlayer) {
                            ss << " due to your own attack.";
                        } else {
                            ss << " due to an attack by " << attacker->getNameDescription() << '.';
                        }
                        message.type = MESSAGE_DAMAGE_RECEIVED;
                        message.text = ss.str();
                    } else {
                        if (spectatorMessage.empty()) {
                            ss.str({});
                            ss << ucfirst(target->getNameDescription()) << " loses " << damageString + " mana";
                            if (attacker) {
                                ss << " due to ";
                                if (attacker == target) {
                                    ss << (targetPlayer->getSex() == PLAYERSEX_FEMALE ? "her own attack" : "his own attack");
                                } else {
                                    ss << "an attack by " << attacker->getNameDescription();
                                }
                            }
                            ss << '.';
                            spectatorMessage = ss.str();
                        }
                        message.type = MESSAGE_DAMAGE_OTHERS;
                        message.text = spectatorMessage;
                    }

also with mana stuff for sure. maybe you should remove the spectators check and just send the message to the damage dealer and the target.
 
Last edited:
Well, it is not like everyone knows everything, but you should start with something, almost all your threads you looking for help but there is no progress with yourself. I think you should start there. You are trying to build a wall with no bricks and you dont want to learn how to do bricks.
I also had a tough start just to let you know.

btw. this is where it happens

C++:
for (Creature* spectator : spectators) {
                    Player* tmpPlayer = spectator->getPlayer();
                    if (tmpPlayer->getPosition().z != targetPos.z) {
                        continue;
                    }

                    if (tmpPlayer == attackerPlayer && attackerPlayer != targetPlayer) {
                        ss.str({});
                        ss << ucfirst(target->getNameDescription()) << " loses " << damageString + " mana due to your attack.";
                        message.type = MESSAGE_DAMAGE_DEALT;
                        message.text = ss.str();
                    } else if (tmpPlayer == targetPlayer) {
                        ss.str({});
                        ss << "You lose " << damageString << " mana";
                        if (!attacker) {
                            ss << '.';
                        } else if (targetPlayer == attackerPlayer) {
                            ss << " due to your own attack.";
                        } else {
                            ss << " due to an attack by " << attacker->getNameDescription() << '.';
                        }
                        message.type = MESSAGE_DAMAGE_RECEIVED;
                        message.text = ss.str();
                    } else {
                        if (spectatorMessage.empty()) {
                            ss.str({});
                            ss << ucfirst(target->getNameDescription()) << " loses " << damageString + " mana";
                            if (attacker) {
                                ss << " due to ";
                                if (attacker == target) {
                                    ss << (targetPlayer->getSex() == PLAYERSEX_FEMALE ? "her own attack" : "his own attack");
                                } else {
                                    ss << "an attack by " << attacker->getNameDescription();
                                }
                            }
                            ss << '.';
                            spectatorMessage = ss.str();
                        }
                        message.type = MESSAGE_DAMAGE_OTHERS;
                        message.text = spectatorMessage;
                    }

also with mana stuff for sure. maybe you should remove the spectators check and just send the message to the damage dealer and the target.
You cant say that im not learning because i never ask for same questions, if i create new thread it becomes completely different type of question it becomes progressive. From not knowing how to add items i went to c++ questions, i dont know about you but i find it kinda progressive. In this given code its all about mana and not physical damage
 
You cant say that im not learning because i never ask for same questions, if i create new thread it becomes completely different type of question it becomes progressive. From not knowing how to add items i went to c++ questions, i dont know about you but i find it kinda progressive. In this given code its all about mana and not physical damage
If you dont know, there is the same method for damage and mana, just the word is changed.
 
lmao, its ok. sorry.
also, thats actually what I pointed :p
How is that what you pointed when all your links shows about mana and heal when its not even similar to what im talking about or im just stupid and source can change words from "was healed" to "loses 'dmgvalue' due to an attack by 'playername' like some kind human brain having AI
 
How is that what you pointed when all your links shows about mana and heal when its not even similar to what im talking about or im just stupid and source can change words from "was healed" to "loses 'dmgvalue' due to an attack by 'playername' like some kind human brain having AI
bump
 
C++:
tmpPlayer->sendTextMessage(message);
to
C++:
if (message.text != spectatorMessage)
    tmpPlayer->sendTextMessage(message);
in:

It should work but it's a pretty ugly solution. If you want to get this right you shouldn't even create the spectatorMessage if you aren't going to use it and also move the "sendTextMessage" function inside the if statements that you interested in being displayed in the server log.

This worked for me, removed the spectatorMessage, player vs player still normally, now it just show when player get experience.
 
Back
Top