Page 1 of 1

How to find a dropped item

Posted: Mon May 29, 2023 7:58 pm
by Kerban
I love that this game doesn't de-spawn items when you drop them, no matter how far away you travel. Sadly, I did not take advantage of the map markers to note where I dropped items, so I now find myself in a quandary. I need the
SpoilerShow
Serpent Staff
that I dropped somewhere, in order to
SpoilerShow
enter the Pyramid of Umas
.

I know that I could simply spawn a new one using the console, but that feels a little too much like cheating to me. I'd much rather find where I dropped it in the game. And since I didn't use map markers, I'd have to search literally everywhere. I'd rather not do that, either.

Is there a console command or script that can give me the location of the item? Perhaps in coordinates form or some such? Even if I have to run it once in each of the map locations, that would be better than searching every square in the game.

If not, just let me know and I'll fall back to my plan of spawning a new one instead. Thank you.

Re: How to find a dropped item

Posted: Mon May 29, 2023 9:41 pm
by Zo Kath Ra
Kerban wrote: Mon May 29, 2023 7:58 pm Is there a console command or script that can give me the location of the item? Perhaps in coordinates form or some such? Even if I have to run it once in each of the map locations, that would be better than searching every square in the game.

Code: Select all

for i = 1, Dungeon.getMaxLevels() do 
	for entity in Dungeon.getMap(i):allEntities() do 
		if entity.name == "serpent_staff" then 
			print("name:", entity.name, "x:", entity.x, "y:", entity.y, "map:", entity.map:getName()) 
		end 
	end 
end 

Re: How to find a dropped item

Posted: Mon May 29, 2023 9:59 pm
by Isaac
Paste the following into the Console.

Code: Select all

itemName = "serpent_staff" 

for index = 1, Dungeon:getMaxLevels() do 
		for item in Dungeon.getMap(index):allEntities() do 
			if item.name == itemName then 
				hudPrint("A matching item was found in "..item.map:getName().." ".."(level "..item.level..") @ tile X:"..tostring(item.x)..",Y:"..tostring(item.y)) 
				setMouseItem(item.item) 
				playSound("secret") party:spawn('blob') 		break 
			end 
		end 
	end 
__________

*Oops, Zo Kath Ra had already posted a good solution. :shock:

Re: How to find a dropped item

Posted: Wed May 31, 2023 11:02 pm
by Kerban
Awesome! So pasting that into the console will work, then?

I'll give it a shot tonight during my Twitch stream. Thank you both so much for your help!