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

Compiling Compile Errors

flaviiojr

Active Member
Joined
Jan 20, 2017
Messages
230
Solutions
13
Reaction score
39
Shows these errors in distro tfs 1.2, saying that it is not declared, I tried to solve it, but I still have the same problem.

1>..\src\tile.cpp(539): error C2039: 'Harmful': is not a member of 'MagicField'
1> c:\users\flavio buarque\desktop\otxserver-testing-master\src\combat.h(329): note: see declaration of 'MagicField'
1>..\src\tile.cpp(544): error C2039: 'IgnoreFields': is not a member of 'Monster'
1> c:\users\flavio buarque\desktop\otxserver-testing-master\src\monster.h(40): note: see declaration of 'Monster'
1>..\src\tile.cpp(545): error C2039: 'hasAttacked': is not a member of 'Monster'
1> c:\users\flavio buarque\desktop\otxserver-testing-master\src\monster.h(40): note: see declaration of 'Monster'

These functions were taken from distro tfs 1.0, how to update these functions?
Thank you, I appreciate all the help.

Lines where errors are located:
C++:
            MagicField* field = getFieldItem();
            if (field && !field->isBlocking() && field->IsHarmful()) {
                CombatType_t combatType = field->getCombatType();

                //There is 3 options for a monster to enter a magic field
                //1) Monster is immune
                    if (!monster->isImmune(combatType) && !monster->canIgnoreField() &&
                            !monster->canWalkthrough(combatType) && !monster->IsAttacked() && !monster->isSummon()) {

BUMP

BUMP

BUMP
 
Last edited by a moderator:
Not sure if you got other modifications you don't wanna share, but the code you need to change to is this;
forgottenserver/tile.cpp at 6c6c25c00fbe1c957cd5493e058bd107ce8be19a · otland/forgottenserver · GitHub

No ide why it was removed, but you can find (I guess) the function here; forgottenserver/combat.cpp at cc8e15e9166359faa52d38823e679355a615ab23 · otland/forgottenserver · GitHub
No, the code is the one used in this post...
Monsters walking around fields behaviour.

In the topic, user gunz said that with these codes he was able to implement the monsters system not to cross the field ...
I wanted to convert it or modify it to work in TFS 1.2
thanks @WibbenZ
 
No, the code is the one used in this post...
Monsters walking around fields behaviour.

In the topic, user gunz said that with these codes he was able to implement the monsters system not to cross the field ...
I wanted to convert it or modify it to work in TFS 1.2
thanks @WibbenZ

Can't find it in the 1.0 files either, so he must have added it himself.
This is from when the files got uploaded to github; forgottenserver/tile.cpp at deff1b8b227d80588e7fa0a40c6f05824412fbb2 · otland/forgottenserver · GitHub

Maybe @gunz can check his source and see if he still has it.
 
But the creatures pass over the fields, even without being attacked ....
Do you have any way to fix this?
@WibbenZ

No I havn't looked into it, but you need to do more than the code that he posted if you want it like RL.
Ex if you got a grim reaper next to you and you stand in an energy bomb, it won't pass it - till it disappears or till you attack the monster.
If you only check the first part, if it's an energy bomb you can stand in an energy bomb and kill it without it runing towards you.
 
The monsters will only walk across their fields if they are immune to the dmg type. You can look through sources where move events are handled and look for where the code is checking if the monster is immune to the field and make it return false, nil or -1 instead of true.

For TFS 1.2

Edit: tile.cpp

Change
Code:
if (!monster->isImmune(combatType)) {
                    //1) Monster is "strong" enough to handle the damage
                    //2) Monster is already afflicated by this type of condition
                    if (hasBitSet(FLAG_IGNOREFIELDDAMAGE, flags)) {
                        if (!(monster->canPushItems() || monster->hasCondition(Combat::DamageToConditionType(combatType)))) {
                            return RETURNVALUE_NOTPOSSIBLE;
                        }
                    } else {
                        return RETURNVALUE_NOTPOSSIBLE;
                    }
                }

to
Code:
if (!monster->isImmune(combatType)) {
                    //1) Monster is "strong" enough to handle the damage
                    //2) Monster is already afflicated by this type of condition
                    if (hasBitSet(FLAG_IGNOREFIELDDAMAGE, flags)) {
                        if (!(monster->canPushItems() || monster->hasCondition(Combat::DamageToConditionType(combatType)))) {
                            return RETURNVALUE_NOTPOSSIBLE;
                        }
                    } else {
                        return RETURNVALUE_NOTPOSSIBLE;
                    }
                    return RETURNVALUE_NOTPOSSIBLE
                } else {
                    return RETURNVALUE_NOTPOSSIBLE
                }
 
Last edited by a moderator:
Back
Top