1+ #if defined _TANKGLOW_DEFINES_included
2+ #endinput
3+ #endif
4+ #define _TANKGLOW_DEFINES_included
5+
6+ #define KEY_THEESCAPEROUTE " TheEscapeRoute"
7+ #define KEY_GETPOSITIONONPATH " CEscapeRoute::GetPositionOnPath"
8+ #define KEY_ISSPACEFORZOMBIEHERE " ZombieManager::IsSpaceForZombieHere"
9+ #define KEY_GETNEXTESCAPESTEP " TerrorNavArea::GetNextEscapeStep"
10+ #define KEY_ISVALIDFORWANDERINGPOPULATION " TerrorNavArea::IsValidForWanderingPopulation"
11+ #define KEY_m_vecCenter " CNavArea::m_vecCenter"
12+ #define KEY_m_bIsUnderwater " TerrorNavArea::m_bIsUnderwater"
13+ #define KEY_m_activeSurvivors " TerrorNavArea::m_activeSurvivors"
14+ #define KEY_m_connect " CNavArea::m_connect"
15+
16+ static Handle
17+ s_hSDKCall_GetPositionOnPath ,
18+ s_hSDKCall_IsSpaceForZombieHere ,
19+ s_hSDKCall_GetNextEscapeStep ,
20+ s_hSDKCall_IsValidForWanderingPopulation ;
21+
22+ static Address
23+ s_addr_TheEscapeRoute ;
24+
25+ static int
26+ s_iOffs_m_vecCenter ,
27+ s_iOffs_m_bIsUnderwater ,
28+ s_iOffs_m_activeSurvivors /* ,
29+ s_iOffs_m_connect*/ ;
30+
31+ methodmap CEscapeRoute
32+ {
33+ public void GetPositionOnPath (float flow , float vPos [3 ]) {
34+ SDKCall (s_hSDKCall_GetPositionOnPath , this , flow , vPos );
35+ }
36+ }
37+
38+ CEscapeRoute TheEscapeRoute ()
39+ {
40+ return view_as <CEscapeRoute >(LoadFromAddress (s_addr_TheEscapeRoute , NumberType_Int32 ));
41+ }
42+
43+ /* methodmap NavConnectVector
44+ {
45+ public TerrorNavArea Element(int i) {
46+ return LoadFromAddress(this.m_pData + view_as<Address>(8 * i + 4), NumberType_Int32);
47+ }
48+ public int Count() {
49+ return LoadFromAddress(this.m_pData, NumberType_Int32);
50+ }
51+ property Address m_pData {
52+ public get() { return LoadFromAddress(view_as<Address>(this), NumberType_Int32); }
53+ }
54+ }*/
55+
56+ methodmap TerrorNavArea
57+ {
58+ public TerrorNavArea (float vPos [3 ]) {
59+ return view_as <TerrorNavArea >(L4D2Direct_GetTerrorNavArea (vPos , 120.0 ));
60+ }
61+ public TerrorNavArea GetNextEscapeStep (int &traverse_type = 0 ) {
62+ return SDKCall (s_hSDKCall_GetNextEscapeStep , this , traverse_type );
63+ }
64+ public bool IsValidForWanderingPopulation () {
65+ return SDKCall (s_hSDKCall_IsValidForWanderingPopulation , this );
66+ }
67+ public void GetCenter (float vec [3 ]) {
68+ vec [0 ] = LoadFromAddress (view_as <Address >(this ) + view_as <Address >(s_iOffs_m_vecCenter ), NumberType_Int32 );
69+ vec [1 ] = LoadFromAddress (view_as <Address >(this ) + view_as <Address >(s_iOffs_m_vecCenter + 4 ), NumberType_Int32 );
70+ vec [2 ] = LoadFromAddress (view_as <Address >(this ) + view_as <Address >(s_iOffs_m_vecCenter + 8 ), NumberType_Int32 );
71+ }
72+ property bool m_isUnderwater {
73+ public get () { return !! LoadFromAddress (view_as <Address >(this ) + view_as <Address >(s_iOffs_m_bIsUnderwater ), NumberType_Int8 ); }
74+ }
75+ property int m_activeSurvivors {
76+ public get () { return LoadFromAddress (view_as <Address >(this ) + view_as <Address >(s_iOffs_m_activeSurvivors ), NumberType_Int8 ); }
77+ }
78+ /* public NavConnectVector GetConnectVector(int dir) {
79+ if (g_bLeft4Dead2) {
80+ return LoadFromAddress(view_as<Address>(this) + view_as<Address>(s_iOffs_m_connect + 4 * dir), NumberType_Int32);
81+ }
82+ }*/
83+ }
84+ #define NULL_NAV_AREA view_as <TerrorNavArea >(0 )
85+
86+ methodmap CZombieManager
87+ {
88+ public bool IsSpaceForZombieHere (const float vPos [3 ]) {
89+ return SDKCall (s_hSDKCall_IsSpaceForZombieHere , L4D_GetPointer (POINTER_ZOMBIEMANAGER ), vPos );
90+ }
91+ }
92+
93+ void LoadSDK ()
94+ {
95+ Handle conf = LoadGameConfigFile (GAMEDATA_FILE );
96+ if (! conf )
97+ SetFailState (" Missing gamedata \" " ...GAMEDATA_FILE ..." \" " );
98+
99+ StartPrepSDKCall (SDKCall_Raw );
100+ if (! PrepSDKCall_SetFromConf (conf , SDKConf_Signature , KEY_GETPOSITIONONPATH ))
101+ SetFailState (" Missing signature " ...KEY_GETPOSITIONONPATH ..." " );
102+ PrepSDKCall_AddParameter (SDKType_Float , SDKPass_Plain );
103+ PrepSDKCall_AddParameter (SDKType_Vector , SDKPass_ByRef , _ , VENCODE_FLAG_COPYBACK );
104+ s_hSDKCall_GetPositionOnPath = EndPrepSDKCall ();
105+ if (s_hSDKCall_GetPositionOnPath == null )
106+ SetFailState (" Failed to prepare SDKCall for \" " ...KEY_GETPOSITIONONPATH ..." \" " );
107+
108+ StartPrepSDKCall (SDKCall_Raw );
109+ if (! PrepSDKCall_SetFromConf (conf , SDKConf_Signature , KEY_ISVALIDFORWANDERINGPOPULATION ))
110+ SetFailState (" Missing signature " ...KEY_ISVALIDFORWANDERINGPOPULATION ..." " );
111+ PrepSDKCall_SetReturnInfo (SDKType_Bool , SDKPass_Plain );
112+ s_hSDKCall_IsValidForWanderingPopulation = EndPrepSDKCall ();
113+ if (s_hSDKCall_IsValidForWanderingPopulation == null )
114+ SetFailState (" Failed to prepare SDKCall for \" " ...KEY_ISVALIDFORWANDERINGPOPULATION ..." \" " );
115+
116+ StartPrepSDKCall (SDKCall_Raw );
117+ if (! PrepSDKCall_SetFromConf (conf , SDKConf_Signature , KEY_ISSPACEFORZOMBIEHERE ))
118+ SetFailState (" Missing signature " ...KEY_ISSPACEFORZOMBIEHERE ..." " );
119+ PrepSDKCall_AddParameter (SDKType_Vector , SDKPass_ByRef );
120+ PrepSDKCall_SetReturnInfo (SDKType_Bool , SDKPass_Plain );
121+ s_hSDKCall_IsSpaceForZombieHere = EndPrepSDKCall ();
122+ if (s_hSDKCall_IsSpaceForZombieHere == null )
123+ SetFailState (" Failed to prepare SDKCall for \" " ...KEY_ISSPACEFORZOMBIEHERE ..." \" " );
124+
125+ StartPrepSDKCall (SDKCall_Raw );
126+ if (! PrepSDKCall_SetFromConf (conf , SDKConf_Signature , KEY_GETNEXTESCAPESTEP ))
127+ SetFailState (" Missing signature " ...KEY_GETNEXTESCAPESTEP ..." " );
128+ PrepSDKCall_AddParameter (SDKType_PlainOldData , SDKPass_Pointer , VDECODE_FLAG_ALLOWNULL );
129+ PrepSDKCall_SetReturnInfo (SDKType_PlainOldData , SDKPass_Plain );
130+ s_hSDKCall_GetNextEscapeStep = EndPrepSDKCall ();
131+ if (s_hSDKCall_GetNextEscapeStep == null )
132+ SetFailState (" Failed to prepare SDKCall for \" " ...KEY_GETNEXTESCAPESTEP ..." \" " );
133+
134+ s_addr_TheEscapeRoute = GameConfGetAddress (conf , KEY_THEESCAPEROUTE );
135+ if (s_addr_TheEscapeRoute == Address_Null )
136+ SetFailState (" Missing address \" " ...KEY_THEESCAPEROUTE ..." \" " );
137+
138+ s_iOffs_m_vecCenter = GameConfGetOffset (conf , KEY_m_vecCenter );
139+ if (s_iOffs_m_vecCenter == - 1 )
140+ SetFailState (" Missing offset \" " ...KEY_m_vecCenter ..." \" " );
141+
142+ s_iOffs_m_bIsUnderwater = GameConfGetOffset (conf , KEY_m_bIsUnderwater );
143+ if (s_iOffs_m_bIsUnderwater == - 1 )
144+ SetFailState (" Missing offset \" " ...KEY_m_bIsUnderwater ..." \" " );
145+
146+ s_iOffs_m_activeSurvivors = GameConfGetOffset (conf , KEY_m_activeSurvivors );
147+ if (s_iOffs_m_activeSurvivors == - 1 )
148+ SetFailState (" Missing offset \" " ...KEY_m_activeSurvivors ..." \" " );
149+
150+ /* if (g_bLeft4Dead2)
151+ {
152+ s_iOffs_m_connect = GameConfGetOffset(conf, KEY_m_connect);
153+ if (s_iOffs_m_connect == -1)
154+ SetFailState("Missing offset \""...KEY_m_connect..."\"");
155+ }*/
156+
157+ delete conf ;
158+ }
0 commit comments