Forums Gallery Downloads LOGIN |REGISTER

[help] Register TacticalPointQuery

Please use this forum for questions on C++, Lua, XML, and any other languages used in CryENGINE development.


 

User avatar
OpenWebGL
Just getting started
Just getting started
 
Posts: 59
Member since: 19.06.2012, 19:38
Likes: 0

[help] Register TacticalPointQuery

Postby OpenWebGL » 27.06.2012, 19:33

Hi,
I am a beginner on both Lua script and TPS, and feel a little confused when going through the official documentation and the example files in TPS folder.

There are two different methods for registering TacticalPointQuery, what is the difference between them?

1) Call AI.RegisterTacticalPointQuery inside OnInit() function:
Code: Select all
AI.TacticalPositionManager.Grunt = AI.TacticalPositionManager.Grunt or {};
function AI.TacticalPositionManager.Grunt:OnInit()
       ...
end

2) Directly create a "AI.RegisterTacticalPointQuery" function call in lua file:
Code: Select all
Game\Scripts\AI\TPS/CivilianQueries.lua


Thank you for any help!

/ed
User avatar
beast
Senior Developer
Senior Developer
 
Posts: 903
Member since: 11.10.2011, 18:41
Location: Germany
Likes: 10

Re: [help] Register TacticalPointQuery

Postby beast » 28.06.2012, 09:24

Hi,

well the difference is the way of how these functions are called. When AI.RegisterTacticalPointQuery is outside of a function (in this case OnInit) its called right after the lua script is executed. The ones inside an OnInit function are only called by the TPS manager when his OnInit method got called. So basically it does not really matter...they all get loaded. I usually prefer the non-function way (like CivilianQueries.lua).

so long,
Oliver
User avatar
OpenWebGL
Just getting started
Just getting started
 
Posts: 59
Member since: 19.06.2012, 19:38
Likes: 0

Re: [help] Register TacticalPointQuery

Postby OpenWebGL » 28.06.2012, 18:18

Thank you for the reply! Indeed, both of them can be loaded correctly when initializing Initialising TPS. There is also no limited scope when using the first method, and the only benefit is showing the table name in logs when registering.


 
Connect and collaborate with CRYENGINE developers in the official Forums.
Visit the Gallery to share what you have created and be inspired by what others are creating with CRYENGINE.
Community