Game Development Reference
In-Depth Information
Indirect control agent initialization
The initialization of the agent requires creating both the soldier and weapon mesh and then
handing them over to a soldier controller:
IndirectSoldierAgent.lua :
function Agent_Initialize(agent)
-- Initialize the soldier and weapon models.
local soldier = Soldier_CreateSoldier(agent);
local weapon = Soldier_CreateWeapon(agent);
-- Create the soldier controller, responsible for
handling
-- animation state machines.
_soldierController =
SoldierController.new(agent, soldier, weapon);
-- Attach the weapon model after the animation state
machines
-- have been created.
Soldier_AttachWeapon(soldier, weapon);
weapon = nil;
end
Search WWH ::




Custom Search