Hi all! I want to make a RPG game, so I've started with Lua scripts. I wrote the simple script for the books in the game.
function book_active_init(e)
LoadImages("Thetest8_15", 0)
end
function book_active_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 150 and g_KeyPressE == 0 then
SetImagePosition(50, 80)
ShowImage(0)
elseif PlayerDist < 150 and g_KeyPressE == 1 then
SetImagePosition(50, 50)
ShowImage(1)
else
HideImage(1)
HideImage(0)
end
end
I assigned it to the one entity (the book, naturally) and it works. But when I assigned it to the other entity (the bookshelf) - it doesn't work! How is it possible? That's the same script. I'm in trouble
Where is my mistake?
And one another script and one another strange problem. I have my folder in the "images" folder and it has 4 pics (000.png, 001.png etc). And "book_active" works (at least one time), but this script doesn't work:
function beardguy_init(e)
CharacterControlUnarmed(e)
LoadImages("Thetest8_15", 0, 1, 2)
end
function beardguy_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 150 then
LookAtPlayer(e)
SetImagePosition(50, 80)
ShowImage(2)
end
end
Can I ask your advice about it? How should I write the LoadImages, if I want to have hundreds images here?
Thank you!