Game Kit Controller
  • Welcome
  • Quick Start
    • 🛣️Roadmap
    • ⭐Getting Started
      • Importing GKC
      • (Optional) Download External Files
    • 🎓Tutorials
      • 🔑Tips, Tricks and Hotkeys
      • Manually Add Axes in the Input Manager
      • Manually Add Tags and Layers
      • Tutorial - Create a New Character
      • Tutorial - Create a New Character with the Manual Creator
      • Tutorial - Create a Generic Character
      • Tutorial - Set the Default Weapons in a New Character
      • Tutorial - Create New Melee Weapon
      • Tutorial: Set Initial Melee Weapons on Player & AI
      • Tutorial - Adjust Weapons Quick Draw Weapon Action
      • Adjusting Player's Upper Body for Weapons
      • Fixing Player Spine Rotation
      • Tutorial - Add Action System By Input
      • Tutorial - Configure Local Multiplayer
      • Configure the Switch Character Companion
      • Configure the Main Mission Manager
      • Configure the Main Scene Manager
      • Using the Save System for Elements State on Scene
      • Tutorial - Configure the Drive System on an External Vehicle Controller
      • Setting up a New Skill System
      • Tutorial - Configuring Melee Weapon Attacks
      • Tutorial - Create Objects to Grab and Carry Physically
      • Tutorial - Create a new Melee Attack
      • Tutorial - Changing Player Movement Animations
    • ⁉️FAQ
  • Major Systems
    • ⚡Main Manager Administrator
    • 🏃‍♂️Traversal Movements
      • Climbing
      • Rail Sliding
      • Wall Running
    • 📥Inventory System
      • Adding a New Inventory Object
      • Create a new Inventory Prefab
      • Check the Use Inventory Object works correctly
      • Use Inventory Objects
      • Create Inventory Icon
      • Assign New Inventory Objects to the Player
    • ⚔️Weapon Systems
      • Dual Wielding Weapons
      • Tutorial - Configuring Melee Weapon Attacks on a Weapon
      • Tutorial - Create New Melee Weapon
      • Tutorial - Adjust the Fire Weapons Main Position
    • 👕Armor/Clothe System
      • Tutorial - Configure Armor-Clothe for New Model
      • Tutorial - Adding A New Piece To An Existing Armor-Cloth Set
    • ⛺Event Trigger System
      • Setting Up the Event Trigger System
    • 👊Action System
      • Action System Component
      • Tutorial - Add Action System By Input
      • Tutorial: Create Objects to Grab & Carry Physically
    • 🏂Abilities & Skills Systems
      • Skill Systems
        • Player Skill System Component
        • Player Skills UI System Component
        • Tutorial - Setting Up a New Skill System
      • Ability Systems
        • Player Abilities System Component
        • Custom Ability Component
        • Activating an Ability by Key Combo
        • Tutorial - How to set Default Abilities
        • Tutorial - Create a Custom Ability
        • Tutorial - Create a new Melee Attack
        • Tutorial - Configuring Melee Weapon Attacks
    • 💬Dialogue System
      • Configure the Main Dialog Manager
    • 🏴‍☠️Faction System
    • 🗺️Map System
      • Map Creator Component
      • Setting Up the Map System
      • Creating a new Map Creator and adding Map Parts
      • Add Name Mesh for the Floor
      • Manage Multiple Floors
      • Duplicate Map Part
      • Delete Map Parts and Floors
      • Change between Floors with Triggers
      • Add Triggers for Hidden Map Parts
      • Enable and Disable Certain Parts of the Map
      • Show a Hidden Map Part With Another Color Until Visible
      • Use Map Object Information
      • Configure Map object information Icons
      • Configure Map Pickup to Unlock Map Parts or Floors
      • Map Object Information Linked to a Map Part
      • Render Terrain in the Map Window
      • Assign the Created Floors to the Map System
    • ❗Objective System
      • Main Objective Manager
      • Configure a Mission to Start in one Scene and Finish in Another
      • Configure a Mission to Eliminate Multiple Targets
    • 🚥Player Control Mode
      • Weapons
      • Powers
    • 🌪️Combination System
      • Rifle Sword Example
      • Combat
    • ⌛Time Manipulation
      • Bullet Time (Max Payne Style)
      • Slow Motion (Matrix Style)
    • 🖥️HUD System
    • 🔨Toolbar System
    • 💾Save System
      • Save System for Elements State on Scene
    • 🏳️Localization/Language System
  • Top Level Components
    • 🎮Player and Game Management
      • 🖼️Tag Layer System
      • ⌨️Input Manager
        • First Steps and Basic Use
        • Add a New Touch Button
        • Check and Filter Input Actions
        • Configure Input on Vehicles
        • Configure Input Rebind Menu Panel and Actions
        • Add an Action to a New Script
        • Remove an Axe
        • Disable an Axe
        • Save/Load Currently Configured Axes
        • Manage Axes Save File
        • Touch Controller
        • Diable Touch Buttons on Start
        • Delete Disabled Touch Buttons
        • Assign a Touch Button to an Action
        • Scale Touch Button in the Inspector
        • Touch Joysticks
      • ☕Main Manager Adminstrator
      • 🖱️Mouse Cursor Controller
      • 🎲Game Manager
      • 🚶Player Characters Manager
      • Simple FPS Counter
      • Place Object in Camera Editor Position System
      • Set Game Object Active State
      • Set Initial Position At Game Start
  • Character Level Components
    • 🕺Character
      • Features Manager
      • Menu Pause
      • Build Player
      • Ragdoll Builder
      • Powers List Manager
      • Player HUD Manager
      • Map System Component
      • Show Game Info Hud
      • Save Game System
      • Camera Capture System
      • Weapon List Manager
      • Player Screen Objectives System
      • Console Mode
      • Player Health Bar Management System
      • Player Pickup Icon Manager
      • Player Damage On Screen Info System
      • Time Bullet
      • Player Tutorial System
      • Player Options Editor System
      • Vendor UI System
      • Dialog System
      • Objective Log System
      • Objective Station UI System
      • Travel Station UI System
      • Inventory Bank UI System
  • Player Controller Components
    • 🕹️Player Controller
      • Player Controller Component
      • Gravity System
      • Other Powers
      • Grab Objects
      • Health
      • Using Devices System
      • Close Combat System
      • Ragdoll Activator
      • Foot Step Manager
      • Pickups Screen Info
      • IK System
      • Player Weapons Manager
      • Inventory Manager
      • Damage Screen System and Damage In Screen
      • Friend List Manager
      • Upper Body Rotation System
      • Player States Manager
      • Head Track
      • Character Faction Manager
      • Player Input Manager
      • Player Navmesh System
      • Map Object Information
      • Hands On Surface IK System and IK Foot System
      • Climb Ledge System
      • Remote Event System Component
        • Setting Up a Remove Event
    • 📹Player Camera
      • Player Camera Component
      • Player Culling System
      • Set Transparent Surfaces
    • 💯Essential Components
      • AI Behaviors
      • Damage Hit Reactions System
      • Dash System
      • Inventory Camera Position and Map Elements
      • Experience-Level-Stat Systems
        • Player Experience System Component
        • Player Stats System Component
        • Player Skill System Component
          • Tutorial - Setting up a New Skill System
        • Player Skills UI System Component
      • Inventory Categories List Manager
      • Melee Combat System
      • Inventory Menu Panels System
      • Inventory Quick Access Slots
      • Inventory Weight Manager
      • Inventory Armor-Cloth Customization System
      • Player Abilities System Component
      • Player Action System Component
      • Player Info Panel On Screen System
      • Player Input Panels
      • Player State System
      • Match Player To Target System
      • Slow Down Time On Perfect Dodge
      • Save Info Elements List
      • Custom Character Controller Manager
      • Player Navmesh System
      • Elements On Scene System
    • 💼Non Essential Components
      • Ability Activated By Key Combination (R G)
      • Bullet Time Firing System (Max Payne Style)
      • Climb Ledge System
      • Currency System
      • Condition System
      • Console Log On Screen
      • Flashlight
      • Hands On Surface IK System
      • IK Foot System
      • Magic System
      • Laser Dot On Screen Manager
      • Oxygen System
      • Simple Sniper Sight Manager
      • Roll On Landing System
      • Photo Mode System
      • External Controller Behaviors
      • Gravity Wall Run Ability
      • Check If Carrying Weapons To Set Close Combat
    • 📲Elements Used By Other Components
      • Body Mount Points System
      • Damage On Screen Info System
      • Damage In Screen
      • Double Check To Disable Fire Damage On Roll
      • Free Fall Activator
      • Fire Damage
      • Ladder System
      • Inventory Camera Position
      • Map Elements
      • Projectiles On Body Manager
      • Pickups Info On Screen System
      • Player Idle System States
      • Remote Player Navmesh Override
      • Scanner System
      • Sprite Animator System
      • Shield System
      • Stamina System
      • Temporal Parent For Weapons
      • Throw Grenade From Inventory
      • Transform to Follow
      • Touch Screen Pinch System
      • Weapons Attachment UI Manager
      • Vehicles Mode Control
      • Show Values On Screen System
      • AI Mount Manager
      • Game Language Selector
      • Possession Override Objects System
      • Slider Info System
      • Actitvate Action On Characters On Scene
      • Graphic Quality Settings System
  • Additional Managers
    • 🧞‍♂️Prefabs Manager
      • Main Settings
      • Prefab Type List
      • Prefabs To Place On Scene List
      • Prefabs Searcher Options
    • 💰Main Inventory Manager (Inventory, Bank and Vendor)
      • Inventory List Manager
    • 🕳️Decal Manager
    • 🛻Pickup Manager
    • 👈Screen Objectives Manager
    • ❤️Health Bar Manager
    • 🤝External Shake List Manager
    • 🏴‍☠️Faction System Manager
    • 🎵Songs Manager
    • 🥏Noise Mesh Manager
    • 👻Set Transparent Surfaces Manager
    • 👿Damage On Screen Info Manager
    • ‼️Main Objective Manager
    • 💬Main Dialog Manager
      • Configure the Main Dialog Manager
    • 🔕Disable Objects On Distance System
    • 🎡Elements On Scene Manager
  • 🤖A.I System
    • AI Settings
    • AI Target Detection and Management
    • AI Attack Mode
    • AI Navigation
    • AI Patrol State
      • Tutorial - Configure Random Walk Movement on Attack Mode and Target Spotted on A.I
    • AI Melee System
    • AI Close Combat System
    • AI Abilities
  • Integrations
    • ➕Current Integrations
      • Emerald AI
      • Universal AI
      • Animal Controller
      • SoulLink Spawner
      • Easy Build System (EBS)
      • Randomation Vehicle Physics
      • Edy’s Vehicle System
      • Space Combat Kit
      • Mech Combat Kit
      • NWH Vehicle Physics 2
      • Dynamic Water Physics
      • Honor AI
      • UMA 2
      • DestroyIt
      • Silantro Flight Simulator Toolkit
      • Dialogue System for Unity
      • Interactor
      • iStep
    • 🔧Upcoming/In Progress
      • Ability & Combat Toolkit
      • Ork 3 Framework
  • Annex
    • 📖Changelog
      • GKC Update 3.03-3A
      • GKC Update 3.03-2
      • GKC Update 3.03-1
      • GKC Update 3.02g (Final)
      • GKC Update 3.02f
    • ‼️Possible Issues and Fixes
  • Support
  • Discord
  • Forum
  • Patreon
Powered by GitBook
On this page
  • What is Emerald AI?
  • Inspector Settings
  • Script Changes
  • Part #1
  • Part #2

Was this helpful?

Export as PDF
  1. Integrations
  2. Current Integrations

Emerald AI

This page covers the integration of Emerald AI and Game Kit Controller.

PreviousCurrent IntegrationsNextUniversal AI

Last updated 2 years ago

Was this helpful?

What is Emerald AI?

Emerald AI allows developers to quickly create engaging dynamic AI with 100's of AAA quality features, all without having to write a single line of code! Emerald's editor is designed to make creating AI easy, yet incredibly customizable. Emerald caters to all kinds of developers and offers everything users would expect from an all-in-one AI system.

Inspector Settings

Black Horizon Studios (The maker of Emerald AI) has a tutorial video showing the inspector changes needed to integration Emerald AI and Game Kit Controller.

If you'd rather just get a step by step instructions for the inspector changes you can view these in the tab below labelled "Step by Step Instructions".

While the video also covers the code changes, these are now outdated (as of GKC v3.03-1+), you can find the up to date code changes needed below

Step by Step Instructions

Follow these easy steps to get your Emerald AI NPC setup to work with GKC.

  1. Select the NPC with the Emerald AI component attached and change it's Unity tag to enemy.

  2. Next change the layer of the NPC to npc.

    1. If you receive a popup from Unity with the following "Do you want to set layer npc for all child objects as well?" Press the No, this object only button.

  3. In the Emerald AI System component go to the Detection & Tags tab and select Tag Options.

    1. Change the Emerald Unity Tag field to enemy.

    2. Then under Detection Layers select player and npc, and deselect anything else, unless it's needed for other parts of your project.

That's it for inspector setting changes, next you'll need to make some script changes as outlined below.

Script Changes

Part #1

First you'll need to open the EmeraldAIPlayerDamage.cs script found in the Emerald AI directory Assets/Emerald AI/Scripts/Components/ in your favourite editor and add the following code after the DamagePlayerStandard() method:

/// <summary>
/// Applies damage to a Game Kit Controller controlled player.
/// </summary>
/// <param name="DamageAmount">The amount of damage to deal to the GKC player.</param>
void DamageGameKitController(int DamageAmount, GameObject attacker)
{
    applyDamage.checkToDamageGKCCharacterExternally (DamageAmount,
    gameObject, attacker);
}


Then in the same file, add the following inside the SendPlayerDamage method:

// Send damage to GKC player
GameObject targetObject = null;

if (Target != null){
    targetObject = Target.gameObject;
}

DamageGameKitController(DamageAmount, targetObject);

You can now save the EmeraldAIPlayerDamage.cs script and move onto the next step below.

Part #2

The next part can be done in two ways, the first is the recommended way to add the integration. The second option isn't recommended but can be used if you don't want to use inheritance.

Recommended Method

Open the EmeraldAISystem.cs script found in the the Emerald AI directory Assets/Emerald AI/Scripts/System in your favourite editor.

First at the top of the script where the class is defined you need to replace MonoBehaviour inheritance with healthManagement - At the time of writing this at line 20. The class definition should then look like the following:

public class EmeraldAISystem : healthManagement

After changing the script inheritance, and in the same script add the following code after the SendEmeraldDamage() method:

/// <summary>
/// Game Kit Controller Integration
///
/// Applies damage to the player via the GKC healthManagement class.
/// </summary>
public override void setDamageWithHealthManagement(float damageAmount,
    Vector3 fromDirection, Vector3 damagePos, GameObject attacker, GameObject projectile,
    bool damageConstant,
    bool searchClosestWeakSpot, bool ignoreShield, bool
    ignoreDamageInScreen, bool damageCanBeBlocked, bool
    canActivateReactionSystemTemporally, int damageReactionID, int damageTypeID)
{
Damage((int)damageAmount, EmeraldAISystem.TargetType.Player);
}

Not Recommended

Wait! Before you go further, this is not the best way to integration Emerald AI with GKC. Please consider using the recommended method in the first tab.

Open the applyDamage.cs script found in the the Game Kit Controller directory Assets/Game Kit Controller/Scripts/Health in your favourite editor.

First at the top of the script you'll see a few namespaces being included in the script (before the class definition), after the last one add using EmeraldAI; so that the script now looks something along the lines of:

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using EmeraldAI; // Emerald AI Integration

public class applyDamage : MonoBehaviour
{

After adding the EmeraldAI namespace to the top of the script you will need to uncomment the Emerald AI specific code at the bottom of the checkHealth() and checkCanBeDamaged() methods and save the script.

You can find more information about Emerald AI, and its documentation and also purchase it over on the .

That's it! Congratulations, Game Kit Controller is now integrated with Emerald AI in your project

Now you can hunt that T-Rex down and it'll no longer be invincible to your attacks... although neither will you... *PEW* *PEW*

That's it! If you followed all of the above and uncommented the Emerald AI code then Game Kit Controller is now integrated with Emerald AI in your project

➕
🥳
🙌
🦖
🔫
🥳
Unity Asset Store