I made a simple script which can be used to list different types of entities in dungeon:
Code: Select all
enabled = false
result = {}
function entities(eClass)
result = {}
grimq.fromAllEntitiesInWorld():where(
function(e)
if e.class and e.class == eClass then
table.insert(result,e.name..' X:'..e.x..', Y:'..e.y..', L:'..e.level..', ID:'..e.id)
end
end
)
enabled = true
end
function sort()
table.sort(result)
end
function items(type)
result = {}
grimq.fromAllEntitiesInWorld():where(
function(e)
if e.class and e.class == 'Item' then
if not type or fw.lists['item'][type][e.name] then
if type == 'weapon' and e.name == 'torch' then else
table.insert(result,e.name..' X:'..e.x..', Y:'..e.y..', L:'..e.level..', ID:'..e.id)
end
end
end
end
)
enabled = true
end
function disable()
enabled = false
end
function draw(g)
local currentCol = 0
local count = #result
local row = 1
for i = 1, count do
local col = math.floor(i/40)
if currentCol ~= col then
row = 1
currentCol = col
end
g.drawText(result[i], 20 + (col * 500), 20*row)
row = row + 1
end
end
name it for example to a report and add this to the party_onDrawGui-hook
Code: Select all
if report.enabled then
report.draw(g)
end
Usage example (type in in console)
report.entities('Monster') lists all monsters, this is trivial of course but item function is more useful
report.items('potion') -- lists all potions (native only)
report.items('weapon') -- lists all melee weapons (native only)
report.items('armor') -- lists all armors (native only)
report.items('custom') -- lists all custom items
All supported item subtypes are: weapon,shield,accessory,bomb,food,missileweapon,tome,armor,cloth,herb,machinepart,potion,staff,treasure,container,key,miscitem,scroll,throwingweapon
report.sort() -- sorts the result in alphabetical order by entity name
report.disable() --closes the report
I thought that this could be useful for balancing the dungeon so I post it here. I wish that there was a way to print these in file, would be much more useful.