Skip to content

NHF – new heroes for Heroes V 3.1.

User Avatar
#1761
Auto-translated
For example, I tested sleep() and sleep(0.1), and sleep(1).
The first one sometimes doesn't have enough time. The second one is fine, the third one takes too long.))
Does it really discard the decimal part? Something's not right here. Multithreading.
sleep() is analogous to sleep(1).
sleep(0.1) is analogous to sleep(intg(0.1)), i.e., sleep(0).
I just tried a simple script:
for i=1,1000 do
print(""..i)
sleep(1)
print(""..i)
sleep(.999)
end

Mode: network. The numbers appear in pairs - blue i-1 and red i - with an interval of 1/5 second.
If sleep accepted decimal values, the numbers would appear one at a time.

Added after 48 minutes
Here's a more illustrative example.
while 1 do
local effect = "/Effects/_(Effect)/Spells/Bloodlust.xdb#xpointer(/Effect)"
for i=1,20 do
PlayVisualEffect(effect, '', '', 24+i, 20)
sleep(.999)
end
for i=1,20 do
PlayVisualEffect(effect, '', '', 24+i, 24)
sleep(1)
end
sleep(20)
end
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4