How to find a dropped item

Talk about anything related to Legend of Grimrock 2 here.
Post Reply
Kerban
Posts: 2
Joined: Mon May 29, 2023 3:33 am

How to find a dropped item

Post 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.
User avatar
Zo Kath Ra
Posts: 931
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: How to find a dropped item

Post 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 
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: How to find a dropped item

Post 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:
Kerban
Posts: 2
Joined: Mon May 29, 2023 3:33 am

Re: How to find a dropped item

Post 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!
Post Reply