Vincent 4 Posted November 13, 2013 Hello, i try to create a instance at a custom map called "1@farm". If i warp to the map with the @warp command there is no problem. But if i try to enter the map via the Instance NPC the Client crashs and say: ResourceError : Cant find file [email protected] I dont why this error came up. my renametable: [email protected]#[email protected]#[email protected]#[email protected]#[email protected]#[email protected]#À¯ÀúÀÎÅÍÆäÀ̽º[email protected]#À¯ÀúÀÎÅÍÆäÀ̽º[email protected]# Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted November 14, 2013 Well, you need to do that kind of workarounds for quite a lot situations on current scripting that I think they are quite more urgent than this (e.g. get an online user list, you have it as @command but no current scripting command does that without a SQL query, this is still missing since eAthena). I don't know where the problem is. Maybe you can mark the map with the src4instance mapflag and you'll possibly not need to do something like this, or you can even improve my example so that you won't get any errors: OnInit: set .next_i, 0; set .max_instance, 100; // I doubt there'll be 100 active instances on the server, so we'll reuse numbers and our map names won't be enormous due to the numbers // BlahblahblahOnMyInstanceStart: set .next_i, .next_i + 1; if (.next_i >= .max_instance) set .next_i, 0; // Blahblahblah Quote Share this post Link to post Share on other sites
0 ossi0110 200 Posted November 13, 2013 (edited) did you added the map into the clientside mapnametable.txt too ? Edited November 13, 2013 by ossi0110 Quote Share this post Link to post Share on other sites
0 Vincent 4 Posted November 13, 2013 Yes, mapnametable.txt: [email protected]#Farm# Quote Share this post Link to post Share on other sites
0 ossi0110 200 Posted November 13, 2013 is this a Selfmade custom map , or did you just renamed a existing map to 1@farm Quote Share this post Link to post Share on other sites
0 Vincent 4 Posted November 13, 2013 (edited) This is a custom map i downloaded from rAthene download section and rename it. Edited November 13, 2013 by Vincent Quote Share this post Link to post Share on other sites
0 ossi0110 200 Posted November 13, 2013 how did you renamed it ? just clicked it an changed the name ? if yes this is wrong. you have to open the map with browedit and click on Save As and then enter the new name Quote Share this post Link to post Share on other sites
0 Vincent 4 Posted November 13, 2013 (edited) But the map is working if i use @warp. Only the instance let the Client crash. Here is my scirpt: payon,97,127,4 script Farm Manager 416,{ .@mdName$ = "House"; mes "[Guard]"; mes "How can I help you?"; switch(select("Warp to my Farm:Buy a farm:Close")) { case 1: set .@buy_check,1; if (.@buy_check == 1 ){ set .@instance, instance_create("farm instanced", getcharid(1));if( .@instance < 0 ){ mes "Failed to create the instance!"; close;}if( instance_attachmap("1@farm", .@instance) == "" ){ instance_destroy(.@instance); mes "Failed to attach farm as a map!"; close;}instance_attach(.@instance);instance_set_timeout(300, 300, .@instance);instance_init(.@instance);warp "1@farm", 0, 0; } else { mes "You dont own a Farm."; close; } case 2: query_sql "SELECT `status` FROM `tree_farm` WHERE `acc_id` = " + getcharid(3) + "", .@buy_check; if (.@buy_check == 0 ) { mes "^0000ffYou wanna buy a Farm for 1.000.000 Zeny?^000000"; switch(select("No:Yes")){ case 1: close; case 2: set @price, 1000000; if (Zeny<@price) { mes "Not enough Zeny"; close; } else { set Zeny, Zeny - @price; query_sql "INSERT INTO `tree_farm` (`acc_id`, `status`) VALUES ('"+getcharid(3)+"', '1')"; close; } } close; } case 3: close; }} Edited November 13, 2013 by Vincent Quote Share this post Link to post Share on other sites
0 Ind 945 Posted November 13, 2013 the server is being able to warp you into the map, and the resource-error shows the map name is correct, so therefore its a client problem (some file is not correctly setup), in the case you are unable to pinpoint the reason, you can have the server fool the client by telling it you're actually warping into 1@farm while you're not, to fool the client you need to make use of the optional parameters in the instace_attachmap script command *instance_attachmap("<map name>",<instance id>{,<use base name>{,"<new map name>"}});Attaches the map "<map name>" to the instance specified with <instance id>. The optional parameter specifies, whether a map requires emulation for instancing (1) or not (0 = default). if use base name is specified,and "<new map name>" too the server will instance the map under the "<new map name>",name.Returns the resulting map name on success or an empty string on failure.Example: instance_attachmap("prontera", .@instance_id,1,"via");^ the above creates a instance (or clone) of prontera, on a map called "via" Quote Share this post Link to post Share on other sites
0 GrumpyPanda 0 Posted November 13, 2013 the server is being able to warp you into the map, and the resource-error shows the map name is correct, so therefore its a client problem (some file is not correctly setup), in the case you are unable to pinpoint the reason, you can have the server fool the client by telling it you're actually warping into 1@farm while you're not, to fool the client you need to make use of the optional parameters in the instace_attachmap script command *instance_attachmap("<map name>",<instance id>{,<use base name>{,"<new map name>"}});Attaches the map "<map name>" to the instance specified with <instance id>. The optional parameter specifies, whether a map requires emulation for instancing (1) or not (0 = default). if use base name is specified,and "<new map name>" too the server will instance the map under the "<new map name>",name.Returns the resulting map name on success or an empty string on failure.Example: instance_attachmap("prontera", .@instance_id,1,"via");^ the above creates a instance (or clone) of prontera, on a map called "via" Regarding this, I tried the instancing system using the wikis example (mostly done stuff with rA). Which made the client crash everytime when trying to enter the instance. The optional parameters fix it. But it is now more of a map reserve than an instance. After attaching the map to your party other parties can no longer join that instance. Trying to make a new instance with a new party now results in the following error. [Error]: instance_add_map: trying to create instanced map with existent name 'via'[Error]: buildin_instance_attachmap: instance creation failed (izlude): -2 @ maps like 1@def01 work just fine with the instasing system, but I though this patch was meant to allow using non @ maps. With non @ maps there can only be 1 instance active unless I am doing something wrong or do not understand the system. It also seems like its not possible to create a new instance even after the instance has timed out. Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted November 13, 2013 Get a var that is distinct for wach new party on the instance. For example: set .@i, 0;while (.@map$ == "") { // will fail until it finds a valid i, warning: possibility of getting lots of errors. set .@map$, instance_attachmap("1@farm", .@instance,1, "via" + .@i); set .@i, .@i + 1;} There are other cleaner methods to do this, but this one should work. Quote Share this post Link to post Share on other sites
0 GrumpyPanda 0 Posted November 14, 2013 (edited) I'd still suggest taking an another look at instancing to actually enable support for non @ maps without workarounds like that And after short testing it seems like the map name variables dont get reset until server reboot so the errors would pile up a lot. Edited November 14, 2013 by GrumpyPanda Quote Share this post Link to post Share on other sites
0 Mhalicot 392 Posted November 14, 2013 I'd still suggest taking an another look at instancing to actually enable support for non @ maps without workarounds like that Please read and one more is hercules support instance to map without "@" symbol? yes since the may 30th update.>Server may now create instances of any maps regardless of client-side edits, e.g. one can clone prontera and call it "mymapname" (as is best described in the *instance_attachmap script command note) Quote Share this post Link to post Share on other sites
0 GrumpyPanda 0 Posted November 14, 2013 I've read that. I just pointed out that its not possible to have more than one instance of a non @ map without a workaround like jaBote mentioned and even then it piles up a lot of errors. Quote Share this post Link to post Share on other sites
0 GrumpyPanda 0 Posted November 14, 2013 Yes, there. src4instance mapflag is the answer to the problem with non @ maps. Thank you. Problem with the attachmap additional parameter was that they don't get erased when instance is destroyed and reusing causes the error. (so the map names would eventually get enormous unless server is reset) Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted November 14, 2013 About that last thing, I think it's a serious name. Since I don't have access to script_commands.txt ATM, could you see if there's a way of destroying that map with the instance? Otherwise, maybe a bug weport should be filled out regarding this. Quote Share this post Link to post Share on other sites
0 GrumpyPanda 0 Posted November 18, 2013 (edited) I wasnt able to find a way. And when instance timer runs out the map should at least get deleted but it doesnt. and seems like src4instance wasn't the answer afterall. I was able to make it create a map "000#izlude" that worked (without optional parameters), I believe I was just using just the wiki example plus src4instance mapflag (and izlude as map) but I am not able to do that again. If someone can do that please show me how. Personally I think if its required to find a distinct var for each instance I'll rather just create the instance maps client side. Edited out some stuff, misunderstanding on my part. Edited November 19, 2013 by GrumpyPanda Quote Share this post Link to post Share on other sites
Hello,
i try to create a instance at a custom map called "1@farm".
If i warp to the map with the @warp command there is no problem. But if i try to enter the map via the Instance NPC the Client crashs and say:
I dont why this error came up.
my renametable:
Share this post
Link to post
Share on other sites