Jump to content

Recommended Posts

Posted

This tutorial is to cover off how to add additional omni-bot goals, specifically weapon, defend, attack and camp goals. These goals will allow you to keep bots in a specific area, attack or defend a specific area, or use a certain weapon (such as artillery, mortar, sniper rifle etc).

 

Before doing this, you should already have done:

1) Waypointing basics: click here

2) Waypointing - Scripting Basics and Goals: click here

 

So, let's get started.

 

Make Goals Visible

Use the in-game omni-bot menu to show existing map goals. You should now be able to see existing, auto generated goals within the map. These will be map objectives only (command posts, capturable spawns etc.).

 

Create a Goal

We're going to create an attack goal first. This is a goal that the attacking team will complete. 

 

1) Using the in-game omni-bot menu, select the 'create camp goals' option.

2) Create an 'Attack' goal.

3) Name your goal something appropriate. In this example, we'll call it 'Wall_8', as it is the 8th goal we're creating near the old city wall.

4) You can use the omni-bot menus to adjust the 'stance', such as stand or crouch. We'll leave this one as 'stand'. You should now be able to see your goal:

 

shot0000.jpg.2103a3bbfd2c60c94e78f66240c9599c.jpg

 

Next, we need to decide when we want our bots to complete this goal. In this example (Oasis), we want the Allied team to only start to camp out the area by the old city wall once the old city flag has been captured. So, in our script, we need to find the section that's activated once the flag is captured:

 

oldcityflag_Allies_Captured = function( trigger )

 

In this section, we can either enable just this goal, or all goals with the name beginning 'ATTACK_Wall_'. If we want to enable this goal only, the command would be:

 

SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_Wall_8" );

 

To enable all goals with the name beginning 'ATTACK_Wall_', the command would be:

 

[code]SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_Wall_.*" );

[/code]

 

Always keep goals within a specific area in a similar format, as this will enable you to 'switch' them all on/off together.

 

Once the old city wall is destroyed, we no longer want the bots to camp at the old city, so we can disable the ATTACK_Wall goals in this section:

 

oldcityflag_Axis_Captured = function( trigger )

 

With this command:

 

SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_Wall_.*" );

 

You should create attack and defend goals in any areas appropriate for bots to camp. For example, you should be aiming to keep several Axis bots in the areas near the PAK guns once the old city wall is destroyed.

 

Weapon Goals

Weapon goals are created in the same way. Let's take a look at an example of an airstrike goal.

 

1) Use the in-game omni-bot menu to create a weapon goal, then select airstrike

2) Stand in the position and aim where the airstrike marker should be thrown, and select 'add facing'

3) Add additional facings if you like. Omni-bots will choose one at random. In the below example, we've added two facings:

 

shot0002.jpg.861cdb19a29ec57c436660811bee1657.jpg

 

Remember to enable / disable these goals for the appropriate teams when require in the script. This is the exact same process as enabling / disabling attack / defend goals.

 

Other Goal Types

You can use the in-game omni-bot menu to select many different weapon goals, such as grenades, mortars, mines, snipers etc. Experiment with these to create a more realistic gameplay style. You should also run the map a few times once you've got your goals working to ensure the defending team is defending effectively, and the attacking team is attacking correctly. Add / remove goals as required. This will take some time and experimenting to get right.

 

Once you've got your goals set up properly, bots will focus on attacking / defending effectively. The more goals you can add in the right areas at the right time, the better the game play will be. It's very easy to get the balance wrong, with one team stronger than the other. So, make sure you do plenty of run throughs to ensure you've got the balance right.

 

In the next tutorial, we'll cover off routing. This is to allow us to force bots to take a number of different routes to complete their objectives, rather than all following the same, predictable path.

  • Like 1
  • Thanks 2
  • Love 1
  • 100 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.