Issue Information
-
#004984
-
1 - Low
-
Fixed
Issue Confirmations
-
Yes (4)No (0)
Originally posted by ~AnnieRuru~
http://www.eathena.w...er&showbug=4984
http://eathena-proje...t_duplicate.txt
if you test this script these 3 porings always tells you same coordinate,
because the npc variable overwriting each other
it should use an array or getd ...
maybe something like this
but please do not revert the npc variable to not sharing among duplicates,
because some of our event scripts which uses duplicates already adept to this system
This post has been edited by ~AnnieRuru~: Jun 27 2011, 06:03 AM
http://www.eathena.w...er&showbug=4984
http://eathena-proje...t_duplicate.txt
CODE
// Outcome (r11216 trunk):
// * the variables are _shared_ between all duplicates
yes it is// * the variables are _shared_ between all duplicates
if you test this script these 3 porings always tells you same coordinate,
because the npc variable overwriting each other
it should use an array or getd ...
maybe something like this
CODE
- script Test Script -1,1,1,{
mes "Hi.";
set .@id, atoi( strnpcinfo(2) );
mes "My coords are "+ .map$[.@id] +", "+ .x[.@id] +"/" +.y[.@id];
close;
OnInit:
set .@id, atoi( strnpcinfo(2) );
getmapxy .map$[.@id], .x[.@id], .y[.@id], 1;
end;
OnTouch:
emotion e_scissors;
end;
}
prontera,150,175,4 duplicate(Test Script) Test1#1 909
prontera,155,175,4 duplicate(Test Script) Test2#2 909,2,2
prontera,160,175,4 duplicate(Test Script) Test3#3 909,3,3
mes "Hi.";
set .@id, atoi( strnpcinfo(2) );
mes "My coords are "+ .map$[.@id] +", "+ .x[.@id] +"/" +.y[.@id];
close;
OnInit:
set .@id, atoi( strnpcinfo(2) );
getmapxy .map$[.@id], .x[.@id], .y[.@id], 1;
end;
OnTouch:
emotion e_scissors;
end;
}
prontera,150,175,4 duplicate(Test Script) Test1#1 909
prontera,155,175,4 duplicate(Test Script) Test2#2 909,2,2
prontera,160,175,4 duplicate(Test Script) Test3#3 909,3,3
but please do not revert the npc variable to not sharing among duplicates,
because some of our event scripts which uses duplicates already adept to this system
This post has been edited by ~AnnieRuru~: Jun 27 2011, 06:03 AM
Originally posted by GodLesZ
Uhm.. maybe its to early for me, but shouldnt the OnTouch event overwrite the existing .map$ and coordinate variables?
Therefore the coordinates should be different.
Uhm.. maybe its to early for me, but shouldnt the OnTouch event overwrite the existing .map$ and coordinate variables?
Therefore the coordinates should be different.
Originally posted by Kenpachi
Temporary NPC variables should be flushed when the instance runs out. So in my opinion the sample should use permanent variables.
Temporary NPC variables should be flushed when the instance runs out. So in my opinion the sample should use permanent variables.
Originally posted by Kenpachi
I just tested the script and it's true that the duplicates share the variables. All three showed "My coords are prontera, 155/175".
That's something a core dev should take care of ASAP I think!
I just tested the script and it's true that the duplicates share the variables. All three showed "My coords are prontera, 155/175".
That's something a core dev should take care of ASAP I think!
this is not a core problem it is a documentation problem (npcs duplicates have been modified to be a link to the original npc script instead of a actual duplicate loong time ago in eathena). moving to documentation.
fixed in
https://github.com/H...060d0fc56d265b6
when I test with this script, I always get this result
https://github.com/H...060d0fc56d265b6
when I test with this script, I always get this result
[Debug]: script debug : 0 110000003 : Test3 [Debug]: script debug : 0 110000002 : Test2 [Debug]: script debug : 0 110000001 : Test1 [Debug]: script debug : 0 110000000 : Test Scriptit anyone gets a different result please tell
changed status to: Fixed