Plant Goal

* /bot goal\_create plant <name>
* /bot draw\_oids
	+ this will draw a bounding box around all OID's; which is the type of entity required
* confirm the name of the OID in the center of the bounding box
* face the OID and /bot goal\_setproperty trace after making sure to be outside of the bounds of the desired OID
	+ the center of the screen will say which entity the trace found
	+ confirm that the entity number in the center print matches what is shown inside the bounding box from draw\_oids
* optionally set the explosive type with /bot goal\_setproperty etype <type>
	+ dyno = only engineers will use this goal
	+ satchel = only covert ops will use this goal
	+ both = both engineers and covert ops will use this goal
* optionally add a cover spot by going to a location and facing the desired direction.
	+ /bot goal\_setproperty coverspot 0
		- add as many as you like using the last param as the index number. use an existing index num to 'move' it.
	+ /bot goal\_setproperty coverstance crouch while standing next to the cover spot
		- stance is optional and defaults to stand. valid values are stand, crouch, and prone
	+ /bot goal\_setproperty coverfacing 1 while standing next to the cover spot
		- works similar to the camp goals
* /bot goal\_finish

## Detailed Instructions

#### Description

Plant is a goal that allows bots to use dynamite or satchels to destroy and objective
#### Setup

See the Fastrack example at the top of the page for an example setup.
#### Properties

Properties can be set with the goal\_setproperty command assuming that the goal has been selected.
##### group

A group is a method of organizing sets of goals. One advantage to this is that all goals in a group can be enabled or disabled in one line of script rather than seperate goal types requiring additional lines to enable or disable them. Assigning roles to a group is also possible as an alternative to assigning each individual goal a role.
**syntax:** /bot goal\_setproperty group <string groupName>
**example:** /bot goal\_setproperty group myGroup
##### role

See the section on bot roles.
**syntax:** /bot goal\_setproperty role <role mask>
**example:** /bot goal\_setproperty role 1
##### tagname

Sets the name of the goal. This can optionally be set when passed as the optional parameter in the goal\_create command. Useful for renaming goals.
**syntax:** /bot goal\_setproperty tagname <string name>
**example:** /bot goal\_setproperty tagname myGoalName
##### RandomUsePoint

Default value is 0 which means that bots will use only the nearest use point. It is good for walls which can be planted from both sides if a map has multiple spawns. But you usually define multiple use points because objective is big or because you want to randomize dynamite positions. Then you must change RandomUsePoint to 1.
**syntax:** /bot goal\_setproperty randomusepoint <0/1>
**example:** /bot goal\_setproperty randomusepoint 1
##### trace

Runs a trace based on where the player is aiming and stores the information for the goal.
**syntax:** /bot goal\_setproperty trace
**example:** /bot goal\_setproperty trace
**example:** /bot goal\_setproperty trace clear
**note:** the trace must be to an OID entity.
##### EntityName

Sets name of the objective entity. It is faster than trace.
**syntax:** /bot goal\_setproperty entityname <entity name>
**example:** /bot goal\_setproperty entityname barrier
##### IgnoreEntity

This property should be used only if trace property does not work, because TraceLine can't find OID entity or if function GetDestroyableState always returns -1. After you set ignoreentity to true, you must use function SetAvailableMapGoals to enable or disable goal. The goal is not automatically disabled after the objective has been destroyed.
**syntax:** /bot goal\_setproperty ignoreentity <0|1>
**example:** /bot goal\_setproperty ignoreentity
##### etype

Sets the explosive type for the goal
**syntax:** /bot goal\_setproperty etype <type>
**example:** /bot goal\_setproperty etype dyno
**example:** /bot goal\_setproperty etype satchel
**example:** /bot goal\_setproperty etype both
**note:** defaults to both

##### CoverSpot

Defines a location for the engineer to go to after planting dynamite so it will defend it
**syntax:** /bot goal\_setproperty coverspot <index>
**example:** /bot goal\_setproperty coverspot 0
**example:** /bot goal\_setproperty coverspot clear
**note:** the first facing is auto generated based on player facing.
**note:** any number of spots can be defined. to edit an existing one, pass the existing index
##### CoverStance

Assigns a stance to the cover spot closest to the player
**syntax:** /bot goal\_setproperty coverstance <stand, crouch, or prone>
**example:** /bot goal\_setproperty coverstance crouch
##### CoverFacing

Assigns a facing to the cover spot closest to the player
**syntax:** /bot goal\_setproperty coverfacing <index>
**example:** /bot goal\_setproperty coverfacing 0
**note:** any number of facings can be defined. to edit an existing one, pass the existing index
##### CoverSplit

Sets vector3 perpendicular to objective (normal vector). It is used for walls or gates which can be planted from both sides. It's usually on maps where a forward flag can be captured by disguised covertops or reached from sewers.
**syntax:** /bot goal\_setproperty coversplit
**note:** The goal must have at least 2 use points.
##### CoverTimeout

facing from use point to goal center, only if goal has 2 use points and multiple cover spots
**syntax:** /bot goal\_setproperty covertimeout <int timeout>
**example:** /bot goal\_setproperty covertimeout 30
**note:** minimum 1, maximum 30, default 25
##### DetonateSpot

Defines a location for the covertops to go to after placing satchel. It is useful only near enemy spawn, long ladders or similar dangerous areas.
**syntax:** /bot goal\_setproperty detonatespot <index>
**example:** /bot goal\_setproperty detonatespot 0
**note:** any number of spots can be defined. to edit an existing one, pass the existing index
##### SatchelFunction

It can be set only in OnMapLoad function. It is used to completely control a bot. Functionality is similar to a pathtrough navigation.

```
 GetGoal("PLANT\_Axis\_MG42\_Construction").SatchelFunction = function(\_this)
 {
 \_this.AddAimRequest(Priority.VeryHigh, "facing", Vec3( 0.494, 0.297, 0.817 ));
 sleep(0.5);
 \_this.AddWeaponRequest(Priority.High, WEAPON.SATCHEL );
 sleep(0.7);
 \_this.Bot.PressButton(BTN.ATTACK1);
 sleep(0.2);
 \_this.AddWeaponRequest(Priority.High, WEAPON.SATCHEL\_DET );
 sleep(0.5);
 \_this.Bot.PressButton(BTN.ATTACK1);
 };

```

#### Picture of tracing to an OID

This picture shows the process of using /bot goal\_setproperty trace to get the OID to be used by the goal. The screenshot was taken after issuing the /bot draw\_oids command, moving outside of the bounds, facing the bounding box, and then issuing the /bot goal\_setproperty trace command. Note that the entity listed in the center print is the same as what is listed in the middle of the bounding box. That part is crucial.

File:Plant goal trace.jpg