Jump to content
  • 0

Weird script_rid2sd with no source NPC?


Question

Posted

[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.

11 answers to this question

Recommended Posts

Posted

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.

Posted (edited)

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
Posted (edited)

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
Posted

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.

Posted

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;

Posted (edited)

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...