• We are looking for a content creator to help market our assets and a future unannounced project. More details are on this page.

Emerald AI Integration

GearedGeek

Active member
I haven't tried ranged AI myself so I'll have to test that and see what might be the problem. Unfortunately, I'm working on another project atm and don't have anything set up to test for this so it might take some time to get to it.

Okay, I have been posting on the Unity forum about the issue as well. I'm not sure if the issue is with UCC or Emerald AI.
 

Wurmhole

New member
Works well, haven't tried the range AI yet but this little integration is great for getting me started. Thanks man.
 

GearedGeek

Active member
Is it me or did something change? The Opsive character doesn't do damage to the Emerald AI. The Emerald AI is able to damage the player.

EDIT: Apparently it was something with my animator or the character I was using.
 
Last edited:

nitrox32

Member
I having a problem with my character's sword not doing any damage unless my player is touching the AI character. I have increased the size to the swords hit box with no change. The AI does register damage just not from the player's sword.
 
Last edited:

Nemesis7

New member
Hello, would this script work with an Emerald AI character and a Behavior designer character (humanoid made with character manager) ?
What should be changed ?
 

magique

Active member
@magique Just checking to see if you have checked out the latest Emerald AI 2.3 update and see if it broke the integration.
Actually, I was just going to do that tonight. I have my Opsive project running with old Emerald AI and am going to upgrade to 2.3 tonight and see how it goes. I'll post any necessary changes that I happen to find.
 

magique

Active member
I checked and the integration still works fine with 2.3. Note, however, that I'm using an earlier version of Opsive and not the latest.

Also, I do notice that I never had code to handle Emerald AI stopping its attacks if the target is dead so they will continue to attack a dead player until it respawns. I'll take a look at this and come up with a solution.
 

magique

Active member
I've updated the integration docs to include a way to insure that the Emerald AI won't continue to attack a dead player.
 

Attachments

  • Opsive_V2_EmeraldAI_Intgration.pdf
    65.7 KB · Views: 117

GearedGeek

Active member
I'm getting this error,

Code:
NullReferenceException: Object reference not set to an instance of an object
EmeraldAI.Utility.EmeraldAIDetection.DetectTargetType (UnityEngine.Transform Target, System.Nullable`1[T] OverrideFactionRequirement) (at Assets/Emerald AI/Scripts/Components/EmeraldAIDetection.cs:1002)
EmeraldAI.Utility.EmeraldAIDetection.SetDetectedTarget (UnityEngine.Transform DetectedTarget) (at Assets/Emerald AI/Scripts/Components/EmeraldAIDetection.cs:977)
EmeraldAI.Utility.EmeraldAIDetection.SearchForTarget () (at Assets/Emerald AI/Scripts/Components/EmeraldAIDetection.cs:927)
EmeraldAI.Utility.EmeraldAIDetection.DetectTarget (UnityEngine.GameObject C) (at Assets/Emerald AI/Scripts/Components/EmeraldAIDetection.cs:332)
EmeraldAI.Utility.EmeraldAIDetection.UpdateAIDetection () (at Assets/Emerald AI/Scripts/Components/EmeraldAIDetection.cs:588)
EmeraldAI.Utility.EmeraldAIDetection.Update () (at Assets/Emerald AI/Scripts/Components/EmeraldAIDetection.cs:59)

EDIT:
Haha, The Emerald Unity Tag was set to player. That's what was causing that error. Once I created a Enemy Tag and assigned it to the AI. The error disappeared.
 
Last edited:

GearedGeek

Active member
@magique

I'm having a issue where the AI doesn't reset itself once it kills the player. I'm using the pre-built AI "Masked Kobold". I'm using Core GameKit to spawn prefabs of the AI in game. I'm using a Code-Triggered Event spawner to spawn the AI (player entered the trigger). The AI will attack the player once in range. The player can kill the AI and the Core GameKit will spawn a new prefab. The newly spawned AI will attack the player once they are in range. But for some reason if the AI kills the player it just stands there until its killed. Any idea?

I switch the Detection Type to Line of Sight instead of Triggered.
 
Last edited:

magique

Active member
@magique

I'm having a issue where the AI doesn't reset itself once it kills the player. I'm using the pre-built AI "Masked Kobold". I'm using Core GameKit to spawn prefabs of the AI in game. I'm using a Code-Triggered Event spawner to spawn the AI (player entered the trigger). The AI will attack the player once in range. The player can kill the AI and the Core GameKit will spawn a new prefab. The newly spawned AI will attack the player once they are in range. But for some reason if the AI kills the player it just stands there until its killed. Any idea?

I switch the Detection Type to Line of Sight instead of Triggered.
No, I don't have any ideas off the top of my head and unfortunately can't spend any time to look into it just now. I would debug it to see if it's ever searching for new targets and possibly why it might be ignoring the player if it is. Perhaps the code I added to ignore a dead player is somehow preventing it from ever acquiring a target again. You could try commenting out that code and see if they start working again.
 

magique

Active member
For anyone who is using my Emerald AI integration and might be interested, I am developing a set of Emerald AI extensions with integrations to various assets such as Dialogue System, Time of Day, Core GameKit, and Playmaker. I previously already released an Emerald AI Playmaker package and now it is being expanded and will be included in this new project. The project is called LifeLink.

To see what it's all about and discuss it, please join my Discord channel:

 

GearedGeek

Active member
So with the new version 2.2 being released it broke the integration.

Change
Code:
using Opsive.UltimateCharacterController.Events;

To
Code:
using Opsive.Shared.Events;

And that should fix the error about EventHandler. But now I'm getting this error when trying to shoot the AI. This is using the Hitscan instead of using a prefab for the projectile bullet.


I have also tried creating a test projectile for the weapon and I'm getting pretty much the same error.

 
Last edited:
Top