Excellent, i wil work on this. not sure i can understand what's going on in thereIsaac wrote: ↑Wed Oct 17, 2018 8:38 am There is a built in iterator for this.Code: Select all
for level = 1, Dungeon:getMaxLevels() do for obj in Dungeon.getMap(level):allEntities() do if obj.lock or obj.door then print('Name:',obj.name, "ID:" obj.id, "Level:",obj.level) end end end
good, i'll give i look, i need to learn much more about lua scripting and specially the LoG2 references*Also... KhrougH, there is a better and more up-to-date scripting reference than the one featured on this site; (thanks to JKos and minmay).
https://github.com/JKos/log2doc/wiki
it never crashed because i have a door for every lock so they have the same number. i mean for lock_1 i have door_1 , for lock_'n' i have door_'n'. but of corse my ignorance about script is pretty clear i will change it.** In the above (spoilered) condition: if (DL or OD) == nil then break ...end, it only breaks if DL and OD are both nil at the same time—and not when just one of them is nil. That's a crash if it ever finds one but not both.
thank you, Isaac