[help] Iterating to find items

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
lejonmanen
Posts: 4
Joined: Sun Dec 30, 2012 1:57 pm

[help] Iterating to find items

Post 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
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: [help] Iterating to find items

Post 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
Finished Dungeons - complete mods to play
lejonmanen
Posts: 4
Joined: Sun Dec 30, 2012 1:57 pm

Re: [help] Iterating to find items

Post by lejonmanen »

Thanks a lot!

/David
Post Reply