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

[TFS 1.3] [8.6] Not working Skull and PZ System

ivvanek

New Member
Joined
Mar 24, 2009
Messages
113
Reaction score
3
Players can attack you without skull and go inside depo because they dont have pz.

Config.lua
Code:
worldType = "pvp"
hotkeyAimbotEnabled = true
protectionLevel = 1
killsToRedSkull = 3
killsToBlackSkull = 6
pzLocked = 60000
removeChargesFromRunes = true
removeChargesFromPotions = true
removeWeaponAmmunition = true
removeWeaponCharges = true
timeToDecreaseFrags = 24 * 60 * 60 * 1000
whiteSkullTime = 15 * 60 * 1000
stairJumpExhaustion = 2000
experienceByKillingPlayers = false
expFromPlayersLevelRange = 75

How i can fix this ?
 
Solution
In source root folder

add_compile_options(-Wall -Werror -pipe -fvisibility=hidden)

Drop -Werror from that line. in CMakeLists

Trash current build folder. (presuming you don't keep your dataset in there. cuz that would be all sorts of bad idea)
cd build && rm -rfv ./*
Build again
cmake ../
Players can attack you without skull and go inside depo because they dont have pz.

Config.lua
Code:
worldType = "pvp"
hotkeyAimbotEnabled = true
protectionLevel = 1
killsToRedSkull = 3
killsToBlackSkull = 6
pzLocked = 60000
removeChargesFromRunes = true
removeChargesFromPotions = true
removeWeaponAmmunition = true
removeWeaponCharges = true
timeToDecreaseFrags = 24 * 60 * 60 * 1000
whiteSkullTime = 15 * 60 * 1000
stairJumpExhaustion = 2000
experienceByKillingPlayers = false
expFromPlayersLevelRange = 75

How i can fix this ?
try
Code:
worldType = "open"
 
Guys, it is TFS 1.3 and when changing to "open" or "open-pvp" server won't startup.

Code:
-- Combat settings
-- NOTE: valid values for worldType are: "pvp", "no-pvp" and "pvp-enforced"
worldType = "pvp"
hotkeyAimbotEnabled = true
protectionLevel = 1
killsToRedSkull = 3
killsToBlackSkull = 6
pzLocked = 60000
removeChargesFromRunes = true
removeChargesFromPotions = true
removeWeaponAmmunition = true
removeWeaponCharges = true
timeToDecreaseFrags = 24 * 60 * 60 * 1000
whiteSkullTime = 15 * 60 * 1000
stairJumpExhaustion = 2000
experienceByKillingPlayers = false
expFromPlayersLevelRange = 75

Code:
> ERROR: > ERROR: Unknown world type: open, valid world types are: pvp, no-pvp and pvp-enforced.
>> No services running. The server is NOT online.
 
Then change it back to "pvp" and back to your original problem.

Do you have any C++ source mods or Lua scripts that modify onCombat onAttack ?
 
Then change it back to "pvp" and back to your original problem.

Do you have any C++ source mods or Lua scripts that modify onCombat onAttack ?
Yes, i am using TFS 1.3 for 8.6 downgraded
nekiro/forgottenserver (https://github.com/nekiro/forgottenserver/tree/8.6-downgrade)

I have real map + NPCs + scripts from other datapacks, everything is working well, just Skull and PZ not working... Everything was working well but some my changes must destroy Combat system. I am looking for a solution where to find the problem.
I can put my codes here but tell me which one :)
 
This is why people should use git. You can take snapshots before changes that way, and create a change history and show diffs between versions. Git does not have to be just for programmers.

There are two ways you can solve this.

1.)
| a.) Rebuild the server. Start with source dataset from Nekiro. Test.
| b.) If working add another thing you added before. Test again.
| c.) Repeat step b until you find thing you added that broke stuff.

2.) (presuming Linux install)
| a.) install "spot" OR know RegEx and use plain grep
| b.) search your sources and lua scripts to find anything that touched how combat / PVP works.

Basically, something you've done is effecting if attacking is considered hostile or that the tile the player is on is a forced pvp zone.

Does it happen with all players?
All weapons? Or certain ones? How about no weapon using fists?
All spells?
 
This is why people should use git. You can take snapshots before changes that way, and create a change history and show diffs between versions. Git does not have to be just for programmers.

There are two ways you can solve this.

1.)
| a.) Rebuild the server. Start with source dataset from Nekiro. Test.
| b.) If working add another thing you added before. Test again.
| c.) Repeat step b until you find thing you added that broke stuff.

2.) (presuming Linux install)
| a.) install "spot" OR know RegEx and use plain grep
| b.) search your sources and lua scripts to find anything that touched how combat / PVP works.

Basically, something you've done is effecting if attacking is considered hostile or that the tile the player is on is a forced pvp zone.

Does it happen with all players?
All weapons? Or certain ones? How about no weapon using fists?
All spells?
All spells and runes i can use without skull.
Something is broken but console didnt tell me anything... any error.
It is disabled maybe in lua files? you know maybe on which one?
 
specifically, what creaturescripts did you change?
Code:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
    <event type="login" name="PlayerLogin" script="login.lua" />
    <event type="logout" name="PlayerLogout" script="logout.lua" />
    <event type="login" name="FirstItems" script="firstitems.lua" />
<!--    <event type="login" name="OfflineTraining" script="offlinetraining.lua" /> -->
    <event type="login" name="RegenerateStamina" script="regeneratestamina.lua" />
    <event type="death" name="PlayerDeath" script="playerdeath.lua" />
    <event type="death" name="DropLoot" script="droploot.lua" />
    <event type="extendedopcode" name="ExtendedOpcode" script="extendedopcode.lua" />
</creaturescripts>
 
that's just your creaturescript index. not an answer.

which lua files did you change?
My last change was in these files but i dont know if this files respond to skull system
npc/lib/npcsystem/modules.lua
npc/lib/npcsystem/npchandler.lua
npc/lib/npcsystem/npcsystem.lua

I am looking for files which respond to skull system and battle, because it is PZ issue too, i can go to pz without battle.
 
Did you check if that happens on clean files from repository? It might be downgrade issue.
 
Did you check if that happens on clean files from repository? It might be downgrade issue.
I have dowloaded your clean repo from github like 2 weeks ago and it is work perfectly. Yesterday i saw update on your github and downloaded source again because i think maybe it will fix my problem but i have errors with compiling and i cannot check this update :)
Code:
/home/debian/tfs13/src/combat.cpp: In static member function ‘static void Combat::doAreaCombat(Creature*, const Position&, const AreaCombat*, CombatDamage&, const CombatParams&)’:
/home/debian/tfs13/src/combat.cpp:851:11: error: variable ‘playerCombatReduced’ set but not used [-Werror=unused-but-set-variable]
      bool playerCombatReduced = false;
           ^~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
CMakeFiles/tfs.dir/build.make:226: recipe for target 'CMakeFiles/tfs.dir/combat.cpp.o' failed
make[2]: *** [CMakeFiles/tfs.dir/combat.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/tfs.dir/all' failed
make[1]: *** [CMakeFiles/tfs.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Anyway i am looking for another way to find the problem and maybe fix this. Which LUA files are related with combat or skull & pz system?
 
Last edited:
👉 cc1plus: all warnings being treated as errors
👉 -Werror=unused-but-set-variable


Expecting perfect code out of a protocol backport fork is too much to ask. Turn off all -Werror and/or -Wall
 
Back
Top