Leki wrote:Will we be able to work with classes? As "Floor" or "Wall" etc?
As a concept, objects themselves having classes doesn't really fit anymore into what we have now since the objects are now just a collection of components. For these cases, it might just be best see if you can detect the type of object you're looking for from its components and the properties of the components. For example, the item component has a traits-property which can be very useful when trying to detect an item that fits to a broad category such as "light_armor", "potion" or "axe".
Leki wrote:In other word, I'm thinking about multibrain AI - different behaviours, each as component - activated, deactivated on fly. I have some idea about multicell monsters and I wenna "read" their surroundings. So it will turn left right if there is space for that - usually pivot will stay in "main cell" etc.
If I understood correctly what you're aiming for here, all you would need is isBlocked, and isObstacle. There's no need to use object detection here since after all the floor assets themselves contain no functionality at all since they just have a mesh for visuals and could even provide misleading information: a cell with a floor on it could still be blocked by, say, an altar or a monster. Of course if you want to have different behaviors on different floor types, yeah, then you might need to detect the floor objects in addition to isBlocked and isObstacle, but for general movement it should be unnecessary.
Leki wrote:Another example of that is "custom minimap" - onGui cycle will track few cells around the party - You know, I have some sci-fi mod idea and atm I play withsome "aliens like movement detector" - and I wanna see walls etc on that gadget... Another think is, that there can be some kind of dependence on scanner level, mapmaking skill level etc, so "minimap can be" draw in different "quality levels" - with or without secret doors etc...
Cool idea! For this, I'd start off with isWall and isObstacle for getting the level layout and then fill in the rest (monsters, doors, secret doors, items etc.) by checking out if the objects can be detected via their components: monsters always have a monster component, items have item, doors have door etc. Separating secret doors from normal doors is more tricky though and there I would
probably use getDoorSound to detect if a door is supposed to be secret or not.