- Joined
- Jun 26, 2020
- Messages
- 1,928
Hello, while I wanted to translate the Zwiebelchen's Threat System to Lua, during the Debug Board it checkes the handles that are existing in the map and to asign them an integer does an operation that involves creating 50 locations, get their handle ids and finally removing all of them every 0.05 seconds and display the result.
In the Jass version the result is around 500, it only changes a bit when a unit is created or removed in the game, but when I did the same thing in Lua, the numbers were totally different, it keeps increasing until reach some high value, in that case was about 55000, and then decreased to 0 and then increased again to about 110000 and then decreased to 0 and increased about to 170000, and again down to 0 and then up to 210000 and then I stopped.
I made a map to recreate that, I used GUI to be sure that the operation is the same in Jass and Lua, the results vary on if I null the locations after destroying them:
In the Jass version if I don't null the locations the result starts from about 230 and increases slowly, if I null the locations, the result increase even slower.
While in the Lua version if I don't nil the locations the result increases very fast until 110000 and then decreases and up again like I said earlier, if I nil the locations the process is the same, but the value that is reached before increasing again is lesser than before, something like 16000 at first.
THE RESULTS:
------------------------------------------------------------------------------------------------------------------------------------------------------------------
In Jass without nulling the locations:
------------------------------------------------------------------------------------------------------------------------------------------------------------------
In Jass with nulling the locations:
------------------------------------------------------------------------------------------------------------------------------------------------------------------
In Lua without niling the locations:
------------------------------------------------------------------------------------------------------------------------------------------------------------------
In Lua with niling the locations:
I'm not sure why is happening this, this is weird to me, with the handle ids being different between players in Lua, and also their instantiation, do you have any idea of why?
I share you the map to you can test it:
In the Jass version the result is around 500, it only changes a bit when a unit is created or removed in the game, but when I did the same thing in Lua, the numbers were totally different, it keeps increasing until reach some high value, in that case was about 55000, and then decreased to 0 and then increased again to about 110000 and then decreased to 0 and increased about to 170000, and again down to 0 and then up to 210000 and then I stopped.
I made a map to recreate that, I used GUI to be sure that the operation is the same in Jass and Lua, the results vary on if I null the locations after destroying them:
In the Jass version if I don't null the locations the result starts from about 230 and increases slowly, if I null the locations, the result increase even slower.
While in the Lua version if I don't nil the locations the result increases very fast until 110000 and then decreases and up again like I said earlier, if I nil the locations the process is the same, but the value that is reached before increasing again is lesser than before, something like 16000 at first.
THE RESULTS:
------------------------------------------------------------------------------------------------------------------------------------------------------------------
In Jass without nulling the locations:
------------------------------------------------------------------------------------------------------------------------------------------------------------------
In Jass with nulling the locations:
------------------------------------------------------------------------------------------------------------------------------------------------------------------
In Lua without niling the locations:
------------------------------------------------------------------------------------------------------------------------------------------------------------------
In Lua with niling the locations:
I'm not sure why is happening this, this is weird to me, with the handle ids being different between players in Lua, and also their instantiation, do you have any idea of why?
I share you the map to you can test it: