Scripts / Waypoint and stop

Author
Message
Avenging Eagle
19
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 25th Jun 2017 16:55
Can some write me an explanation of how the waypoints system works? What are the values of 'PathIndex' and 'PointIndex' and how are they different from one another? Is 'pClosest' the nearest point? (In which case, why is it 99999 by default?) The whole system confuses me greatly...

I want to write a script where a character will pause for 4 seconds at each waypoint node while patrolling, and another script where they will get to the end of their waypoint path and idle indefinitely.

AE

AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 25th Jun 2017 17:20
Each set of waypoints or 'path' that you lay down in the editor is a separate array of points. PathIndex specifies which path you want to refer to and the PointIndex specifies which waypoint in that path you refer to.

Been there, done that, got all the T-Shirts!
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 25th Jun 2017 19:56
as amen said, each entire path has a number given to it - this is 'PathIndex' (the first path placed should be 1, 2nd path is 2 etc)
and also a number for each point (or node) in that path - this is 'PointIndex' (this goes from 1 to however many nodes you add)
pClosest is the range or distance of the node from the character running the script - so 9999 is just a default value to make sure the first distance check is as big as possible.

the ends of the path can be found with 1 or AIGetPathCountPoints(PathIndex)

lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Avenging Eagle
19
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 26th Jun 2017 19:17 Edited at: 26th Jun 2017 19:17
I've come to the conclusion this whole module-based AI is way beyond my amateur coding skills. I'm pretty sure I've tracked down roughly the area I need to focus on but I don't know how to go about it tbh.

Lines 212 - 228 of module_combatcore.lua


Somewhere in here maybe?

AE

Login to post a reply

Server time is: 2024-12-23 00:12:33
Your offset time is: 2024-12-23 00:12:33