Jump to content
  • 0

Weird script_rid2sd with no source NPC?


lnteractive

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  10/19/12
  • Last Seen:  

[Error]: script_rid2sd: fatal error ! player not attached!

[Debug]: Function: bonus (2 parameters):

[Debug]: Data: number value=47

[Debug]: Data: number value=1

[Error]: script_rid2sd: fatal error ! player not attached!

[Debug]: Function: bonus2 (3 parameters):

[Debug]: Data: number value=1011

[Debug]: Data: number value=7

[Debug]: Data: number value=10

[Error]: script_rid2sd: fatal error ! player not attached!

[Debug]: Function: bonus (2 parameters):

[Debug]: Data: number value=1003

[Debug]: Data: number value=15

[Error]: script_rid2sd: fatal error ! player not attached!

[Debug]: Function: bonus (2 parameters):

[Debug]: Data: number value=16

[Debug]: Data: number value=3

Could anybody point out where this is coming from that sends a terminating signal to the mapserver and crashes it? There doesn't seem to be a reported source NPC.

Link to comment
Share on other sites

11 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

You are trying to execute a player-related command without any RID attached to the script.

Edited by Ryokem
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  10/19/12
  • Last Seen:  

However, where does the source come from? an NPC?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

check any script you have added recently......

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  10/19/12
  • Last Seen:  

My script seems clean, the latest ones I added only has atcommand * strcharinfo(), there was no attachrid() involved.

I've enabled gdb so the next time it crashes again, I'm going to be able to provide the full crash dump.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

It's not about "attachrid".

Even if you run a simple "OnInit" event label trying to activate a player related command will end up with that error.

e.g.

OnInit:
  mes "Hi!"; //ERROR! script_rid2sd: fatal error ! player not attached!

Edited by Ryokem
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  10/19/12
  • Last Seen:  

Alright.

I'm going to go through the last 2 scripts I've added slowly and see what pops up. Thank you for the prompt replies.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

in my test server

prontera,159,189,5	script	kjfhskdj	100,{
end;
OnInit:
bonus bstr, 100;
close;
}

[Error]: script_rid2sd: fatal error ! player not attached!
[Debug]: Function: bonus (2 parameters):
[Debug]: Data: number value=13
[Debug]: Data: number value=100
[Debug]: Source (NPC): kjfhskdj at prontera (159,189)

it is reported

unless you are not using rathena

/// Returns the player attached to this script, identified by the rid.
/// If there is no player attached, the script is terminated.
TBL_PC *script_rid2sd(struct script_state *st)
{
TBL_PC *sd=map_id2sd(st->rid);
if(!sd){
	ShowError("script_rid2sd: fatal error ! player not attached!\n");
	script_reportfunc(st);
	script_reportsrc(st);
	st->state = END;
}
return sd;
}

make sure your script.c has something like this

especially script_reportsrc

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  10/19/12
  • Last Seen:  

That block of script.c looks exactly the same, however it doesn't identify a source.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  1315
  • Reputation:   372
  • Joined:  12/10/11
  • Last Seen:  

Take out all of your custom scripts then add them back one by one until you run into that error so you can identify exactly what the cause is or you can backtrack and take out the latest ones you've added one by one until the error no longer shows up. That's the only way for you to identify which script it is.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

lol

[Error]: script_rid2sd: fatal error ! player not attached!

[Debug]: Function: bonus (2 parameters):

[Debug]: Data: number value=47

[Debug]: Data: number value=1

-> bonus bMdef,1;

[Error]: script_rid2sd: fatal error ! player not attached!

[Debug]: Function: bonus2 (3 parameters):

[Debug]: Data: number value=1011

[Debug]: Data: number value=7

[Debug]: Data: number value=10

-> bonus2 bSubRace,RC_DemiHuman,10;

[Error]: script_rid2sd: fatal error ! player not attached!

[Debug]: Function: bonus (2 parameters):

[Debug]: Data: number value=1003

[Debug]: Data: number value=15

-> bonus bCastrate,15;

[Error]: script_rid2sd: fatal error ! player not attached!

[Debug]: Function: bonus (2 parameters):

[Debug]: Data: number value=16

[Debug]: Data: number value=3

-> bonus bInt,3;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

Yeah that script error is pretty weird as it can be reffered both as npc or db side. In fact the state pointer in the source perfectly gives the idea about what and when it is triggered.

It should be implemeted a little bit better tho :<

Edited by Ryokem
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...