aldoz Posted July 25, 2016 Share Posted July 25, 2016 Hi guys, I am trying to get an entity that move in direction of the player! I am using MonsterAI.lua but I notice that the object where I activate MonsterAI.lua can't move! even I provide a target to follow. Some of you have a solution? Quote Link to comment Share on other sites More sharing options...
Rick Posted July 25, 2016 Share Posted July 25, 2016 Does it have a mass on the physics tab > 0? 1 Quote Link to comment Share on other sites More sharing options...
Phodex Games Posted July 25, 2016 Share Posted July 25, 2016 Hi aldoz, Maybe you give us some more information, maybe part of the code or something. My tip is you start creating your own AI, search the web, gather information needed from the API Reference. Why? Well thats the best way learing how to fix problems on your own and to understand unfamiliar code and the community is still here to help you if you need it. Now lets come to your problem. In Leadwerks it is very easy to make an entity follow your player or go to a point. You can read more about this features here: Follow: http://www.leadwerks.com/werkspace/page/api-reference/_/entity/entityfollow-r697 Go To Point: http://www.leadwerks.com/werkspace/page/api-reference/_/entity/entitygotopoint-r700 This functions uses navigation mesh, so dont forget to build a NavMesh for your map!! I guess that may be your fault? Because if you use the original MonsterAI.lua there isn't much you can do wrong. 1 Quote Link to comment Share on other sites More sharing options...
thehankinator Posted July 25, 2016 Share Posted July 25, 2016 Did you build the nav mesh? 1 Quote Link to comment Share on other sites More sharing options...
aldoz Posted July 25, 2016 Author Share Posted July 25, 2016 In first, thank you to all you guys for fast answers! Does it have a mass on the physics tab > 0? I tried using no mass and mass >0 but nothing changes :\ Hi aldoz, Maybe you give us some more information, maybe part of the code or something. My tip is you start creating your own AI, search the web, gather information needed from the API Reference. Why? Well thats the best way learing how to fix problems on your own and to understand unfamiliar code and the community is still here to help you if you need it. Now lets come to your problem. In Leadwerks it is very easy to make an entity follow your player or go to a point. You can read more about this features here: Follow: http://www.leadwerks.com/werkspace/page/api-reference/_/entity/entityfollow-r697 Go To Point: http://www.leadwerks.com/werkspace/page/api-reference/_/entity/entitygotopoint-r700 This functions uses navigation mesh, so dont forget to build a NavMesh for your map!! I guess that may be your fault? Because if you use the original MonsterAI.lua there isn't much you can do wrong. Damn.. I think there is something I am missing.. I will read your links, I need to understand some logics about AI scripts and abut general lua programming Did you build the nav mesh? mmm interesting.. . No! I am not using nav mesh! So I suppose I need to incorporate my enemy object inside a nav mesh.. right? Can you provide me some sort of examples? Quote Link to comment Share on other sites More sharing options...
thehankinator Posted July 25, 2016 Share Posted July 25, 2016 For MosterAI.lua to work you need to build the nav mesh. Here is a tutorial on how to build the navmesh, it's about 2/3 down the page. http://www.leadwerks.com/werkspace/page/tutorials/_/ai-pathfinding-and-events-r28 1 Quote Link to comment Share on other sites More sharing options...
aldoz Posted July 25, 2016 Author Share Posted July 25, 2016 For MosterAI.lua to work you need to build the nav mesh. Here is a tutorial on how to build the navmesh, it's about 2/3 down the page. http://www.leadwerks.com/werkspace/page/tutorials/_/ai-pathfinding-and-events-r28 Thank you again Quote Link to comment Share on other sites More sharing options...
aldoz Posted July 25, 2016 Author Share Posted July 25, 2016 There is some way to translate the MonsterAI.lua to get it's working with full physics too? I notice the navigation, in these scripts, are made for flat surfaces; you notice that monsters are not handled by physics; Maybe I want too much Quote Link to comment Share on other sites More sharing options...
Phodex Games Posted July 26, 2016 Share Posted July 26, 2016 What do you mean with "full physics", I guess you want your AI to move on organic terrain like Mountains etc? Do you? Well other than using the Navigation commands, you can create your own kind of movement, using 100 % accurate physics. This works by setting your AI's model (Body) physics to prop for example and handle the movement with force commands. I woudnt recommend this. I actually used a technique featuring this, for a former project, because the engine I was using didn't support any navmeshing or similar tools. Because I havent tried AI/Navmesh behavior for organic landscapes I cant tell you how it works or behaves... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.