How to find a lost item - except revisiting each tile
-
- Posts: 7
- Joined: Mon Jul 29, 2013 6:33 pm
How to find a lost item - except revisiting each tile
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!
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!
Re: How to find a lost item - except revisiting each tile
You can do a huge search code. If you have NO map markers, the code can be much simpler:
If you have map markers, you'll need to do more complex:
I think that should work. Remember, coordinates 0,0 are the top left and 31,31 are the bottom right
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
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
Finished Dungeons - complete mods to play
-
- Posts: 7
- Joined: Mon Jul 29, 2013 6:33 pm
Re: How to find a lost item - except revisiting each tile
Thanks for the code!
Can I run this code directly from the console or how can I run this search script?
Thanks!
Can I run this code directly from the console or how can I run this search script?
Thanks!
Re: How to find a lost item - except revisiting each tile
yes, from console, all one line just as I gave it
Finished Dungeons - complete mods to play
-
- Posts: 7
- Joined: Mon Jul 29, 2013 6:33 pm
Re: How to find a lost item - except revisiting each tile
Hmm, does not work for me.
It says: [string "user-input"]:1: 'then' expected near '='
...for both scripts.
It says: [string "user-input"]:1: 'then' expected near '='
...for both scripts.
Re: How to find a lost item - except revisiting each tile
oops, need double == before name code
Finished Dungeons - complete mods to play
-
- Posts: 7
- Joined: Mon Jul 29, 2013 6:33 pm
Re: How to find a lost item - except revisiting each tile
Great, it worked now! Thanks!
-
- Posts: 7
- Joined: Mon Jul 29, 2013 6:33 pm
Re: How to find a lost item - except revisiting each tile
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?
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?
Re: How to find a lost item - except revisiting each tile
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
You can see this thread for that part:
viewtopic.php?f=14&t=5578
Finished Dungeons - complete mods to play
-
- Posts: 7
- Joined: Mon Jul 29, 2013 6:33 pm
Re: How to find a lost item - except revisiting each tile
Ok, I wrote now this script to search all the alcoves:
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!
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
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!