Script function to find closest entity
Posted: 30 Oct 2014, 21:21
Would the OpenMW be able to implement a script function that returns the closest monster/NPC/player to a given object, point, or other entity?
Back when I played around with modding a lot. I spent a week trying to make a turret mod that automatically fired on anything that got too close to it. The best I could do was make it attack the player, nothing else. I couldn't figure out any way to have it detect NPCs and monsters without a 'pressure plate' of some kind. I could try making the turret out of a reskined monster with no melee attack, who couldn't move, had a single spell or crossbow, and either infinite magicka or bolts. Then I could make it aggressive to everything. I'm not sure if that would be a better option for my own personal mod idea. However, being able to find/list the closest entities seems like it would be very useful for future modding.
Back when I played around with modding a lot. I spent a week trying to make a turret mod that automatically fired on anything that got too close to it. The best I could do was make it attack the player, nothing else. I couldn't figure out any way to have it detect NPCs and monsters without a 'pressure plate' of some kind. I could try making the turret out of a reskined monster with no melee attack, who couldn't move, had a single spell or crossbow, and either infinite magicka or bolts. Then I could make it aggressive to everything. I'm not sure if that would be a better option for my own personal mod idea. However, being able to find/list the closest entities seems like it would be very useful for future modding.