Jump to content
  • 0

Script Error: npc_scriptcont ...


Snurayroth

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  02/16/12
  • Last Seen:  

Hello,

Im running this script via custom command and its working and i never got an problem with it before:

-	script	XXXX	-1,{

if(alreadyopen == 1) goto L_open;

set alreadyopen,1;


getmapxy(@roflmap$,@roflx,@rofly,0,strcharinfo(0));

warp @roflmap$,@roflx,@rofly; goto L_lol;

L_lol:
sleep2 100;

//start

mes "XXXXXXXXXXXXXXXX";
mes "XXXXXXXXXXXXXXXXXXXXX";
mes "XXXXXXXXXXXXXXXXXXXXXXXXXX";
mes "XXXXXXXXXXXXXXXXXXXXXXXX";
next;
menu "- A",L_A,
"- B",L_B,
"- C",L_C,
"- D",L_D,
"- Close",L_Close;

Info:

My Server is running on my Computer.

Im playing on the same Computer where the Server is running.

Other People connect to it via Hamachi to find Bugs for me.

When i am using the Custom command to execute this Script its working perfectly.

But when other People using the Custom Command to execute this Script it doesnt work properly,

he get warped and seeing this like me too:

mes "XXXXXXXXXXXXXXXX";
mes "XXXXXXXXXXXXXXXXXXXXX";
mes "XXXXXXXXXXXXXXXXXXXXXXXXXX";
mes "XXXXXXXXXXXXXXXXXXXXXXXX";

But they dont see the "next" button there and the "menu" doesnt popup.

The Map Server is giving me this error:

Debug: npc_scriptcont: 'Unknown NPC' <sd->npc_id=0> is not FAKE_NPC <id=110000030>.

I hope u can help me ! Thanks !

Here some screenshots:

for me it looks like this:

http://www.picfront.org/d/8wOS

and for other people it is looking like this:

http://www.picfront.org/d/8wOO

Nobody know an solution ? i already tried to spilt this script and put the parts after the warping in a function and called it via callfunc but that had nothing changed still the same error.

Does anyone know an solution for it?

regards,

Snurayroth

Edited by Snurayroth
Link to comment
Share on other sites

15 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   10
  • Joined:  02/19/12
  • Last Seen:  

where is the label L_open?

post the entire script please D:

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  02/16/12
  • Last Seen:  

Ok here is the complete script:

-	script	XXX	-1,{

if(alreadyopen == 1) goto L_open;

set alreadyopen,1;

getmapxy(@roflmap$,@roflx,@rofly,0,strcharinfo(0));

warp @roflmap$,@roflx,@rofly; goto L_lol;

L_lol:
sleep2 100;

//start

mes "XXXXXXXXXX";
mes "XXXXXXXXXXX";
mes "XXXXXXXXXX";
mes "XXXXXXXXXXXXXX";
next;
menu "- A",L_A,
"- B",L_B,
"- C",L_C,
"- D",L_D,
"- Close",L_Close;

L_back:
//start
mes "XXXXXXXXXX";
mes "XXXXXXXXXXX";
mes "XXXXXXXXXX";
mes "XXXXXXXXXXXXXX";
next;
menu "- A",L_A,
"- B",L_B,
"- C",L_C,
"- D",L_D,
"- Close",L_Close;


L_A:
mes "XX";
mes "XX";
mes "XX";
mes "XX";
next;
menu "- Back",L_back,
"- Close",L_Close;
close;

L_B:
mes "XX";
mes "XX";
mes "XX";
mes "XX";
next;
menu "- Back",L_back,
"- Close",L_Close;
close;

L_C:
mes "XX";
mes "XX";
mes "XX";
mes "XX";
next;
menu "- Back",L_back,
"- Close",L_Close;
close;

L_D:
mes "XX";
mes "XX";
mes "XX";
mes "XX";
next;
menu "- Back",L_back,
"- Close",L_Close;
close;

L_Close:
mes "XX";
mes "XX";
mes "XX";
mes "XX";
set alreadyopen,0;
close;

L_open:
end;
}

I also tried this script before without the label "L_lol" and it doesnt worked ^^

Edited by Arcenciel
Codeboxed
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   10
  • Joined:  02/19/12
  • Last Seen:  

1- in L_open use 'close;' cus end will stop the script but the window will keep open.

2- you don't need a 'close;' after every menu. they'll jump to the next part of the script making the close useless.

3- #1 i guess is the only error, and #2 is just something to make your code 'clean'

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  02/16/12
  • Last Seen:  

1- in L_open use 'close;' cus end will stop the script but the window will keep open.

2- you don't need a 'close;' after every menu. they'll jump to the next part of the script making the close useless.

3- #1 i guess is the only error, and #2 is just something to make your code 'clean'

The error is still the same D:

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   10
  • Joined:  02/19/12
  • Last Seen:  

you want to know what's wrong or can i try to make one like this but working?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   2
  • Joined:  02/17/12
  • Last Seen:  

It looks like using next in a floating NPC causes an error.

*next;

...

If no window is currently on screen, one will be created, but once the invoking

character clicks on it, a warning is thrown on the server console and the script

will terminate.

I was able to reproduce the same error using the following code:

prontera,153,170,4	script	Temptest	46,{
set @testrid, getcharid(0);
doevent "XXX::OnDo";
end;
}

-	script	XXX	-1,{
OnDo:

attachrid @testrid;
getmapxy(@roflmap$,@roflx,@rofly,0,strcharinfo(0));
warp @roflmap$,@roflx,@rofly;

L_lol:
mes "L_lol";
mes "XXXXXXXXXXX";
next; // NOTE
menu "- A",L_A,
"- Close",L_Close;

L_back:
mes "L_back";
mes "XXXXXXXXXXX";
next;
menu "- A",L_A,
"- Close",L_Close;

L_A:
mes "XX";
mes "XX";
mes "XX";
mes "XX";
next;
menu "- Back",L_back,
"- Close",L_Close;

L_Close:
mes "XX";
mes "XX";
mes "XX";
mes "XX";

L_open:
close;
}

NOTE: If you comment out the 'next;' under the L_lol label, it is possible to access the menu that comes after it.

However, choosing any of the menu resulted in either being disconnected from the server or my client crashing.

There's also a warning message that looks like this:

[Warning]: Invalid menu selection on npc 110076110:'XXX' - got 1, valid range is [1..0]

However, if you replace the upper part of the code with the following, the script works just fine. So I'm assuming that your error is most likely related to the one mentioned in the description for next;, and by creating a 'valid' window before proceeding into your own code, it should bypass the error. But since you're executing it from a custom command, I'm not sure how you are going to do it...

prontera,153,170,4	script	Temptest	46,{
set @testrid, getcharid(0);

mes "abcde";

getmapxy(@roflmap$,@roflx,@rofly,0,strcharinfo(0));
warp @roflmap$,@roflx,@rofly;
doevent "XXX::OnDo";
end;
}

-	script	XXX	-1,{
OnDo:

attachrid @testrid;

L_lol:
// content from this line and below remains the same

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  02/16/12
  • Last Seen:  

you want to know what's wrong or can i try to make one like this but working?

I would be happy if you tell it to me and yes u could make a working one like this if u want to. :(

It looks like using next in a floating NPC causes an error.

*next;

...

If no window is currently on screen, one will be created, but once the invoking

character clicks on it, a warning is thrown on the server console and the script

will terminate.

I was able to reproduce the same error using the following code:

prontera,153,170,4	script	Temptest	46,{
set @testrid, getcharid(0);
doevent "XXX::OnDo";
end;
}

-	script	XXX	-1,{
OnDo:

attachrid @testrid;
getmapxy(@roflmap$,@roflx,@rofly,0,strcharinfo(0));
warp @roflmap$,@roflx,@rofly;

L_lol:
mes "L_lol";
mes "XXXXXXXXXXX";
next; // NOTE
menu "- A",L_A,
"- Close",L_Close;

L_back:
mes "L_back";
mes "XXXXXXXXXXX";
next;
menu "- A",L_A,
"- Close",L_Close;

L_A:
mes "XX";
mes "XX";
mes "XX";
mes "XX";
next;
menu "- Back",L_back,
"- Close",L_Close;

L_Close:
mes "XX";
mes "XX";
mes "XX";
mes "XX";

L_open:
close;
}

NOTE: If you comment out the 'next;' under the L_lol label, it is possible to access the menu that comes after it.

However, choosing any of the menu resulted in either being disconnected from the server or my client crashing.

There's also a warning message that looks like this:

[Warning]: Invalid menu selection on npc 110076110:'XXX' - got 1, valid range is [1..0]

However, if you replace the upper part of the code with the following, the script works just fine. So I'm assuming that your error is most likely related to the one mentioned in the description for next;, and by creating a 'valid' window before proceeding into your own code, it should bypass the error. But since you're executing it from a custom command, I'm not sure how you are going to do it...

prontera,153,170,4	script	Temptest	46,{
set @testrid, getcharid(0);

mes "abcde";

getmapxy(@roflmap$,@roflx,@rofly,0,strcharinfo(0));
warp @roflmap$,@roflx,@rofly;
doevent "XXX::OnDo";
end;
}

-	script	XXX	-1,{
OnDo:

attachrid @testrid;

L_lol:
// content from this line and below remains the same

Umm... ur doing it using an NPC but i can only use an Script to do it because i need to execute it with the custom command i have.

I tried it to do it but seems like it dont working that way i think.... :/

Whatever, thank you both for helping me !

I will still try to find an solution by myself... ><

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:  

LOL..what is this ? i cant understand what you want ur script do to..

i just saw...so many XXXXX and menu , menu...and menu....

O.O

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  02/16/12
  • Last Seen:  

LOL..what is this ? i cant understand what you want ur script do to..

i just saw...so many XXXXX and menu , menu...and menu....

O.O

I only censored the dialogue with "XXXX" ^^

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   2
  • Joined:  02/17/12
  • Last Seen:  

Snurayroth, I have a vague idea that might work. Instead of using a floating NPC, make it something like this:

mapname,xcoor,ycoor script NPC_Name -1,{
OnEventName:
//attach rid of player
//place your text in here
end;
}

Then alter your custom command so that it saves the character RID into a variable and runs NPC_Name::OnEventName.

I'm not exactly sure it'll work though, but that's an alternative I thought of.

I'm not familiar with custom commands, so I can't test it myself. Sorry =(

Edited by deltadestiny
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:  

@TS...mind to explain your script ? i mean what it does ??

For Example :

getmapxy(@roflmap$,@roflx,@rofly,0,strcharinfo(0));
warp @roflmap$,@roflx,@rofly; goto L_lol;

why are you warping the character back to the same coordinate ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  02/16/12
  • Last Seen:  

@TS...mind to explain your script ? i mean what it does ??

For Example :

getmapxy(@roflmap$,@roflx,@rofly,0,strcharinfo(0));
warp @roflmap$,@roflx,@rofly; goto L_lol;

why are you warping the character back to the same coordinate ?

Ok, ill try to explain it a bit, so as u know i createt a custom command that all normal players can use.

Example:

this command open an "npc-menu"/"a mes window" with information about other commands or whatever

Its, working perfectly.

Now u asking me why i want to warp the character back to the same coordinates!

Because: When an player walking into an Warping Portal and using this command in this time, than the player can stay on the Warping Portal without get warped and i want to prevent that.

Its working for me 100% but as i said before when other player use this command it dont work oO

PS:

I dont use the normal Warping Portals.

I use this kind of it:

hs_kalmo.gat,102,177,4	script	inwarp1	45,2,2,{

if (BaseLevel >= 15) {
warp "hs_kalmo_in.gat",48,105; end;
}
end;
}

Edited by Snurayroth
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:  

you mean something like this ??

NPC Sketch - Pastebin

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  02/16/12
  • Last Seen:  

you mean something like this ??

NPC Sketch - Pastebin

Yes, nothing more than that. That is it what i execute with my custom command.

And i want to warp the character back to the same coordinate to prevent that they can stay on the Warping Portal like u can see here:

http://image-upload.de/image/Io2o0l/81a729068e.jpg

and after closing this Script:

http://image-upload..../92da5afb74.jpg

^^ xD

I only want to prevent that ^^

Edited by Snurayroth
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  02/16/12
  • Last Seen:  

I got an solution for it, when i increase the sleep2 value in my script it is working oO ! ^^ solved but its still possible to get on the warp but i got a new idea to fix that... thanks for helping me to all !! [sOLVED]

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