How to find a lost item - except revisiting each tile

This is the forum for helping you out if you're stuck or if you want to discuss the nitty gritty details of the dungeons within Mount Grimrock. Warning: forum contains spoilers!
RobinSword
Posts: 7
Joined: Mon Jul 29, 2013 6:33 pm

How to find a lost item - except revisiting each tile

Post by RobinSword »

Hi there!

Seems to be a simple question, but I didn't find an answer to it with a quick search.

I dropped my bone amulets... considering them worthless... somewhere... I absolutely do not remember where... .
Now on level 9 I need one to open the iron door.
Is there any way - e.g. by using console commands - to find out where I dropped them or at least one of them?
I do not want to use the "spawn" command to spawn one because that's bad cheating.
But I really would like to know where the bone amulets are currently located so that I can go back and fetch them.
May be soft cheating, I know, but better than spawning. ;)
I tried the "findEntity" console command but it didn't work out.

Any help?

Thanks!
User avatar
Komag
Posts: 3654
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: How to find a lost item - except revisiting each tile

Post by Komag »

You can do a huge search code. If you have NO map markers, the code can be much simpler:

Code: Select all

for i=1,9 do for j in allEntities(i) do if j.name="bone_amulet" then print(j.level,j.x,j.y) end end end
If you have map markers, you'll need to do more complex:

Code: Select all

for i=1,9 do for j=0,31 do for k=0,31 do for m in entitiesAt(i,j,k) do if m.name="bone_amulet" then print(m.level,m.x,m.y) end end end end end
I think that should work. Remember, coordinates 0,0 are the top left and 31,31 are the bottom right
Finished Dungeons - complete mods to play
RobinSword
Posts: 7
Joined: Mon Jul 29, 2013 6:33 pm

Re: How to find a lost item - except revisiting each tile

Post by RobinSword »

Thanks for the code!
Can I run this code directly from the console or how can I run this search script?

Thanks!
User avatar
Komag
Posts: 3654
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: How to find a lost item - except revisiting each tile

Post by Komag »

yes, from console, all one line just as I gave it
Finished Dungeons - complete mods to play
RobinSword
Posts: 7
Joined: Mon Jul 29, 2013 6:33 pm

Re: How to find a lost item - except revisiting each tile

Post by RobinSword »

Hmm, does not work for me.
It says: [string "user-input"]:1: 'then' expected near '='

...for both scripts.
User avatar
Komag
Posts: 3654
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: How to find a lost item - except revisiting each tile

Post by Komag »

oops, need double == before name code
Finished Dungeons - complete mods to play
RobinSword
Posts: 7
Joined: Mon Jul 29, 2013 6:33 pm

Re: How to find a lost item - except revisiting each tile

Post by RobinSword »

Great, it worked now! Thanks!
RobinSword
Posts: 7
Joined: Mon Jul 29, 2013 6:33 pm

Re: How to find a lost item - except revisiting each tile

Post by RobinSword »

I tried the script with some other items and it seems not to work in some cases.
E.g. if an item lies in an alcove or behind an iron door it is not found.
Is it possible to adapt the script so that those places are also searched for?
User avatar
Komag
Posts: 3654
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: How to find a lost item - except revisiting each tile

Post by Komag »

alcoves are different indeed (nothing to do with iron doors). You have to add even more complexity to the code, searching every item property so see if item.containedItems~=nil then for x in item.containedItems if x.name=="bone_amulet" blah blah blah

You can see this thread for that part:
viewtopic.php?f=14&t=5578
Finished Dungeons - complete mods to play
RobinSword
Posts: 7
Joined: Mon Jul 29, 2013 6:33 pm

Re: How to find a lost item - except revisiting each tile

Post by RobinSword »

Ok, I wrote now this script to search all the alcoves:

Code: Select all

for i=1,13 do for j=0,31 do for k=0,31 do for m in entitiesAt(i,j,k) do if m.containedItems~=nil then for x in m:containedItems() do if x.name=="lurker_hood" then print (x.level,x.name,m.x,m.y) end end end end end end end
It works fine for items lying inside the alcove on the shelf.
But the funny thing is: If an items lies in an alcove on the floor (not on the shelf!) it is not found! Neither by this script nor by the above.
So do I have to write a third script to search the alcove-floors and how would that look like?

Thanks for your continuous help!
Post Reply