====== COMP_AGENT ====== **Category**: Component Parent class: [[:api:component|COMPONENT]]\\ ===== Properties ===== ---- ==== BehaviorTree ==== //[[:annotations#serialized|Serialized]], [[:annotations#savegame|Savegame]]// * **Type**: ''[[:api:behavior_tree|BEHAVIOR_TREE]]'' * **Expected**: ''asset ID'' ---- ==== ActivityMessage ==== //[[:annotations#runtime_only|Runtime only]], [[:annotations#savegame|Savegame]]// * **Type**: ''[[:data-types#string|string]]'' * **Expected**: ''string value'' ---- ==== IsDying ==== //[[:annotations#runtime_only|Runtime only]], [[:annotations#savegame|Savegame]]// * **Type**: ''[[:data-types#boolean|boolean]]'' * **Expected**: ''boolean value'' * **Default value**: ''false'' ---- ==== Gender ==== //[[:annotations#runtime_only|Runtime only]], [[:annotations#savegame|Savegame]]// * **Type**: ''[[:api:gender|GENDER]]'' * **Expected**: ''enum value'' * **Default value**: ''GENDER.MALE'' ---- ==== WalkOnPlatform ==== //[[:annotations#serialized|Serialized]]// * **Type**: ''[[:data-types#boolean|boolean]]'' * **Expected**: ''boolean value'' * **Default value**: ''true'' ---- ==== RoadPaintSpeed ==== //[[:annotations#serialized|Serialized]]// * **Type**: ''[[:data-types#float|float]]'' * **Expected**: ''float value'' * **Default value**: ''0.1f'' ---- ==== Model ==== //[[:annotations#serialized|Serialized]], [[:annotations#savegame|Savegame]]// * **Type**: ''[[:api:game_object|GAME_OBJECT]]'' * **Expected**: ''GAME_OBJECT value'' ===== Functions ===== ---- ==== setAnimation ==== ''void **setAnimation**(//animation// [, //speed//])'' ^ Name ^ Type ^ Description ^ | //''animation''// | ''[[:api:agent_animation|AGENT_ANIMATION]]'' | | | //''speed''// | ''[[:data-types#float|float]]'' | | ---- ==== setActivityMessage ==== ''void **setActivityMessage**(//message//)'' Deprecated since version 1.8; use ActivityMessage property instead ^ Name ^ Type ^ Description ^ | //''message''// | ''[[:data-types#string|string]]'' | | ---- ==== setBehaviorMessage ==== ''void **setBehaviorMessage**(//message//)'' Deprecated since version ^ Name ^ Type ^ Description ^ | //''message''// | ''[[:data-types#string|string]]'' | | ---- ==== setIsRoadTracingEnabled ==== ''void **setIsRoadTracingEnabled**(//enabled//)'' ^ Name ^ Type ^ Description ^ | //''enabled''// | ''[[:data-types#boolean|boolean]]'' | | ---- ==== isOnWater ==== ''[[:data-types#boolean|boolean]] **isOnWater**()'' ---- ==== setProfile ==== ''void **setProfile**(//profile//)'' ^ Name ^ Type ^ Description ^ | //''profile''// | ''[[:api:agent_profile|AGENT_PROFILE]]'' | | ---- ==== getProfile ==== ''[[:api:agent_profile|AGENT_PROFILE]] **getProfile**()'' ---- ==== setVehicle ==== ''void **setVehicle**(//vehicle//)'' Assign the vehicle to the agent. This does not destroy previously assigned vehicle. ^ Name ^ Type ^ Description ^ | //''vehicle''// | ''[[:api:comp_vehicle|COMP_VEHICLE]]'' | | ---- ==== getVehicle ==== ''[[:api:comp_vehicle|COMP_VEHICLE]] **getVehicle**()'' ---- ==== isOnBoat ==== ''[[:data-types#boolean|boolean]] **isOnBoat**()'' ---- ==== die ==== ''void **die**()'' This will make the agent die during his next update(). ===== Events ===== ---- ==== ON_DYING ==== ''ON_DYING()'' ---- ==== ON_VEHICLE_CHANGED ==== ''ON_VEHICLE_CHANGED([[:api:comp_vehicle|COMP_VEHICLE]] previousVehicle, [[:api:comp_vehicle|COMP_VEHICLE]] newVehicle)''