kairu 0 Posted April 25, 2017 (edited) I made an item call a function which have player interaction to choose on a menu but it gets the error npc_scriptcont: failed npc->checknear test. Heres an example of it: Item id of Knife -> 1202 with script on it as: callfunc "getSkill"; and the gist of the function of: function script getSkill { attachrid(getcharid(3)); retryRK: dispbottom "Select a Skill you want."; switch(select("Enchant Blade:Sonic Wave:Death Bound")){ case 1: .@r = 1; break; case 2: .@r = 2; break; case 3: .@r = 3; break; default: goto(retryRK); } close; <More code...> I'm just wondering if there's any fix to this http://herc.ws/board/tracker/issue-3720-failed-npc-checknear-test-on-item-equip-function/ or any work around it. would greatly appreciate it! Edited April 25, 2017 by kairu Quote Share this post Link to post Share on other sites
0 bWolfie 138 Posted April 25, 2017 If you are using callfunc or callsub, any .@ instance scope variables apply only within the function itself. So you would need to use maybe @ variable to apply to temp char value. Quote Share this post Link to post Share on other sites
0 4144 364 Posted April 25, 2017 @kairu input interaction can works only with npc. You cant enter text for not attached npc. For fix this issue, you can use in your item use script doevent "servicenpc::OnUseMenu" And inside this npc and this label even you can add your code what will ask something from player. Also attachrid from usescript is useless, script should be already attached to player. Quote Share this post Link to post Share on other sites
0 kairu 0 Posted April 25, 2017 Hi, Thanks for replying i will try this tomorrow when i get up in bed and will let you know if it works. @kairu input interaction can works only with npc. You cant enter text for not attached npc. For fix this issue, you can use in your item use script doevent "servicenpc::OnUseMenu" And inside this npc and this label even you can add your code what will ask something from player. Also attachrid from usescript is useless, script should be already attached to player. i tried to do this but i got errors saying this: [Warning]: Unable to restore stack! Double continuation[Debug]: Previous script (lost):[Debug]: Current script:[Debug]: Source (NPC): Test (invisible/not on a map) Quote Share this post Link to post Share on other sites
0 4144 364 Posted April 26, 2017 [Warning]: Unable to restore stack! Double continuation This mean some thing already runned. player can execute only one script at same time. Look like your Test npc script was run with attached player and you run another one script. This will not works Quote Share this post Link to post Share on other sites
0 kairu 0 Posted April 26, 2017 (edited) [Warning]: Unable to restore stack! Double continuation This mean some thing already runned. player can execute only one script at same time. Look like your Test npc script was run with attached player and you run another one script. This will not works The Test npc script is the one i called on doevent. it may have something to do with my other scripts but it should show what current script i have open it with. Edit: ive disabled all my custom scripts but still the same. It also crashes if i call the doevent on the item Edited April 26, 2017 by kairu Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted May 4, 2017 I made an item call a function which have player interaction to choose on a menu but it gets the error npc_scriptcont: failed npc->checknear test. Heres an example of it: Item id of Knife -> 1202 with script on it as: callfunc "getSkill"; and the gist of the function of: function script getSkill { attachrid(getcharid(3)); retryRK: dispbottom "Select a Skill you want."; switch(select("Enchant Blade:Sonic Wave:Death Bound")){ case 1: .@r = 1; break; case 2: .@r = 2; break; case 3: .@r = 3; break; default: goto(retryRK); } close; <More code...> I'm just wondering if there's any fix to this http://herc.ws/board/tracker/issue-3720-failed-npc-checknear-test-on-item-equip-function/ or any work around it. would greatly appreciate it! Menu without mes is always a problem.Try put mes before select, and see if original problem exists or not Also, you don't need to do attachrid in the code you posted above. Quote Share this post Link to post Share on other sites
0 kairu 0 Posted May 4, 2017 I made an item call a function which have player interaction to choose on a menu but it gets the error npc_scriptcont: failed npc->checknear test. Heres an example of it: Item id of Knife -> 1202 with script on it as: callfunc "getSkill"; and the gist of the function of: function script getSkill { attachrid(getcharid(3)); retryRK: dispbottom "Select a Skill you want."; switch(select("Enchant Blade:Sonic Wave:Death Bound")){ case 1: .@r = 1; break; case 2: .@r = 2; break; case 3: .@r = 3; break; default: goto(retryRK); } close; <More code...> I'm just wondering if there's any fix to this http://herc.ws/board/tracker/issue-3720-failed-npc-checknear-test-on-item-equip-function/ or any work around it. would greatly appreciate it! Menu without mes is always a problem.Try put mes before select, and see if original problem exists or not Also, you don't need to do attachrid in the code you posted above. I tried it with mes but its still the same. however, instead of "doevent" on the script i used addtimer and no more errors Quote Share this post Link to post Share on other sites
I made an item call a function which have player interaction to choose on a menu but it gets the error npc_scriptcont: failed npc->checknear test.
Heres an example of it:
Item id of Knife -> 1202
with script on it as:
callfunc "getSkill";
and the gist of the function of:
I'm just wondering if there's any fix to this http://herc.ws/board/tracker/issue-3720-failed-npc-checknear-test-on-item-equip-function/
or any work around it.
would greatly appreciate it!
Edited by kairuShare this post
Link to post
Share on other sites