Issue information

Issue ID
#7968
Status
Fixed
Severity
None
Started
Moguri
Jan 12, 2014 18:19
Last Post
Moguri
Jan 13, 2014 15:14
Confirmation
Yes (0)
No (1)

Moguri - Jan 12, 2014 18:19

Moving the issue from Script to here, since im fearing is an core problem.
[code=auto:0] [Notice]: Conflicting var name 'Red_Potion', prioritising the script var [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: tradertype (1 parameter): [Debug]: Data: variable name='NST_MARKET' [Debug]: Source (NPC): HaiMarket at prontera (150,160) [Warning]: script_get_val: cannot access player variable 'NST_MARKET', defaulting to 0 [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: tradertype (1 parameter): [Debug]: Data: variable name='NST_CUSTOM' [Debug]: Source (NPC): TestCustom2 at prontera (153,152) [Warning]: script_get_val: cannot access player variable 'NST_CUSTOM', defaulting to 0 [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: tradertype (1 parameter): [Debug]: Data: variable name='NST_CASH' [Debug]: Source (NPC): TestTraderCash at prontera (152,152) [Warning]: script_get_val: cannot access player variable 'NST_CASH', defaulting to 0 [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#ve at ve_in (243,303) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#ve at ve_in (243,303) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#tu at tur_dun01 (158,54) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#tu at tur_dun01 (158,54) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#ra at ra_in01 (257,269) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#ra at ra_in01 (257,269) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#prt1 at prt_in (126,76) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#prt1 at prt_in (126,76) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#prt at prt_fild05 (290,221) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#prt at prt_fild05 (290,221) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#pay3 at payon (159,96) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#pay3 at payon (159,96) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#pay2 at payon_in02 (87,34) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#pay2 at payon_in02 (87,34) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#pay at payon_in01 (5,49) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#pay at payon_in01 (5,49) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#mosk at mosk_in (21,254) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#mosk at mosk_in (21,254) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#moc2 at moc_ruins (114,63) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#moc2 at moc_ruins (114,63) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#moc1 at moc_ruins (91,128) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#moc1 at moc_ruins (91,128) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#xmas at xmas_in (40,38) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#xmas at xmas_in (40,38) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#lou at lou_in02 (239,176) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#lou at lou_in02 (239,176) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#lhz2 at lhz_in03 (239,106) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#lhz2 at lhz_in03 (239,106) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#yuno2 at yuno_in01 (25,34) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#yuno2 at yuno_in01 (25,34) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#yuno at yuno (218,97) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#yuno at yuno (218,97) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#hu at hu_in01 (241,368) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#hu at hu_in01 (241,368) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#gon at gonryun (147,84) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#gon at gonryun (147,84) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#gef at geffen_in (77,167) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#gef at geffen_in (77,167) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Paddler#ein at einbroch (82,199) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Paddler#ein at einbroch (82,199) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#ein at ein_in01 (189,15) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#ein at ein_in01 (189,15) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#cmd2 at cmd_fild07 (257,126) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#cmd2 at cmd_fild07 (257,126) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#cmd at cmd_in01 (79,182) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#cmd at cmd_in01 (79,182) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#ayo at ayo_in01 (18,182) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#ayo at ayo_in01 (18,182) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#ama at ama_in01 (24,30) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#ama at ama_in01 (24,30) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#alde at aldeba_in (94,56) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#alde at aldeba_in (94,56) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#alb2 at alberta_in (182,97) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [Debug]: Source (NPC): Tool Dealer#alb2 at alberta_in (182,97) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: sellitem (1 parameter): [Debug]: Data: variable name='Red_Potion' [Debug]: Source (NPC): Tool Dealer#alb at alb2trea (87,65) [Warning]: script_get_val: cannot access player variable 'Red_Potion', defaulting to 0 [Warning]: buildin_sellitem: unknown item id '0'! [/code]
STEPS TO REPRODUCE:

Check last git, edit npc/scripts_custom.conf to add "[color=rgb(40,40,40)][font=helvetica, arial, sans-serif]npc: doc/sample/npc_trader_sample.txt " and start map server.[/font][/color]


Tried editing the npc, getting a piece of that on a new npc...[list]
[*]
[/list]

Haru - Jan 12, 2014 18:32

I can't reproduce this. Did you recompile your server?

Moguri - Jan 12, 2014 18:55

Yes, and its weird, as i said, i got from github last version.

I cleaned, configure'd and ran make sql..

This post has been edited by Moguri on Jan 12, 2014 18:58

Moguri - Jan 12, 2014 19:01

Uploaded full debug of mapserver, just edited the ips

Haru - Jan 12, 2014 19:08

Do you ahve any custom scripts where you use a variable named 'Red_Potion'?

This shouldn't normally happen:[code=auto:0] [Notice]: Conflicting var name 'Red_Potion', prioritising the script var [/code]

Moguri - Jan 12, 2014 19:19

As i said, i made a checkout on a fresh git, so i didnt added any npc... Just the default ones :P

Ind - Jan 12, 2014 19:36

could you send us your db/const.txt? also could you inform us your operating system?

Moguri - Jan 12, 2014 19:45

Of course!

Db/const.txt is the default one, no changes.

And the SO its Debian 7

Haru - Jan 13, 2014 3:22

Fixed in [url="https://github.com/HerculesWS/Hercules/commit/8eadb9fc241e1784084625e89b208d80bda9e6e2"]https://github.com/HerculesWS/Hercules/commit/8eadb9fc241e1784084625e89b208d80bda9e6e2[/url]

Moguri - Jan 13, 2014 13:16

Thanks for the fix, but still happends another thing:

Got this:[code=auto:0] [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: tradertype (1 parameter): [Debug]: Data: variable name='NST_MARKET' index=0 [Debug]: Source (NPC): HaiMarket at prontera (150,160) [Warning]: script_get_val: cannot access player variable 'NST_MARKET', defaulting to 0 [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: tradertype (1 parameter): [Debug]: Data: variable name='NST_CUSTOM' index=0 [Debug]: Source (NPC): TestCustom2 at prontera (153,152) [Warning]: script_get_val: cannot access player variable 'NST_CUSTOM', defaulting to 0 [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: tradertype (1 parameter): [Debug]: Data: variable name='NST_CASH' index=0 [Debug]: Source (NPC): TestTraderCash at prontera (152,152) [Warning]: script_get_val: cannot access player variable 'NST_CASH', defaulting to 0 [/code]
And all the npcs are selling the items for Zeny, not cash or other things

Haru - Jan 13, 2014 14:05

The sample NPCs in doc/sample/npc_trader_sample.txt uses NST_CASH and NST_CUSTOM.

But still, no matter what the NPCs are using, those constants are supposed to be defined in db/const.txt, so they shouldn't throw any errors. If your const.txt file is complete and up to date, then this shouldn't happen. Compare with:
[url="https://github.com/HerculesWS/Hercules/blob/master/db/const.txt#L3353"]https://github.com/HerculesWS/Hercules/blob/master/db/const.txt#L3353[/url]

Moguri - Jan 13, 2014 14:09

Its copied to be like that, maybe this is the problem? [code=:0] [Error]: script_rid2sd: fatal error ! player not attached! [/code]
Seems that the npc is trying to get a player's Variable when using tradertype(xxx);
That's the problem.


BTW, the script uses [color=rgb(40,40,40)][font=helvetica, arial, sans-serif][size=3]NST_CASH, [/size][/font][/color][color=rgb(40,40,40)][font=helvetica, arial, sans-serif][size=3]NST_CUSTOM and [/size][/font][/color][color=rgb(0,136,0)]NST_MARKET[/color]

Haru - Jan 13, 2014 14:33

It says it's trying to use a player variable because, for some reason, it doesn't know those constants. As I said, this can only happen if they're not listed in db/const.txt (or if for some reason the server is unable to read that file correctly)

Moguri - Jan 13, 2014 15:14

Ok, my bad, for some reason the format was not ok, or something, deleted, then restored the file and now its working :)