Jump to content
  • 0

New instancing script commands cause failure for char only instance


Akkarin

Question


  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3127
  • Reputation:   1617
  • Joined:  03/26/12
  • Last Seen:  

So i thought i'd give the new versions of the script commands a try, but i'm failing miserably.
 

switch(instance_create("Prison Break","IM_CHAR",getcharid(0))){
	case -1:
		mes "^FF0000-1 Invalid Type^000000.";
		close;
	case -2: 
		mes "^FF0000-2 Char/Party/Guild not exist^000000.";
		close;
	case -3:
		mes "^FF0000-3 Instance Already Exists?!^000000.";
		close;
	case -4:
		mes "^FF0000-4 No Free Instances. MAX_INSTANCE?!^000000.";
		close;
	default:
		break;
}
	
switch(instance_enter("Prison Break",-1,-1,getcharid(0))) {
	case 3:
		mes "An unknown error has occurred.";
		debugmes strcharinfo(0) + " / " + instance_id() + " / FAIL CODE 3";
		close;
	case 2:
		mes "Instance for Prison Break does not exist.";
		mes "Instance has been destroyed by the Party Leader, or because of the time limit.";
		debugmes strcharinfo(0) + " / " + instance_id() + " / FAIL CODE 2";
		close;
	case 1:
		mes "Looking for a party on a single char only instance..";
		debugmes strcharinfo(0) + " / " + instance_id() + " / FAIL CODE 1";
		close;
	case 0:
		debugmes strcharinfo(0) + " / " + instance_id() + " / SUCCESS";
		end;
}

This code works up until i try to enter the instance, and i get the following output from debugmes:

07:02:24:27|[Info]: [Instance] Created: Prison Break (1).
07:02:24:27|[Debug]: script debug : 2000000 110257446 : Akkarin / 0 / FAIL CODE 3

For some reason the instance isn't being attached to my char, but it should be because i'm using IM_CHAR and passing my char_id to instance_create.

 

The instance is setup correctly in the db (changed columns accordingly), and worked perfectly fine when i was in a party on my own before i updated to get the new script commands.

 

It's been a while since i've done any scripting, but i'm pretty sure this should work.. help please  /panic

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   431
  • Joined:  01/26/16
  • Last Seen:  

IM_* are constants. You should use 

instance_create("Prison Break",IM_CHAR,getcharid(0))

instead.

It's weird though. The instance shouldn't have been created in the first place.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3127
  • Reputation:   1617
  • Joined:  03/26/12
  • Last Seen:  

It wouldn't create unless I used quotes, which was weird enough. Maybe I wasn't typing it right. I'll give it another whirl now I've got my head out of rathena/FluxCP lol

/omg


Update:

 

Still using the same code as above:

switch(instance_create("Prison Break",IM_CHAR,getcharid(0))){
				case -1:
				mes "^FF0000-1 Invalid Type^000000.";
				close;
			case -2: 
				mes "^FF0000-2 Char/Party/Guild not exist^000000.";
				close;
			case -3:
				mes "^FF0000-3 Instance Already Exists?!^000000.";
				close;
			case -4:
				mes "^FF0000-4 No Free Instances. MAX_INSTANCE?!^000000.";
				close;
			default:
				break;
			}

Removing the " " 's gives me this error on the console:

[Error]: instance_create: character 150000 not found for instance 'Prison Break'.

And returns error value -2.

 

Very confused.

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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