Scripts / Is AIEntityGoToPosition working?

Author
Message
Corno_1
GameGuru Tool Maker
13
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 27th Dec 2017 19:56
Hi guys,
I want to create my own AI at the moment, so it do exactly what I want and I not must use the standard overthought scripts which are more complicated to read and to understand than ever before.

So I tried to get my head into how it works and I have my first problem:


This is my script and the AI should just go in the near of the player when I press E. It is a flat map with a single character.
But the AI just moves forward(I know there is the moveforward command).
Then I read the manual and it says:


So did I miss something? Is the preview broken in this part? Or is it just my game guru?

I would be happy if someone can answer my question.
Ebe Editor Free - Build your own EBE structures with easy and without editing any text files
Thread and Download
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 28th Dec 2017 07:26
You've only told it to go forwards
You now control the AI in 2 parts, 1 is the physics side of things which is controlled with commands like AIEntityGoToPosition (you won't see any visual effect but its needed for obstacle avoidance etc), while the other side of things are controlled by MoveForward etc (this will be visible but you will pass over obstacles or get incorrect results if it doesn't match the physics side.

So to answer your question, yes it works but you also need to update the rotation of your AI to match the physics (look for something like AIEntitySetRotation or maybe AISetRotation).
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 28th Dec 2017 16:28
here is the command to rotate your AI
SetRotation(e,0,AIGetEntityAngleY(g_Entity[e]['obj']),0)
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Corno_1
GameGuru Tool Maker
13
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 28th Dec 2017 20:22
Quote: "You now control the AI in 2 parts"

Now it makes sense. Thanks a lot

When I update the position it works like I wanted it
Here is the script for my path finding tests:
Ebe Editor Free - Build your own EBE structures with easy and without editing any text files
Thread and Download
PM

Login to post a reply

Server time is: 2024-04-20 16:38:41
Your offset time is: 2024-04-20 16:38:41