• 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.4.2 NPC error

Djivar

AKA Wickedviruz
Joined
Sep 28, 2009
Messages
1,641
Reaction score
19
Location
Sweden,edsbyn
Hi i am having a problem with NPC shoppers on TFS1.4.2..

Everytime i go up to an NPC and when we say trade. the server gets spammed with this error:
Skärmbild 2023-12-05 230803.png
But even if i get all these errors, it still opens the trade window and you can buy/sell without a problem.. and i can not seem to find the problem.

This is my fans.lua code:
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)            npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)        npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)        npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()                npcHandler:onThink()                    end

npcHandler:addModule(FocusModule:new())

This is the Eryn npc that is using frans.lua script.
XML:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Eryn" script="Frans.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100" />
    <look typeex="2229" head="113" body="113" legs="113" feet="115" addons="0" />
    <parameters>
        <parameter key="message_greet" value="Beeee Greeeeted |PLAYERNAME|. What is your neeeed?" />
        <parameter key="message_farewell" value="Bye." />
        <parameter key="module_keywords" value="1" />
        <parameter key="keywords" value="job;" />
        <parameter key="keyword_reply1" value="I am selliiiing ruuuunes, wands, roooods and spellbooooooks." />
        <parameter key="module_shop" value="1" />
        <parameter key="shop_buyable" value="avalanche rune,2274,45;
Stone Shower Rune,2288,37;
Thunderstorm Rune,2315,37;
blank rune,2260,10;
chameleon rune,2291,210;
convince creature rune,2290,80;
cure poison rune,2266,65;
destroy field rune,2261,15;
energy field rune,2277,38;
energy wall rune,2279,85;
explosion rune,2313,31;
fire bomb rune,2305,117;
fire field rune,2301,28;
fire wall rune,2303,61;
great fireball rune,2304,45;
great health potion,7591,190;
great mana potion,7590,120;
great spirit potion,8472,190;
health potion,7618,45;
heavy magic missile rune,2311,12;
intense healing rune,2265,95;
light magic missile rune,2287,4;
mana potion,7620,50;
poison field rune,2285,21;
poison wall rune,2289,52;
spellbook,2175,150;
stalagmite rune,2292,12;
strong health potion,7588,100;
strong mana potion,7589,80;
sudden death rune,2268,108;
ultimate healing rune,2273,175;
ultimate health potion,8473,310;
wand of cosmic energy,2189,10000;
terra rod,2181,10000;
wand of decay,2188,5000;
wand of dragonbreath,2191,1000;
wand of vortex,2190,500;
Underworld Rod,8910,22000;
Wand of Starstorm,8920,18000;
necrotic rod,2185,5000;
snakebite rod,2182,500;
Wand of Voodoo,8922,22000;
Wild Growth Rune,2269,160;
Hailstorm Rod,2183,15000;
Magic Wall Rune,2293,116;
Paralyze Rune,2278,700;
Wand of Inferno,2187,15000" />
    </parameters>
</npc>

If i have missed something, or you need more information please comment and i will do my best to respond as soon as possible! :)
 
Yes altho as soon as i try to compile the sourfiles from github 1.4.2 i get these errors:


Code:
Severity    Code    Description    Project    File    Line    Suppression State    Details
Error    C2079    '_' uses undefined struct 'fmt::v10::detail::type_is_unformattable_for<T,char>'
        with
        [
            T=MarketOfferState_t
        ]    theforgottenserver    C:\vcpkg\installed\x64-windows\include\fmt\core.h    1576       
Error    C2338    static_assert failed: 'Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt'    theforgottenserver    C:\vcpkg\installed\x64-windows\include\fmt\core.h    1580       
Error    C2079    '_' uses undefined struct 'fmt::v10::detail::type_is_unformattable_for<T,char>'
        with
        [
            T=MarketAction_t
        ]    theforgottenserver    C:\vcpkg\installed\x64-windows\include\fmt\core.h    1576       
Error    C2338    static_assert failed: 'Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt'    theforgottenserver    C:\vcpkg\installed\x64-windows\include\fmt\core.h    1580       
Error    C2079    '_' uses undefined struct 'fmt::v10::detail::type_is_unformattable_for<T,char>'
        with
        [
            T=AccessList_t
        ]    theforgottenserver    C:\vcpkg\installed\x64-windows\include\fmt\core.h    1576

I have tried to compile the latest distro and that works just fine!
altho maby thats the way to go? but i have a 10.98 client as of now.. :p and i would like to keep the server as is just fix the problem


Maby its better to upgrade but i assume there would be alot of work?
 
src/enums.h:
find:
C++:
uint32_t buyPrice = 0;
uint32_t sellPrice = 0;
change to:
C++:
int64_t buyPrice = 0;
int64_t sellPrice = 0;

find:
C++:
ShopInfo(uint16_t itemId, int32_t subType = 0, uint32_t buyPrice = 0, uint32_t sellPrice = 0, std::string realName = "")
change to:
C++:
ShopInfo(uint16_t itemId, int32_t subType = 0, int64_t buyPrice = 0, int64_t sellPrice = 0, std::string realName = "")

src/npc.cpp:
find:
C++:
item.buyPrice = getField<uint32_t>(L, tableIndex, "buy");
item.sellPrice = getField<uint32_t>(L, tableIndex, "sell");
change to:
C++:
item.buyPrice = getField<int64_t>(L, tableIndex, "buy");
item.sellPrice = getField<int64_t>(L, tableIndex, "sell");
find:
C++:
item.buyPrice = getField<uint32_t>(L, tableIndex, "buy");
item.sellPrice = getField<uint32_t>(L, tableIndex, "sell");
change to:
C++:
item.buyPrice = getField<int64_t>(L, tableIndex, "buy");
item.sellPrice = getField<int64_t>(L, tableIndex, "sell");

Yes, twice on npc.cpp.

You should be good with these changes.
 
Yes, BUT if i download the soursfiles for 1.4.2 ( not the master ) and try to complie them even without any changes i get the error i wrote in my last post. IF i would manage to compile the original source without error then i can fix it. but since i can not even compile them without any error i so no point in change the sourescode annyway.

I know thats the way to go but i assume that where i am stuck at the moment.


Or do you say that if i change all the uints, to ints. that will also fix my compile error?

I get the same error when i try to compile this time aswell:
Skärmbild 2023-12-06 015445.png
 
Last edited:
No, it wont fix your compilation error.

There is a full tutorial on how to compile TFS in every system, make sure to follow step by step:
 
No, it wont fix your compilation error.

There is a full tutorial on how to compile TFS in every system, make sure to follow step by step:
Yes that is the tutorial i have used.

And as i said erlier, if i download the master branch from github and compile it works. but that server is for client 12.X

i tried to download the 1.4.2 source files and compile them (for using client 10.98) becuase that is the server i am running.
but then i get the error i sent a picture of.


and well i understand that there is a problem with fmt, but i still think its strange if it works on the master branch.
 
Check this, it will fix:

 
Last edited:
Back
Top