Lua: Event.Hook()

VheliumVhelium Join Date: 2012-11-24 Member: 173049Members
Hello guys,

As I'm handling with the lua code of NS2 to create various additions, I met the following problem:
In the code they hook functions with a string in an Event.
Like in Shared.lua, line 250:

<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>// Set the callback functon when there's a trigger
Event.Hook("PhysicsTrigger", OnPhysicsTrigger)</div>

But I did not find any call of an Event.
So where and how are those Events called, for example when an Entity moves in a special area (PhysicsTrigger)?

Secondly, I'm wondering where are the Techpoints in the maps defined?
In the editor the place where Techpoints should be is just an empty space.
And the warm-up room is also not existing.

Would be glad if someone can help me out here.
Thanks.

Greetings Vhelium

Comments

  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
    edited December 2012
    1) The events are called directly from the Engine, you can't find them in the lua code.
    2) Techpoints are defined as a class, in the TechPoint.lua (TechPoint.kMapName = "tech_point")
    The kMapName is the same like in the editor so the engine know which class to load when loading that entity.
    All mapping entities you can use are defined in the "Editor_Setup.xml"
  • VheliumVhelium Join Date: 2012-11-24 Member: 173049Members
    Well, you just explained everything that was unclear for me.
    About the techpoints, I was so concentrated on the engine because I didnt find the Events in the Lua code, that I overlooked the Techpoint class..
    Thank you very much for your help, Jim West.
Sign In or Register to comment.