• 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

Frocha

Member
I really don't know. Monsta Manly had the same issue, but I tested with the latest of both Emerald Ai and Opsive and it worked fine for me. Since I reported that, Monsta Manly never came back with an answer. There must be something going on since you both see it. Can you double check by downloading the package from my site along with the latest integration instructions?

I made a new Emerald AI from scratch and it worked it seems all the ones made with the previous version are having this issue.
 

Frocha

Member
I really don't know. Monsta Manly had the same issue, but I tested with the latest of both Emerald Ai and Opsive and it worked fine for me. Since I reported that, Monsta Manly never came back with an answer. There must be something going on since you both see it. Can you double check by downloading the package from my site along with the latest integration instructions?

Another odd thing i noticed if you are in playmode and deactivate then activate the AI, it will then cause damage.
 

magique

Active member
OK, so it seems they just released a new Emerald AI, which I have not yet tried. I will grab it and install in my Opsive/Emerald test project and see what's up.
 

magique

Active member
I just tried with Emerald AI 3.1.1 and Opsive 2.4.4 and it all works. I see you are using Opsive 2.4.5 so perhaps that's the issue now. I'll get that one and see if there are any issues.
 

magique

Active member
I now have it set up with Emerald AI 3.1.1 and Opsive 2.4.5 and it is still working for me. I am using the third person controller. Are you all using third person controller or first person. I have not tested with first person.
 

magique

Active member
I am going to make a video of setting up completely from scratch with all the steps and maybe that will help others to discover what may be wrong.
 

Frocha

Member
I thought it was weird, hmm. I remember updating emerald to the 3.0 version then trying the A.I and it worked for a bit. Then after closing unity and restating it.( I turned my computer off for the night). The next day I tried it and my A.I would only attack me if I attacked them. Then they did attack me, they did no damage. So I updated opsive and UIS. Still wouldn't work. I checked emerald scripts and everything was correct. So I made a new A.I from scratch and it worked.
 

magique

Active member
I thought it was weird, hmm. I remember updating emerald to the 3.0 version then trying the A.I and it worked for a bit. Then after closing unity and restating it.( I turned my computer off for the night). The next day I tried it and my A.I would only attack me if I attacked them. Then they did attack me, they did no damage. So I updated opsive and UIS. Still wouldn't work. I checked emerald scripts and everything was correct. So I made a new A.I from scratch and it worked.
I just did a totally fresh install and setup of everything and it worked. I made a video of the process, so hopefully this will help others who may be stuck. I will post the video here and on my site when it's uploaded.
 

glindsten

New member
Does anyone know if the integration works for ranged AI? I have got everything else working, but the ranged AI doesn't seem to recognize the player. I'm using the first-person controller btw.

Thanks for all the hard work on the integration btw. Much appreciated.
 

magique

Active member
Does anyone know if the integration works for ranged AI? I have got everything else working, but the ranged AI doesn't seem to recognize the player. I'm using the first-person controller btw.

Thanks for all the hard work on the integration btw. Much appreciated.
Yes, I have tested with the Grenadier Ranged and it works fine.
 

glindsten

New member
Yes, I have tested with the Grenadier Ranged and it works fine.
Ok, I got the Grenadier Ranged to recognize and fire at the player... but it only shoots at the feet of the player. It's shoots at the center of other AI just fine. I think it's because the pivot point of UCC's first-person player capsule collider is at the bottom, instead of at the center. If anyone has any tips for fixing this would be very grateful!
 

glindsten

New member
1643438097597.png
The debug shows that it's targeting the right Capsule Collider. From what I read about Emerald's aiming system it's supposed to aim at half the height of the collider. It's just stuck at the bottom.
 

magique

Active member
View attachment 8163
The debug shows that it's targeting the right Capsule Collider. From what I read about Emerald's aiming system it's supposed to aim at half the height of the collider. It's just stuck at the bottom.
I've never looked into the issue before, but I seem to remember some others discussing this and I thought there was a solution. Maybe somewhere in this thread is the answer.
 

sneekyo

Member
I've never looked into the issue before, but I seem to remember some others discussing this and I thought there was a solution. Maybe somewhere in this thread is the answer.
Hey Magique

On here step 3 is confusing to me, I can't seem to set it up correctly to get hit effects based on the location hit.
 

magique

Active member
Hey Magique

On here step 3 is confusing to me, I can't seem to set it up correctly to get hit effects based on the location hit.
If you're using the OpsiveBridge script without changes then it should work automatically. The following code in that script is as follows:

#if EMERALD_LBD
// !!!Thanks to Mattis for providing this code for location based damage!!!
if (hitCollider.GetComponent<LocationBasedDamageArea>())
{
hitCollider.GetComponent<LocationBasedDamageArea>().DamageArea((int)amount, EmeraldAISystem.TargetType.Player, attacker.transform);
}
else
#endif

So, as long as the code at the top . . .

#define EMERALD_LBD

Is uncommented, then it should work.
 

sneekyo

Member
-
If you're using the OpsiveBridge script without changes then it should work automatically. The following code in that script is as follows:

#if EMERALD_LBD
// !!!Thanks to Mattis for providing this code for location based damage!!!
if (hitCollider.GetComponent<LocationBasedDamageArea>())
{
hitCollider.GetComponent<LocationBasedDamageArea>().DamageArea((int)amount, EmeraldAISystem.TargetType.Player, attacker.transform);
}
else
#endif

So, as long as the code at the top . . .

#define EMERALD_LBD

Is uncommented, then it should work.
I'm having an issue where if I damage the AI first, then it doesn't hurt when it attacks me, but if I let it attack me first it damages me. Any ideas?
 

magique

Active member
I'm having an issue where if I damage the AI first, then it doesn't hurt when it attacks me, but if I let it attack me first it damages me. Any ideas?
Not off the top of my head. I don't think I've heard that one before. Definitely double check all the integration steps first though. Or try with a different AI and see if you get the same thing.
 
Top