All properties except these:
“name” returns the name of the entity
“id” returns the unique identifier of the entity
“x” returns the x-coordinate of the entity on the map
“y” returns the y-coordinate of the entity on the map
“facing” returns the facing of the entity (0=north, 1=east, 2=south, 3=west)
“level” returns the dungeon level index of the entity
are private and can't be accessed from code. I don't know why, but that's how it is.
If you want to check the type of entity, you have to do it by using name-property. You have to list all entities to table and check if entity names is in that table.
Example:
Code: Select all
local monstersList = {
"crab"=true,"crowern"=true,"cube"=true,"goromorg""=true,"green_slime""=true,"herder""=true,"herder_big""=true,
...
}
function checkIfIsMonster(entity)
return monstersList[entity.name] ~= nil
end
I have posted a list of almost all entity names in lua table format to useful scripts thread.