Plant Goal: Difference between revisions

From MyGamingTalk
No edit summary
 
m (1 revision imported)
(No difference)

Revision as of 08:02, 13 February 2023

Goal Instructions 0.8 Plant Goal

Fastrack

  • only use this in cases where the goal is not auto detected
  • /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.

Video Tutorial Version


Adding a Plant Goal