custom Instance script always kick the players out of the map

AnnieRuru

~~Cute~Cute~Scripter~~
Messages
1,677
Points
0
Location
your next door ~
Discord
AnnieRuru#1609
Github
AnnieRuru
Emulator
Client Version
2019-05-30aRagexeRE
I feel the need to make a topic about this, because many members has report about this bug

http://herc.ws/board/topic/4850-fight-your-clone/?p=31745

http://herc.ws/board/topic/4652-raid-instances/?p=30813

and I didn't make a bug report, because I'm not able to reproduce the bug
default_sad.png


.

I'm testing it right now and surprisingly, when I enter the instance the instance always destroyed and warp back the party in split seconds. Weird.
default_unsure.png
There are times when you can not enter the event, when players enter the map are immediately teleported out of the event.

This does not always happen.
..

.

the example script,

http://upaste.me/9b2110648e7662562

ok, I admit that I used a trick

instance_attachmap( "guild_vs2", .@ins, 1, getcharid(3)+"FYC" )which will make as many map as possibleand a new map is added everytime an user register this instance

1. is there some kind of map name that is invalid to use ?

because if accountID is 2001234, map name will be "2001234FYC" <-- string length :10, should be safe

2. I wonder is there a limit to how many maps that the server can create ?

I also wonder is there any hardcoded limit for how many maps the server can load

3. after the instance has destroy, do the map unload ?

when I wrote a custom job pvp script that each class has their own pvp room

http://rathena.org/board/topic/92946-job-vs-job-pvp/?p=246463 <-- advertising the awesomeness of hercules
default_tongue.png


I noticed that when the script loaded, there is some lag ... ok the map is loading

but when I reloadscript, there is no lag -> the map is still available and didn't unload ?

I thought those instance map should be destroyed the moment that instance_id destroy

funny about this is ... I asked Hadeszeus to change the instance_set_timeout

http://herc.ws/board/topic/4652-raid-instances/?p=30921

he said that will fix it ... ? but when I'm not able to reproduce this bug, I also uncertain about this

 
Last edited by a moderator:
its a bit late for me to test so I'll be doing the testing when I wake up, I'll be replying now though:

1. is there some kind of map name that is invalid to use ?

because if accountID is 2001234, map name will be "2001234FYC" <-- string length :10, should be safe
not to my knowledge, I have never played with map names that start with numbers though.
2. I wonder is there a limit to how many maps that the server can create ?
there is one limitation left on that which is mapindex.h MAX_MAPINDEX (might be soon dropped), which is currently 2000
but when I reloadscript, there is no lag -> the map is still available and didn't unload ?

I thought those instance map should be destroyed the moment that instance_id destroy
the instances have been made to be reload-persistent, they reset and the script can acknowledge this action on OnInstanceInit: which is run when the instance starts and when reloadscript happens -- you can use *instance_set_respawn(<map_name>,<x>,<y>{,<instance_id>}); to control the progress of the instance and where to teleport the users when reload happens ( e.g. if endless tower kept a instance var of the progress, i.e. 'Room, you could update instance_set_respawn on every room users clear, and when restart happens you just warp them to the begin of the room in question and respawn the monsters (as reloadscript clears the mobs, unfortunately) )
funny about this is ... I asked Hadeszeus to change the instance_set_timeout
hum O__O to my best memory permanent instances shouldn't call instance_set_timeout at all
 
not to my knowledge, I have never played with map names that start with numbers though.
long time ago, when the instance system was coded by zephirus (which later he started eamod, his coding very unoptimized)the instance system map name has to be '<number>@<seven character long>'

example : 1@tower

when instanced, the name will become 0011@tower

and doesn't support custom map name

we have to use dataresnametable.txt to duplicate a map that wasn't '<number>@<seven character long>' into this format

now both the instance system rewrite by hercules and rathena

hercules system : 1@tower become 0001@tower

custom map name: guild_vs2

instance_attachmap( "guild_vs2", .@ins, 1, getcharid(1)+"FYC" )that's my technique, unfortunately.

rathena system : 1@tower become 0011@tower

custom map name: guild_vs2 become 001#guild_vs2

.

by my experience, all instanced map always start with a number, so I don't think start with a number might be an issue

.

.

.

there is one limitation left on that which is mapindex.h MAX_MAPINDEX (might be soon dropped), which is currently 2000
2000 ... should be impossible to reach in just 1 weekmy test server says loaded 880 maps, means there should be 1120 maps free to use

but from the feedback from community members, they reply me in just 1 day after I finished the script

which must be means ... in just several hours after put on a live server ... this ... is sux ...

from what I gather, this kind of instance script works fine in test server,

but doesn't work 100% in live server, due to kicking out from the instance the moment the player went in

its not like crashing the server, which produce a core dump ...

so although we knew the way to reproduce in live server, but we couldn't able to locate what is the cause

.

.

.

the instances have been made to be reload-persistent, they reset and the script can acknowledge this action on OnInstanceInit: which is run when the instance starts and when reloadscript happens -- you can use *instance_set_respawn(<map_name>,<x>,<y>{,<instance_id>}); to control the progress of the instance and where to teleport the users when reload happens ( e.g. if endless tower kept a instance var of the progress, i.e. 'Room, you could update instance_set_respawn on every room users clear, and when restart happens you just warp them to the begin of the room in question and respawn the monsters (as reloadscript clears the mobs, unfortunately) )
ah ... now I just recall this one
I just debug it with getmapusers ...

with IOT_CHAR type it return -1

with IOT_NONE type it return 0

ok its fine for being like this, IOT_NONE shouldn't need to unload the map

so this one working correctly

.

.

.

hum O__O to my best memory permanent instances shouldn't call instance_set_timeout at all
actually what I meant it happens with IOT_CHAR or IOT_PARTY typeIOT_NONE type not included

with IOT_CHAR type (confirmed), they say when set the instance_time_out like this

instance_set_timeout 3600, 1, .@ins; // 1 hour for the map, 1 second to destroythey say the Memorial Dungeon is destroyed in 1 secthough, I'm not able to reproduce this bug even once

 
with IOT_CHAR type (confirmed), they say when set the instance_time_out like this

instance_set_timeout 3600, 1, .@ins; // 1 hour for the map, 1 second to destroythey say the Memorial Dungeon is destroyed in 1 secthough, I'm not able to reproduce this bug even once
I think that makes sense, you're setting idle for 1 second, meaning if the instance is left empty for 1 second or more it is destroyed (it might be destroyed even before you warp into it) -- I'm not sure why you can't reproduce.
 
(it might be destroyed even before you warp into it) -- I'm not sure why you can't reproduce.
oh yeah ... now I just remember something about getmapusers behaviourapparently the way server calculate map->list[m].users and sd->bl.m a little bit inconsistent

because the map->list[m].users doesn't count the player when that player still in the loading screen

means, if the player loads the map for more than 1 second, the map is consider empty

and my instance_time_out says only wait for 1 second, so it gets destroyed

its my scripting problem

there's some clue around at *maprespawnguildid script command

https://github.com/HerculesWS/Hercules/blob/master/src/map/script.c#L11326

 
Last edited by a moderator:
(it might be destroyed even before you warp into it) -- I'm not sure why you can't reproduce.
oh yeah ... now I just remember something about getmapusers behaviourapparently the way server calculate map->list[m].users and sd->bl.m a little bit inconsistent

because the map->list[m].users doesn't count the player when that player still in the loading screen

means, if the player loads the map for more than 1 second, the map is consider empty

and my instance_time_out says only wait for 1 second, so it gets destroyed

its my scripting problem

there's some clue around at *maprespawnguildid script command

https://github.com/HerculesWS/Hercules/blob/master/src/map/script.c#L11326
Its intentional, when a player moves out of a map the server removes it and keeps it in memory-limbo, it is only placed back within map bounds when its done loading -- so that a number of things only take effect when you are really visible in the map, otherwise things like aoe damage would be able to hit you -- as well as monsters, while you werent even able to be visible, that also guarantees that other packets are not sent to you while you're into loading screen
 
that also guarantees that other packets are not sent to you while you're into loading screen
ahh ... now this sentence looks interesting
makes me remember there's also a bug when warp a character then setwall can cause client to crash

which also doesn't happen often

http://rathena.org/board/topic/89525-

btw move to script support and solved, its more like a support topic

 
Back
Top