Issue information

Issue ID
#5912
Status
Unable to Reproduce
Severity
None
Started
Hercules Elf Bot
Jun 3, 2012 10:14
Last Post
Hercules Elf Bot
Jun 23, 2012 9:49
Confirmation
Yes (0)
No (1)

Hercules Elf Bot - Jun 3, 2012 10:14

Originally posted by [b]wend[/b]
I described my problem here:
[url="http://rathena.org/board/topic/64685-custom-instance-map/"]http://rathena.org/b...m-instance-map/[/url]

In function "instance_add_map" i added:

[CODE]
memcpy( &map[im], &map[m], sizeof(struct map_data) ); // Copy source map
snprintf(map[im].name, MAP_NAME_LENGTH, (usebasename ? "%.3d#%s" : "%.3d%s"), instance_id, name); // Generate Name for Instance Map
map[im].index = mapindex_addmap(-1, map[im].name); // Add map index

+ShowDebug("Name %s\n", map[im].name);
+ShowDebug("Index %d\n", map[im].index);
+ShowDebug("%s\n", mapindex_id2name(map[im].index));
[/CODE]

when instance created:

[CODE]
[Debug]: Name 001#1@test
[Debug]: Index 841
[Debug]: 001#1@test
[/CODE]

but char-server show debug message:

[CODE][Debug]: mapindex_id2name: Requested name for non-existant map index [841] in cache.[/CODE]

Hercules Elf Bot - Jun 9, 2012 12:28

Originally posted by [b]wend[/b]
need help

This post has been edited by wend on Jun 9, 2012 12:28

Hercules Elf Bot - Jun 9, 2012 21:00

Originally posted by [b]Xantara[/b]
[b]Unable to reproduce[/b]...

I used the following script but no debug message in any of the server screens:
[CODEBOX]
set .@id, instance_id(1);
if(.@id)
instance_destroy (.@id);
// Store the Party ID of the invoking character.
set .@party_id, getcharid(1);
// Attempt to create an instance using that party ID.
set .@id, instance_create("Test Instance", .@party_id);
if (.@id == -1) { // Invalid type - not used anymore
mes "Error 1";
close;
}
else if (.@id == -2) { // Invalid Party ID
mes "Error 2";
close;
}
else if (.@id == -3) { // No free instances (MAX_INSTANCE exceeded)
mes "Error 3";
close;
}
else if (.@id == -4) { // Already exists
mes "Error 4";
close;
}
else if(.@id < 0) { // Unspecified error while queuing instance.
mes "Error 0";
close;
}
mes "Good 1";
next;
instance_attach(.@id);
mes "Good 2";
next;
instance_set_timeout 14400,300,.@id;
mes "Good 3";
next;
instance_init(.@id);
mes "Good 4";
close2;
warp "1@test",0,0;
end;
[/CODEBOX]

How did you create the map? Did you use BrowEdit and saved it under that name? Or did you copy a map and did a file rename?

This post has been edited by Xantara on Jun 9, 2012 21:01

Hercules Elf Bot - Jun 15, 2012 12:16

Originally posted by [b]wend[/b]
Take the any default instance (Orc's Memory for example), replace all "1@orcs" for any existing map ("izlude" for example), replace:

[CODE]
for( set .@i, 1; .@i <= 2; set .@i, .@i + 1 ) {
if( instance_attachmap(.@i + "@orcs", .@instance) == "" )
break;
}
if( .@i < 2 ) {
instance_destroy(.@instance);
close;
}
[/CODE]

with:

[CODE]
instance_attachmap("izlude", .@instance, 1);
[/CODE]

enter to instance and wait for character save.

This post has been edited by wend on Jun 15, 2012 12:17

Hercules Elf Bot - Jun 15, 2012 12:35

Originally posted by [b]EvilPuncker[/b]
[color=#ff8c00]ALL instance maps SHOULD start with a number and an @[/color]

Hercules Elf Bot - Jun 15, 2012 13:27

Originally posted by [b]wend[/b]
http://rathena.org/wiki/Instancing

[quote]Only maps, that begin with a number and @ (e. g. 1@tower) are recognized as instance map by the client. If you want to use a map, that does not match this naming scheme, just must attach it with emulation (parameter <use basename> in command instance_attachmap), which makes the client think, that it is on the actual map, instead of an instance.[/quote]