Invalid menu selection on npc (after warp)

Keru

New member
Messages
30
Points
0
Emulator
I'm trying to warp a player to a special position on the map, after the warp, the conversation with the npc should go on.

But there is an error after this short script:

FishPond,63,46,6 script WarpTest 555,{ mes "I Will warp you!"; warp "FishPond",64,42; mes "So what happens here?"; select("Something"); //Here seems to be the problem mes "And now?"; close;}

After i choose the "Something" in the select, i get the message now logging out.

In the map server appears the following warning message:

Invalid menu selection on npc 110074997:'WarpTest' - got 1, valid range is [1..0] (player AID: X,CID:X, name:'Keru')!

Do i have to reattach some ids to the script again or something like that?

 
Try this.
 
Code:
FishPond,63,46,6	script	WarpTest    555	,{    mes "I Will warp you!";    close2;    warp "FishPond",64,42;    mes "So what happens here?";    switch(select("Something:Something else")) { //Here seems to be the problemcase 1: //Option 1, which is Something    mes "And now?";    close;case 2: //Option 2, which is Something else   mes "Menu option 2";close;end;}}
 
Last edited by a moderator:
I just updated it
default_tongue.png


 
I see what you intended with the close2, but unfortunately its not working...

 
Yes I have tested it, i'll even copy pasted your script to prevent errors.

Edit: The screenshot is after i choose something in the menu

WarpTest1.PNG

 
Last edited by a moderator:
This issue by design. After warp server forgot any npc related things.

Probably need change this. Need talk with other devs. Reset happend in clif_parse_LoadEndAck.

Or better some one create bug on github bug tracker?

 
Thanks for your answer.

Can this be solved by re attaching player ids or something like that?

 
The issue is the reload of the npc after a warp, a possible workaround is this:

Code:
FishPond, 63, 46, 6	script	WarpTest	555,{	mes "I Will warp you!";	close2;	charTeleported = 1;	warp "FishPond", 64, 42;	end;		OnPCLoadMapEvent:		if(  !charTeleported ) end;		charTeleported = 0;		mes "So what happens here?";		 switch(select("Something:Something else")) {			case 1:				mes "And now?";				close;			break;							case 2:				mes "Menu option 2";				close;			break;		}	end;		OnInit:		setmapflag  "FishPond", mf_loadevent;	end;}
 
Last edited by a moderator:
why not just use a addtimer or sleep2 here ?

just delay the execution of next script/command .... so that it will prompt out the message after they warped to the map...

 
Curious @@4144 could the removal of this check possibly interfere with other things? Maybe reloading the npc after a warp is mandatory for certain things, or will cause other bugs? Maybe that's why it was coded in eAthena? Not sure but it's just a thought.

 
addtimer can make player reattached again

e.g.
 

Code:
prontera,154,173,5	script	testtestest02	100,{	mes "I Will warp you!";        addtimer 1000, strnpcinfo(0)+"::OnReattach";	warp "prt_fild08",169,186;OnReattach:        	mes "So what happens here?";	select("Something");	mes "And now?";	close;}
 
Last edited by a moderator:
Back
Top