Jump to content

entity following the player


aldoz
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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.

  • Upvote 1
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...