Page 1 of 1

[help] Iterating to find items

Posted: Thu Jan 03, 2013 9:48 pm
by lejonmanen
Hello,
I've been trying to find a specific item using the developer console. So far the best I've come up with is:

Code: Select all

it = allEntities(1)
n=5 for i in it do if i~=nil and i.getUIName~=nil then do if n<1 then break end n=n-1 print(i.name) end end end
This apparently works on the first two levels. What I really want is to find a particular scroll with the text "to depths beyond measure", in order to get its location on the map. But I'm kinda stumped. New to Lua, as well.

Thanks for any help,
/David

Re: [help] Iterating to find items

Posted: Thu Jan 03, 2013 9:57 pm
by Komag
I can tell you that in the original game that scroll starts out at x/y of 21/24. You could start a new game and do:
for i in entitiesAt(4,21,24) do print(i.id) end
(actually, I just tested that for you, the id is scroll1)
so now you can fire up your save game and do:
print(scroll1.level,scroll1.x,scroll1.y)
and it should give you the current level and x/y of the scroll

Re: [help] Iterating to find items

Posted: Wed Jan 09, 2013 12:11 am
by lejonmanen
Thanks a lot!

/David