1 #insert scripts\shared\ai\systems\behavior_tree.gsh;
3 #namespace BehaviorTreeNetwork;
8 if ( !IsDefined( level._BehaviorTreeScriptFunctions ) )
10 level._BehaviorTreeScriptFunctions = [];
14 functionName = ToLower( functionName );
16 Assert( IsDefined( functionName ) && IsDefined( functionPtr ),
"BT - (RegisterBehaviorTreeScriptAPI) No functionPtr defined or no functionName defined for BehaviorTreeScript." );
17 Assert( !IsDefined( level._BehaviorTreeScriptFunctions[functionName] ),
"BT - (RegisterBehaviorTreeScriptAPI) functionName is already defined for BehaviorTreeScript." );
19 level._BehaviorTreeScriptFunctions[functionName] = functionPtr;
25 if ( !IsDefined( level._BehaviorTreeActions ) )
27 level._BehaviorTreeActions = [];
30 actionName = ToLower( actionName );
32 Assert( IsString( actionName ),
"BT - actionName for RegisterBehaviorTreeActionInternal is not a string." );
33 Assert( !IsDefined(level._BehaviorTreeActions[actionName]),
"BT - (RegisterBehaviorTreeActionInternal) actionName " + actionName +
" is already registered." );
35 level._BehaviorTreeActions[actionName] =
array();
38 if( IsDefined( startFuncPtr ) )
40 Assert( IsFunctionPtr( startFuncPtr ),
"BT - BehaviorTreeAction startFuncPtr must be of type functionPtr." );
45 if( IsDefined( updateFuncPtr ) )
47 Assert( IsFunctionPtr( updateFuncPtr ),
"BT - BehaviorTreeAction updateFuncPtr must be of type functionPtr." );
52 if( IsDefined( terminateFuncPtr ) )
54 Assert( IsFunctionPtr( terminateFuncPtr ),
"BT - BehaviorTreeAction terminateFuncPtr must be of type functionPtr." );
60 #namespace BehaviorTreeNetworkUtility;