Jump to content
  • 0

Instancing Issue


Luciar

Question


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

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:

Edited by luciar
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  141
  • Reputation:   34
  • Joined:  05/30/12
  • Last Seen:  

bump this* 

 

D: anyone an idea how to fix this?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

I could really use some help on this :(

I've searched all available resources and still can't figure this out on my own.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   1
  • Joined:  05/13/12
  • Last Seen:  

did you try to change the switch into menu yet ?

May be the prob is from switch( just guess...)

Change switch into

.inst = (instance_create("Test Instance",.@partyid)) ;

and then use if else

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

did you try to change the switch into menu yet ?

What? Switches and menus are very much not interchangeable. Switches can be used to produce menus with switch(select()) but that isn't the purpose of the switch in my script.

 

Change switch into

.inst = (instance_create("Test Instance",.@partyid)) ;

and then use if else

 

The problem isn't with switch, as described in my original post. The first group to create an instance does so successfully.

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