As stated..
Is it at all possible to use a console command to locate where a specific item is and what level based on an item ID?
thanks for the help
The answer is yes—if you are asking whether such a thing is possible to make (on your own) and use it in the console.sapientCrow wrote: ↑Mon Jul 10, 2023 2:39 pm ...so could I console something that said check this level for this ID?
Code: Select all
Dungeon.getMap([level number]):allEntities()
Code: Select all
do
local_item_id = "serpent_staff_1"
for index = 1, Dungeon:getMaxLevels() do
for item in Dungeon.getMap(index):allEntities() do
if item.id == local_item_id 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')
return
end
end
end
hudPrint("No matching item was found")
end
Code: Select all
do
local_item_id = "tome_wisdom"
for index = 1, Dungeon:getMaxLevels() do
for item in Dungeon.getMap(index):allEntities() do
if item.id == local_item_id 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')
return
end
end
end
hudPrint("No matching item was found")
end
spawn as in spawn with consoleIsaac wrote: ↑Mon Jul 10, 2023 9:40 pm Try placing (not spawning) a serpent staff in the editor; test the preview to ensure that it's working as intended.
________________
I tested a blank map with a tome of wisdom, and the script located it.
_______________Code: Select all
do local_item_id = "tome_wisdom" for index = 1, Dungeon:getMaxLevels() do for item in Dungeon.getMap(index):allEntities() do if item.id == local_item_id 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') return end end end hudPrint("No matching item was found") end
When you say, "spawn", do you mean in-game, or in-editor, and do you mean spawn via console command, or by placement (with mouse) in the editor?