Hi all, I'm trying to create a very basic custom instance to better understand how to use the system. So far I have been able to create an instance and warp the party to the instanced map successfully. However, once one party has started an instance, all other parties get stuck in "Standby" (the instance window pops up saying "[Test Instance] in Standby... Your Standby Priority: 0".
When I try to interact with the NPC with the party leader of one of these standby instances, my NPC throws "An unknown error occured." (default/-1 result of the switch(instance_create) function)
Here is the script. It loads without error:
prontera,157,172,4 script Instance Guy 123,{
.@name$ = "[^0000FFInstance Guy^000000]";
.@partyid = getcharid(1);
if(getpartyleader(.@partyid,2) == getcharid(0)) {
if(instance_check_party(.@partyid,1,148,150)) {
//Party Is OK - 1 member, min lvl 148, max 150
mes .@name$;
if(!instance_id(1)) {
mes "Would you like to create an instance for your party?";
if(select("Yes") != 1) {
close;
}
}
switch(instance_create("Test Instance",.@partyid)) {
case -3:
mes "I'm sorry, all instances are currently full, please try again later. We appologize for the inconvienence.";
close;
case -2:
mes "There seems to be an issue with your party. Are you in one?";
close;
case -4:
.@instid = instance_id(1);
mes "Your party is currently attached to instance ID#: ^FF0000"+.@instid+"^000000.";
break;
case 0:
case 1:
.@instid = instance_id(1);
if(instance_attachmap("1@gl_k",.@instid) == "") {
instance_destroy .@instid;
mes "Instanced failed to attach to map. Instance has been destroyed.";
close;
}
instance_set_timeout 1200000,60000,.@instid;
instance_init .@instid;
mes "Instance ID#: ^FF0000"+.@instid+"^000000 created for party ^0000FF"+strcharinfo(1)+"^000000.";
break;
case -1:
default:
mes "An unknown error occured.";
close;
}
switch(select("Warp me to the instance!")) {
case 1:
instance_warpall "1@gl_k",123,123,.@instid;
default:
close;
}
} else {
//Party NOT OK
mes .@name$;
mes "I'm sorry, you don't meet the requirements of this instance.";
close;
}
} else {
mes .@name$;
mes "I can only start an instance for a leader of a party.";
close;
}
}
Also, if I choose not to be warped to the instance, close the NPC dialogue and talk to the NPC again, it throws the same error (shouldn't it throw -4?) (all of this with the leader of the first instance created)
I realize this might not be a scripting error since there are no warnings from the server, but I have reviewed all instancing documentation (wiki, script_commands.txt, and other related forum posts) and can't figure it out D:
Question
Luciar
Hi all, I'm trying to create a very basic custom instance to better understand how to use the system. So far I have been able to create an instance and warp the party to the instanced map successfully. However, once one party has started an instance, all other parties get stuck in "Standby" (the instance window pops up saying "[Test Instance] in Standby... Your Standby Priority: 0".
When I try to interact with the NPC with the party leader of one of these standby instances, my NPC throws "An unknown error occured." (default/-1 result of the switch(instance_create) function)
Here is the script. It loads without error:
Also, if I choose not to be warped to the instance, close the NPC dialogue and talk to the NPC again, it throws the same error (shouldn't it throw -4?) (all of this with the leader of the first instance created)
I realize this might not be a scripting error since there are no warnings from the server, but I have reviewed all instancing documentation (wiki, script_commands.txt, and other related forum posts) and can't figure it out D:
Edited by luciarLink to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.