If you want to create your own custom AST you need to modify “ast_definitions.json” which is located in:
Black Ops 3 Root\share\raw\animtables
This file u can copy to your mod/map folder.
NOTE: U don’t have to add this into your .zone file. It will automatically recognize.
Mod/Map Root\animtables
You only need to add another JSON object at the bottom for example.
{ "name": "_custom_move_speed", "parentColumn": null, "desired": false, "type": "enum", "possibleValues": [ "walk", "run", "sprint" ], "outputColumn": false }
In script you need to register the function or else it won’t work. Make sure it’s on a callback function when the AI is spawned. For example how they have it with the zombie dogs.
array::thread_all( level.dog_spawners,&spawner::add_spawn_function,&dog_init );
Add this to register the custom AST
//AST Name, Default Value, Getter Function BB_REGISTER_ATTRIBUTE("_custom_move_speed", "walk", &custom_move_speed); //This registers the AST self.custom_move_speed = "walk"; //With this u change the speed, can be (walk, run, sprint) just like the values in the JSON object. //This is the getter function that returns the value that is set on the AI function custom_move_speed() { return self.custom_move_speed; //The value u have set } //You need to include these at the top of your script #using scripts\shared\ai\systems\blackboard; #insert scripts\shared\ai\systems\blackboard.gsh;
Now in the AI_AST file you need to add the new AST definition.
locomotion@yourai, _custom_move_speed,_blend_in_time,_blend_out_time,_animation_alias,_animation_mocomp, walk,0.2,0.2,anim_walk,mocomp_move@locomotion, run,0.2,0.2,anim_run,mocomp_move@locomotion, sprint,0.2,0.2,anim_sprint,mocomp_move@locomotion, ,
Now you are able to control which anim should be selected.