Berserker
Posts: 16720
|
Lua is used in most games, like HMM 5 or Fallout. It's quite fast and expressive. All ERM features remain still. With Lua there is no border between scripts and plugins.
Code:
local NO_MON = -1
-- Given hero ID. Returns slot without creatures or false on failure
function findFreeSlot (heroId)
erm.y[1] = heroId
for i = 0, 6 do -- repeat from 0 to 6
erm.y[2] = i
erm('HEy1:C0/y2/?y3/?y4')
if y3 == NO_MON then
return i
end
end
return false
end
local freeSlot = findFreeSlot(0) -- find free slot for Orrin
if freeSlot then
print('Found ' .. freeSlot)
else
print('Not found ((')
end
Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
|
|
05.01.2018 22:29 |
|