Emerald AI Integration

It looks like the OnObjectImpact event is no longer valid and that's the reason for the errors. I will see if I can figure out what the event should be called and make the changes so it will work. I might have to ping Opsive on this if I can't find it.
 
Good luck, I have been battling this Rewired integration issue I'm having. The mouse isn't working correctly when pressing the escape button.
 
Any idea about the UI for the AI?

EDIT: I saw your post on Discord. I switched the UI Layer from UI to Character and that fixed it. Thank you!
 
Last edited:
Here is the fixed OpsiveBridge script:

C#:
using UnityEngine;
using EmeraldAI;
using Opsive.Shared.Events;

namespace Magique
{
    public class OpsiveBridge : MonoBehaviour
    {
        private EmeraldAISystem _emeraldAI;
        private void Awake()
        {
            _emeraldAI = GetComponent<EmeraldAISystem>();

            EventHandler.RegisterEvent<float, Vector3, Vector3, GameObject, object, Collider>(gameObject, "OnObjectImpact", OnObjectImpact);
        }

        private void OnObjectImpact(float amount, Vector3 position, Vector3 forceDirection, GameObject attacker, object attackerObject, Collider hitCollider)
        {
            if (_emeraldAI != null)
            {
                _emeraldAI.Damage((int)amount, EmeraldAISystem.TargetType.Player, attacker.transform);
                Debug.Log(name + " impacted by " + attacker + " on collider " + hitCollider + ".");
            }
        }

        public void OnDestroy()
        {
           EventHandler.UnregisterEvent<float, Vector3, Vector3, GameObject, object, Collider>(gameObject, "OnObjectImpact", OnObjectImpact);
        }
    }
}
 
Here is the updated integration document.
 

Attachments

  • Opsive_V2.2_EmeraldAI_Intgration.pdf
    100 KB · Views: 116
Well, split screen requires 2 cameras to render and Emerald AI is only rendering a single UI and aligning it to a single camera. You would have to make changes so that it could handle multiple cameras where a different UI is rendered only for each camera and is aligned to that specific camera.
 
Sorry, but I don't have the time to make a video for this. Is there something you are having trouble with?
OK. I have problem with the OpsiveBridge script . Is this an extra cs-file ? Like OpsiveBridge.cs
and where does it have to be connected?

Or must i put this script into EmeraldAISystem.cs. ??

Sorry for my bad english.
 
Yes, the OpsiveBridge script is separate. You have to create a script with that name and paste the code provided in the instructions into that script. Then you attach that script to the EmeraldAI agent.
 
Top