• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

help with a command

Newbie Spellweaver
Joined
Oct 23, 2016
Messages
15
Reaction score
0
Hi. i've added a command in "playercommand.java"

Code:
        } else if (splitted[0].equalsIgnoreCase("aio")|| splitted[0].equals("aio npc")) {
                NPCScriptManager.getInstance().start(c, 9901019, null, player);

It works fine when im near the npc. his location is on fm, but when im in henesys or anywhere else it just crashes. any ideas?
 
Junior Spellweaver
Joined
Dec 21, 2013
Messages
140
Reaction score
3
Based on the command and the command alone, the location shouldn't be the cause of your crashes.

Do any error messages pop up when you crash?
Which command are you using when you DC? "aio" or "aio npc"?
Try removing the || splitted[0].equals("aio npc")? I've never seen a command like that before.

So here's what I think I know about commands
@ (Start), aio (splitted[0]), npc (splitted[1])
is how they are counted. I'm not sure if that's the case with your command though, but worth a shot.
 
Upvote 0
Newbie Spellweaver
Joined
Jul 22, 2012
Messages
90
Reaction score
0
try this :

PHP:
            } else if (splitted[0].equals("@aio")) {
                NPCScriptManager.getInstance().start(c, 9901019);
 
Upvote 0
Newbie Spellweaver
Joined
Oct 23, 2016
Messages
15
Reaction score
0
Based on the command and the command alone, the location shouldn't be the cause of your crashes.

Do any error messages pop up when you crash?
Which command are you using when you DC? "aio" or "aio npc"?
Try removing the || splitted[0].equals("aio npc")? I've never seen a command like that before.

So here's what I think I know about commands
@ (Start), aio (splitted[0]), npc (splitted[1])
is how they are counted. I'm not sure if that's the case with your command though, but worth a shot.

nothing, not even an error npc.



see whether your start method in NPCScriptManager has a distance check or not?

Nope.



try this :

PHP:
            } else if (splitted[0].equals("@aio")) {
                NPCScriptManager.getInstance().start(c, 9901019);

didn't work and even deleted the command.
 
Upvote 0
Experienced Elementalist
Joined
Mar 12, 2015
Messages
238
Reaction score
43
Player npc's can't be opened unless ur on the same map as the npc.
Atleast not the the way its programmed now.

edit:
You also can't have spacebars in commands the way you do it.

This is because the text you send in game gets seperated by spacebars and put in an array.

So the text "hello i'm doing fine, how are you?" gets split like this:

String[] sentence = {"hello", "i'm", "doing", "fine.", "how", "are", "you?"};

thats why you check if splitted[0] equals a certain text string
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
Oct 23, 2016
Messages
15
Reaction score
0
Player npc's can't be opened unless ur on the same map as the npc.
Atleast not the the way its programmed now.

edit:
You also can't have spacebars in commands the way you do it.

This is because the text you send in game gets seperated by spacebars and put in an array.

So the text "hello i'm doing fine, how are you?" gets split like this:

String[] sentence = {"hello", "i'm", "doing", "fine.", "how", "are", "you?"};

thats why you check if splitted[0] equals a certain text string
but i can use other npcs commands by using @<thecommand> and it works fine. either im in the same map or not at the same map
 
Upvote 0
Back
Top