> For the complete documentation index, see [llms.txt](https://creationartstudios.gitbook.io/gcc-2.6/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://creationartstudios.gitbook.io/gcc-2.6/api/artificial-intelligence.md).

# Artificial Intelligence

In Common GAS, you can choose the standard `AIModule` when it comes to build an AI system. I already provided you with some helpful `Decorators`and `Tasks` if you using the standard AIModule&#x20;

![Image](https://khxisaki.github.io/CommonGASDocs/img/AIFolder.png)

In this example, im going to show you the basic setup to get you going.

### Setup <a href="#setup" id="setup"></a>

* By Default, CommonGAS already enabled `AIModule`&#x20;
* ![Image](https://khxisaki.github.io/CommonGASDocs/img/statetree.png)
* For any AI-controlled characters, they need to inherit from `GCCModularPawn`

![Image](https://khxisaki.github.io/CommonGASDocs/img/commonmodularpawn1.png)

![Image](https://khxisaki.github.io/CommonGASDocs/img/commonmodularpawn2.png)

* Next, you need to make an `AIController` inherit from `GCCModularAIController` to control the AI.

![Image](https://khxisaki.github.io/CommonGASDocs/img/aicontroller.png)

* In the blueprint graph, on `BeginPlay` we simply call the `Run Behaviour Tree` and apply your behaviour tree asset.&#x20;
* ![Image](https://khxisaki.github.io/CommonGASDocs/img/aicontroller_beginplay.png)
* Lastly, in your `pawn` class class default, find `Pawn->Ai Controller Class` and set your AIController to the one we created.

Now, thats the basic setup that should get you going. Have fun building your AIs!

### Tasks <a href="#tasks" id="tasks"></a>

In Common GAS, i have provided you with some useful `Tasks` you can use with GAS to build your gameplay logic:

## BTTask\_ActivateAbilityByClass <a href="#bttask_activateabilitybyclass" id="bttask_activateabilitybyclass"></a>

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_ActivateAbilityByClass.png)

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_ActivateAbilityByClass1.png)

## BTTask\_ActivateAbilityByTags <a href="#bttask_activateabilitybytags" id="bttask_activateabilitybytags"></a>

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_ActivateAbilityByTags.png)

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_ActivateAbilityByTags1.png)

## BTTask\_ActivateAbilityOnce <a href="#bttask_activateabilityonce" id="bttask_activateabilityonce"></a>

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_ActivateAbilityOnce.png)

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_ActivateAbilityOnce1.png)

## BTTask\_AddLooseGameplayTag <a href="#bttask_addloosegameplaytag" id="bttask_addloosegameplaytag"></a>

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_AddLooseGameplayTag.png)

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_AddLooseGameplayTag1.png)

## BTTask\_AddLooseGameplayTags <a href="#bttask_addloosegameplaytags" id="bttask_addloosegameplaytags"></a>

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_AddLooseGameplayTags.png)

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_AddLooseGameplayTags1.png)

## BTTask\_ApplyGameplayEffectToSelf <a href="#bttask_applygameplayeffecttoself" id="bttask_applygameplayeffecttoself"></a>

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_ApplyGameplayEffectToSelf.png)

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_ApplyGameplayEffectToSelf1.png)

## BTTask\_ApplyGameplayEffectToTarget <a href="#bttask_applygameplayeffecttotarget" id="bttask_applygameplayeffecttotarget"></a>

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_ApplyGameplayEffectToTarget.png)

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_ApplyGameplayEffectToTarget1.png)

## BTTask\_RemoveLoooseGameplayTags <a href="#bttask_removelooosegameplaytags" id="bttask_removelooosegameplaytags"></a>

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_RemoveLoooseGameplayTags.png)

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_RemoveLoooseGameplayTags1.png)

## BTTask\_RemoveLooseGameplayTag <a href="#bttask_removeloosegameplaytag" id="bttask_removeloosegameplaytag"></a>

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_RemoveLooseGameplayTag.png)

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_RemoveLooseGameplayTag1.png)

## BTTask\_SendGameplayEvent <a href="#bttask_sendgameplayevent" id="bttask_sendgameplayevent"></a>

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_SendGameplayEvent.png)

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTTask_SendGameplayEvent1.png)

### Decorators <a href="#decorators" id="decorators"></a>

In Common GAS, i have provided you with some useful `Decorators` you can use with GAS to build your gameplay logic:

## BTDecorator\_HasAllGameplayTags <a href="#btdecorator_hasallgameplaytags" id="btdecorator_hasallgameplaytags"></a>

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTDecorator_HasAllGameplayTags.png)

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTDecorator_HasAllGameplayTags1.png)

## BTDecorator\_HasAnyMatchingGameplayTags <a href="#btdecorator_hasanymatchinggameplaytags" id="btdecorator_hasanymatchinggameplaytags"></a>

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTDecorator_HasAnyMatchingGameplayTags.png)

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTDecorator_HasAnyMatchingGameplayTags1.png)

## BTDecorator\_HasMatchingGameplayTag <a href="#btdecorator_hasmatchinggameplaytag" id="btdecorator_hasmatchinggameplaytag"></a>

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTDecorator_HasMatchingGameplayTag.png)

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTDecorator_HasMatchingGameplayTag1.png)

## BTDecorator\_IsAbilitySystemComponentValid <a href="#btdecorator_isabilitysystemcomponentvalid" id="btdecorator_isabilitysystemcomponentvalid"></a>

![Image](https://khxisaki.github.io/CommonGASDocs/img/BTDecorator_IsAbilitySystemComponentValid.png)
