0.52

From Unvanquished
Jump to: navigation, search

List of v0.52 Behavior Tree Actions

activateUpgrade

Use upgrade if possible. Parameter is the upgrade to use.

Example:

 action activateUpgrade( UP_MEDKIT )

aimAtGoal

{ "aimAtGoal",         BotActionAimAtGoal,         0, 0 }, 

alternateStrafe

{ "alternateStrafe",   BotActionAlternateStrafe,   0, 0 }, 

buy

Takes between 1 and 4 items to buy, then behaves the same way as the action "equip".

changeGoal

Parameters:

  • vec3_t: position designed as new goal (mandatory)

In code: BotActionChangeGoal

classDodge

{ "classDodge",        BotActionClassDodge,        0, 0 }, 

deactivateUpgrade

{ "deactivateUpgrade", BotActionDeactivateUpgrade, 1, 1 }, 

equip

Make the bot decide itself what to buy. If desired equipment is same than what it have, the action returns STATUS_FAILURE.

If a change of equipment is desired, target the closer armory. If it is disabled (destroyed, not powered) or if no armory exists, the action returns STATUS_FAILURE. If the armory can not be reached (navmesh), it is possible that the action returns STATUS_FAILURE. **Not sure about this.**

If the close armory can be used and reached, return STATUS_RUNNING until the bot reach the armory and buys equipment. When the equipment is bought, returns STATUS_SUCCESS.

If armory's status changes while the bot tries to reach it, returns STATUS_FAILURE.

evolve

{ "evolve",            BotActionEvolve,            0, 0 }, 

evolveTo

{ "evolveTo",          BotActionEvolveTo,          1, 1 }, 

fight

{ "fight",             BotActionFight,             0, 0 }, 

fireWeapon

{ "fireWeapon",        BotActionFireWeapon,        0, 0 }, 

flee

{ "flee",              BotActionFlee,              0, 0 }, 

heal

{ "heal",              BotActionHeal,              0, 0 }, 

jump

{ "jump",              BotActionJump,              0, 0 }, 

moveInDir

{ "moveInDir",         BotActionMoveInDir,         1, 2 }, 

moveTo

{ "moveTo",            BotActionMoveTo,            1, 2 }, 

moveToGoal

{ "moveToGoal",        BotActionMoveToGoal,        0, 0 }, 

repair

{ "repair",            BotActionRepair,            0, 0 }, 

resetStuckTime

{ "resetStuckTime",    BotActionResetStuckTime,    0, 0 }, 

roam

{ "roam",              BotActionRoam,              0, 0 }, 

roamInRadius

{ "roamInRadius",      BotActionRoamInRadius,      2, 2 }, 

rush

{ "rush",              BotActionRush,              0, 0 }, 

say

Make the bot say something.

Arg 1: text to say Arg 2: whom to say it to

Arg 2's possible values:

  • SAY_ALL: say text to everyone on server
  • SAY_ALL_ADMIN: say text to admins present on map
  • SAY_TEAM: say text to the team
  • SAY_RAW: logs only, should not be used since bots are clients

Following values may not be handled (unsure):

  • SAY_PRIVMSG
  • SAY_TPRIVMSG
  • SAY_AREA
  • SAY_AREA_TEAM
  • SAY_ADMINS
  • SAY_ADMINS_PUBLIC
  • SAY_ALL_ME
  • SAY_TEAM_ME
  • SAY_DEFAULT

Values extracted from `enum saymode_t`, in `Unvanquished/src/shared/bg_public.h`. Please edit this to add more details, or even more examples.

Example:

 action say( "hello world", SAY_ALL )

strafeDodge

{ "strafeDodge",       BotActionStrafeDodge,       0, 0 }, 

suicide

{ "suicide",           BotActionSuicide,           0, 0 },