Search Unity

[RELEASED] Emerald AI 3.2 (New Sound Detection) - The Ultimate Universal AAA Quality AI Solution

Discussion in 'Assets and Asset Store' started by BHS, Jun 26, 2015.

  1. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    I'm not sure if you have resolved this, but version 2.2 is not compatible with the previous versions of Emerald AI. You have to completely remove it from your project.

    I'm not sure how you are duplicating your AI, but all you have to do is save the object as a prefab and then use instances of that prefab and all changes you make with the Project located prefab will be applied through all of the other prefabs. Each duplicated AI does not have to have its own Animator Controller. They can all share the same one.

    It has to turn grey because the created object can no longer reference its original prefab. This is actually required with Unity 2018.3 and its new prefab system. The prefab connection is broke and all you have to do is save a new prefab and use instances of it. All changes will be applied through all instances.


    Thanks Tony and sounds good!


    Very interesting. I will have to take a look at this. I never had issues with Root Motion animations. Thanks for bringing it to my attention.


    When I get the time, I will create some tutorials utilizing some of the Emerald AI Event functions, but for now, I can provide some of the functions that will allow you to control a Companion AI.

    Code (CSharp):
    1. //Allows a Companion AI to stop at the set position and guard it
    2. EmeraldComponent.EmeraldEventsManagerComponent.CompanionGuardPosition(Vector3 PositionToGuard)
    3.  
    4. //Completely stops a Companion AI's movement
    5. EmeraldComponent.EmeraldEventsManagerComponent.StopFollowing();
    6.  
    7. //Allows a Companion AI to resume following its follower
    8. EmeraldComponent.EmeraldEventsManagerComponent.ResumeFollowing();


    Yes, you have to use the Sounds tab. Some sounds will require an Animation Event, such as attacking sounds, but Idle sounds will play randomly within the users set amount of seconds.


    I wouldn't recommend doing it this way. The Emerald AI Editor automatically updates the Animator Controller. Editing the animations externally could cause issues.


    Change each of the Emerald_AI portions to EmeraldAI.EmeraldAISystem


    It isn't that simple. The Animator Controller isn't very flexible. The only way to access and apply animations is by the State's name. If users created States with custom names, Emerald AI would have no way to grab the states, unless the names could be set within the Editor, which would just make things more complicated. It also isn't possible with how an Animator Controller has to be created with many different custom parameters for added functionality such as blocking and weapon sheathing. This way, users can have an Animator Controller created for them and apply animations without having deal with parameters, transitions, blend trees, and states.


    Impact and Weapon sounds can play without Animation Events. Attack sounds, Footstep Sounds, Interact Sounds, and Warning Sounds all need an Animation Event. I will be making more tutorial videos covering these as soon as possible.
     
    Oderus_Urungus likes this.
  2. IsntCo

    IsntCo

    Joined:
    Apr 12, 2014
    Posts:
    146
    @BHS I'm sure you're swamped, but any idea when you'll be updating the documentation to cover the additions of the features in 2.2?

    Also if you have any idea about update on Ootii? :-D

    Thanks!
     
  3. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    @BHS

    I know you're really busy but if you can just list the event call required tutorial not really needed as you have done it for damage event unless it is drastically different.
     
  4. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    [QUOTE @BHS ]
    I wouldn't recommend doing it this way. The Emerald AI Editor automatically updates the Animator Controller. Editing the animations externally could cause issues.[/QUOTE]

    Interesting @BHS . What should I be doing then, when I specify through the setup manager all of my animations, and on running, get errors regarding Idle_x (where x is the relative number) animation is missing? I go into the animator controller and find Idle_x, and it is marked none. ALL of the idles were marked none! I add the correct idle animation and it works with no errors.

    [QUOTE @BHS ]
    It isn't that simple. The Animator Controller isn't very flexible. [/QUOTE]

    Look, Emerald already detects if the animator controller was Emerald generated or not. I see the warning in the Emerald System script component, even though I have an Emerald generated controller in the animator component. It knows that I didn't generate it with THIS model. _IF_ it was Emerald generated, it should read the damn thing and populate the script fields!! It should be that simple. I shouldn't have to create a frickin' animator controller for every single model, especially when the bulk of them are identical except for the MESH! I have to enter all, what, 24(?) animations, all 30+ random sound files, footstep sounds, build the exact same factions list, setup the health UI, etc, etc. The only thing different is the bloody HEAD TRANSFORM!

    Since there appears to be no shortcut for attaching EmeraldAI to characters that are going to animate exactly the same, I guess I am going to have to do them one at a time with the setup manager. See you folks in about a month...

    (Please excuse the manual quoting, but you replied in a mass reply...)
    Mark
     
  5. Alexandus

    Alexandus

    Joined:
    Sep 5, 2012
    Posts:
    25
    @BHS Having various issues - one of the AI's won't attack - I logged some of the code and the AI's successfully detects the player and sets it as the target, but nothing else happens. When set to passive the same AI wanders around just fine, with correct animations
     
    Last edited: Feb 25, 2019
  6. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    It is called duplicate and then change out the character....
     
    TeagansDad likes this.
  7. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    I'd say about a week, realistically. The Emerald editor is self-documented though so a lot of information can be found within the text boxes. I will be creating tutorial videos covering all sorts of cool things you can do as well integration tutorial videos daily. I will be creating an integration tutorial video for Ootii soon.


    I'm just about to post a YouTube tutorial on adding footstep sounds with Animation Events. I'll post it here when it's done.

    For you, and whoever else is interested, here's the relevant Animation Events API.

    Plays a idle sound when called (This can also be done automatically within the Sounds tab)
    PlayIdleSound

    Plays a walk sound when called

    WalkFootstepSound

    Plays a run sound when called
    RunFootstepSound

    Plays an attack sound when called
    PlayAttackSound

    Plays a warning sound when called
    PlayWarningSound

    Enables the AI's Weapon Object
    EnableWeapon

    Disables the AI's Weapon Object
    DisableWeapon
     
    uberwiggett and AndyNeoman like this.
  8. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Could you possibly provide a video so I can see what's happening because from what it sounds like, you aren't using the newest version of the Setup Manager. The Setup Manager doesn't have animations like the previous version did. All animations are handled through the Emerald AI Editor.

    The only way the a Animator Controller within Emerald would say it's generated is if you copied the EmeraldAISystem script from another AI that had already generated it.

    If you want a simpler workflow with creating mass amounts of AI, it can certainly be added with the next update. I'm working on a temporary automatic solution for you, or whoever else, wants it. This will allow you to use an editor, place an AI in a slot and have a list of other non-AI objects that the exact same settings will be applied to including Animator Controller and animations. The only requirement is that the AI use the same animations and Avatar/rigging. If the head transform has the same name, the new system will automatically find it within the new AI and apply it.


    Does everything have the correct tags and layers? Use the Debug Log tool, located under the Docs tab, to see if everything is being detected correctly.
     
    Last edited: Feb 25, 2019
    Alexandus and uberwiggett like this.
  9. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    For those who need it, the updated Invector integration tutorial:


    Adding Footsteps tutorial using Animation Events:
     
    JW86, Weblox and AndyNeoman like this.
  10. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    Yes, it is the latest version. The setup manager does not have the animations list, the editor does. After entering all of the animations in the editor, the controller seems to miss the idles. I am using prefabs that I imported from a project that used the previous version of Emerald, and I have stripped the prefabs of all components. I will try it again using the original FBX's, so that there is absolutely no chance of cross-version pollution. If problems persist, I will make a video.

    This is precisely what I was trying to do, generate a "Bouncer" character, fill it out completely, fix the idle animations, and then copy the EmeraldAI System script to the empty "Bouncer2" prefab, skipping the Setup Manager. I also tried running the Setup Manager to get the EmeraldAI System script on Bouncer2, copied/pasted the values and updated the Animator component manually to point to the same animator controller. That failed as well.

    THAT would be AWESOME! Currently I have 4 bouncer characters, 10 Cops, 20 Soldiers, about 50 citizens, and multiple player characters to select from. The ones that are not selected are used as Companion AI. Add to that the 20 "unique" zombies plus the zombie representatives for each of the above characters, you can see how this might take a while... Each group of characters share the same skeletal hierarchy and bone names. Each group will have the exact same animations. I may break that up later to avoid repetitiveness, but there would be at least 5 or 6 of each sharing the same animation sequences. Using the "Level" field and separate directories seems a logical choice for keeping track of which ones use which animation sets.

    Mark
     
    radiantboy likes this.
  11. pccross

    pccross

    Joined:
    Jun 20, 2015
    Posts:
    106
    Reposting in case it was missed from yesterday:

    So, I had a enemy AI character working reasonably well in my game with version 2.0.
    I switched to new 2.2 version today (completely removing previous version), and seeing some odd behavior. This is a VR game just for context.
    So on initial enemy AI attack of my FPS VR character, the enemy comes within correct range and initiates attack on player. However, if player moves sufficiently far away from enemy, the enemy doesn't appear to recognize player movement, but continues with original attack (initiating damage with axe, etc) from a very far distance.
    If the player bends over (lowering their head), the enemy AI seems to recognize new player position and moves correctly closer to initiate attack.
    Anyone seeing this type of behavior?
     
  12. Alexandus

    Alexandus

    Joined:
    Sep 5, 2012
    Posts:
    25
    Hmm, it has the same tags and layers as the other AI's which are working. Here's the way the model is structured (the first picture is the one that's not working, the second is one that's working) it's a little different than the other models so maybe that's it? WraithModel.png BearModel.png
     
  13. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    That's awesome. Looking forward to integrate into my new Invector Project.

    Hopefully you will still do Integration with RFPS also, even tho it got deprecated recently. The last Integration for RFPS was working nicely, but missing the Integration for Explosion damage. Also I hope you can include a small script to unregister Emerald AI Agents from the RFPS Spawner / Wave System (hooked in their OnDead Event), so we can use the default RFPS Wave Survival Mode with our Emerald AI.

    As always, thanks in advance and keep up the good work!
     
  14. Matro

    Matro

    Joined:
    Mar 15, 2013
    Posts:
    38
    Is it possible to create something like an AI that follows another AI but will hide when danger from yet another AI attacks? like wild boars vs wolves or bears vs bears.
     
  15. huntersteeger

    huntersteeger

    Joined:
    Dec 27, 2017
    Posts:
    19

    For RFPS add the EmeraldPlayerDamage component to the FPS player and uncomment the RFPS lines of code. Then in the ArrowGameObject and WeaponBehavior scripts follow the integration tutorial but instead of using Emerald_AI use EmeraldAI.EmeraldAISystem. This worked for me.
     
    Weblox likes this.
  16. combatsheep

    combatsheep

    Joined:
    Jan 30, 2015
    Posts:
    133
    Thanks, Tech-Byte.
    I'll try to re-customize 2.2.
     
  17. micuccio

    micuccio

    Joined:
    Jan 26, 2014
    Posts:
    143
    Hi Guys,
    I am trying to use Playmaker to send damage to the AI with Emerald 2.2. before I could use Void Damage but now this function is not present.
    Could you please help me?

    Thanks a lot,

    Dom
     
  18. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    In the melee animations, add SendEmeraldDamage at the point where the weapon strikes the opponent.
    For ranged weapons, add CreateEmeraldProjectile in the animation clip at the point where the trigger is pulled.
    I don't use PlayMaker, but one of those functions is likely what you are after.
     
  19. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    @BHS
    I am attempting to add a muzzleflash and casing ejection effect to my ranged character. I have added a small script to the weapon, and put a WeaponEnable in the wield animation and added the weapon to the UseWeaponObject field.
    Script:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class SimpleShoot : MonoBehaviour
    6. {
    7.     public GameObject bulletPrefab;
    8.     public GameObject casingPrefab;
    9.     public GameObject muzzleFlashPrefab;
    10.     public Transform barrelLocation;
    11.     public Transform casingExitLocation;
    12.     public AudioSource soundSource;
    13.     public AudioClip bangSound;
    14.  
    15.    public void Shoot()
    16.     {
    17.         GameObject tempFlash;
    18.         soundSource.PlayOneShot(bangSound, 1f);
    19.         tempFlash = Instantiate(muzzleFlashPrefab, barrelLocation.position, barrelLocation.rotation);
    20.         CasingRelease();
    21.     }
    22.  
    23.     void CasingRelease()
    24.     {
    25.         GameObject casing;
    26.         casing = Instantiate(casingPrefab, casingExitLocation.position, casingExitLocation.rotation) as GameObject;
    27.         casing.GetComponent<Rigidbody>().AddExplosionForce(550f, (casingExitLocation.position - casingExitLocation.right * 0.3f - casingExitLocation.up * 0.6f), 1f);
    28.         casing.GetComponent<Rigidbody>().AddTorque(new Vector3(0, Random.Range(100f, 500f), Random.Range(10f, 1000f)), ForceMode.Impulse);
    29.     }
    30. }
    31.  
    In the Events tab, under Combat, I have added the weapon to the Attack Event, set it to Editor and RunTime, and referenced the SimpleShoot.Shoot function.

    Nothing seems to happen. Please tell me what I am doing wrong.
    Thanks,
    Mark
     
  20. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    Also tried adding a sound to Attack Sounds in Emerald Sounds. No luck.
    Wield and unWield sounds play.
     
  21. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    Has anyone integrated this with suriyans mmorpg package?
     
  22. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    OK, got the attack sound to play by adding an animation event just before the CreateEmeraldProjectile event.
    Do I have to something similar for a muzzle flash?
     
  23. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi is the injector integration docs? For 1.3?
     
  24. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    @BHS
    It appears that if I start with the clean FBX, not an existing prefab, everything in the SetupManager works perfectly.
    So far I have done 2 soldiers, 2 zombies, 2 bouncers, and 2 citizens. Each has their own OverrideController. Any ETA on that bulk character shortcut utility?
    Mark
     
  25. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    @BHS and others...
    Is there still UFPS integration with Emerald 2.2? I tried using the old method, setting all UFPS bullets and melee attacks' Damage Mode to "Both" without editing the vp_FXBullet script as the old Emerald required since the functions and commands have changed, and I get an error thrown up:

    Failed to call function Damage of class EmeraldAISystem
    Calling function Damage with 1 parameter but the function requires 4.
    UnityEngine.Component:SendMessage()
    vp_Bullet:TryDamage() (at Assets/UFPS/Base/Scripts/Gameplay/Combat/vp_Bullet.cs:263)
    vp_Bullet:DoHit() (at Assets/UFPS/Base/Scripts/Gameplay/Combat/vp_Bullet.cs:183)
    vp_Bullet:TryHit() (at Assets/UFPS/Base/Scripts/Gameplay/Combat/vp_Bullet.cs:157)
    <TryHitOnEndOfFrame>d__31:MoveNext() (at Assets/UFPS/Base/Scripts/Gameplay/Combat/vp_Bullet.cs:340)

    Do I need to edit vp_Bullet.cs? Where, and what edits?
    Mark


    EDIT UFPS version 1.7. by the way. $200 for an upgrade to 2.0? Not today!!!
     
  26. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    What's the best way to update to this? delete the old one? or overwrite it ?

    edit: just saw you have to delete the old one, pretty rough, im hoping future releases wont require this again? because there's no point in making a ton of guys then having to do them again :) I feel for people that have, I have kind of.. Cant wait to try 2.2 btw, tomorrow, just backing up!.
     
    Last edited: Mar 3, 2019
  27. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    I will be trying to solve this exact problem once I upgrade to 2.2 :) Im kind of scared to break what I have working, will it?. My game is also ufps, good to know some other ufps guys :) Will let you know if I figure it out, looks like you just need to pass 4 params like:
    TargetEmerald.Damage(CurrentDamageAmount, TargetType.AI, this.transform, SentRagdollForceAmount);

    as for UFPS 2.0 it is a totally different product, I would not suggest trying to update if you're relying on ufps "classic" (as I call it) because that literally means delete ufps and get ufps 2, which is actually an inferior product in my opinion. Even though ufps classic does have quite a steep learning curve imho, it really feels and plays great still. Great match for Emerald!..
     
  28. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    I think I faced the same issue but I was able to copy all of the components from one to another and they worked (all using same animation controller). Im not sure if I had to turn on debug mode (to the right of the lock) or maybe I also used a script I found online called "copy all components from game object" or similar. But I managed to get like 10 people working this way without the pain and suffering of setting them all up. This was on 2.0, not tried 2.2 yet.
     
  29. glchisenhall

    glchisenhall

    Joined:
    Dec 5, 2017
    Posts:
    1
    Integration is working with a little edit to the vp_FXBullet.cs script, similar to before the update only a minor tweak.

    Add
    Code (CSharp):
    1. using EmeraldAI;
    2.  
    3.  
    Then edit TrySpawnFX() like so:
    Code (CSharp):
    1.  
    2.        
    3. protected override void TrySpawnFX()
    4.     {
    5.  
    6.         // move transform to impact point in order for the audio source to play
    7.         // impact sound at the correct 3d position
    8.         m_Transform.position = m_Hit.point;
    9.  
    10.         //Damage Emerald AI object
    11.         if (m_Hit.collider.gameObject.tag == "Emerald AI")
    12.         {
    13.             if (m_Hit.collider.gameObject.GetComponent<EmeraldAISystem>() != null)
    14.             {
    15.                 EmeraldAISystem EmeraldComponent = m_Hit.collider.gameObject.GetComponent<EmeraldAISystem>();
    16.                 EmeraldComponent.Damage((int)Damage, EmeraldAISystem.TargetType.Player);
    17.             }
    18.         }
    19.  
    20.         vp_SurfaceManager.SpawnEffect(m_Hit, ImpactEvent, m_Audio);
    21.  
    22.     }
    23.         }
    Hope this helps someone, drove me crazy for about an hour.
     
    radiantboy likes this.
  30. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    I am thinking of moving to UFPS 1.7. How hard is it to implement both shooter and melee components? I have only worked for Invector TPC Shooter template thus far and does it work well with Emerald AI?
     
  31. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    @BHS We haven't seen ya in a bit? Is UFPS 1.7 still working on for 2.2?
     
  32. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    I can tell you that UFPS 1.7 is still working for me using EmeraldAI. As @glchisenhall says above, you just have to edit the UFPS vp_FXbullet script with the code that he has supplied (and is published in the 2.0 online documentation if you can find it) and add some events to the attack animations to trigger damage.

    One thing that I have not figured out yet is how to add a muzzle flash to my ranged AI's attack sequence. I added an event for attack sounds, another one for projectile spawning, I hope I don't need another event for muzzle flash! Bit too reliant on animation events...

    Mark
     
    radiantboy likes this.
  33. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    How about the melee portion of UFPS?
     
  34. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    The new Duplicator Manager is finished so I'll send it to you in a PM. I have tested it quite a bit and it works well, but I still consider it to be in a beta stage.


    It sounds like your AI may be referencing the wrong player object. Try enabling the Debug tools to ensure the AI is getting the correct player. This is located under the Docs tab under Report a Bug. Make sure Debug Log Targets is enabled.



    Did you setup your attack Animation Events on your other AI?


    Thanks! I saw that RFPS was deprecated, which is unfortunate. I don't typically like to integrate assets that have been deprecated, but if I do, it will most likely be last on my tutorial integrations list.


    Right now, companion AI only fight, but that's an interesting feature that can most likely be added with a feature updated.


    If you want to send instant damage to an AI, you would use:
    Code (CSharp):
    1. void Damage (int DamageAmount, EmeraldAISystem.TargetType TargetType, Transform AttackerTransform, int RagdollForce)



    Any Animation Event scripts must be on the gameobject that has the Animator Controller. Where is your SimpleShoot script located?



    Invector? Yes, it should be the most recent version.


    I will be working on updating the integration tutorials this week, including UFPS. The only change is the function that's called as it was updated with 2.2. This should be in the same place as it is with version 2.0, but instead, you would use the following.

    Code (CSharp):
    1. //Damage Emerald AI object
    2. if (m_Hit.collider.gameObject.tag == "Emerald AI"){
    3.     if (m_Hit.collider.gameObject.GetComponent<EmeraldAI.EmeraldAISystem>() != null){
    4.         EmeraldAI.EmeraldAISystem EmeraldComponent = m_Hit.collider.gameObject.GetComponent<EmeraldAI.EmeraldAISystem>();
    5.         EmeraldComponent.Damage((int)damage, EmeraldAISystem.TargetType.Player);
    6.     }
    7. }


    It's pretty much the same process. I will be updating the integration tutorials this week and they will be replaced with videos, which should be easier to follow.


    Yeah, my apologies for the delay. I needed a little break after all the work I did with version 2.2, but I'm back and will be finishing up all of the integration tutorials and updating the documentation this week. :) Yes, UFPS should be, but the integration tutorial needs to be updated to version 2.2.
     
    Revelation_Jeff and Weblox like this.
  35. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    @BHS Any update on Crux?
     
  36. Revelation_Jeff

    Revelation_Jeff

    Joined:
    Jul 17, 2012
    Posts:
    141
    Great. I'm waiting for the ootii integration video my self =)

     
  37. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    So many ufps guys, anyone want to share their game? Also yes UFPS (classic) requires minimal changes to work so no worries there!! Heres my ai with emerald 2.0 sorry about sound.


    Im upgrading to Emerald 2.2 this week!!!!! And I want to get companions going etc, really excited to see whats possible. But I ask you again @BHS will we ever need to delete everything and restart? I cant see myself doing much with this if so.
     
    AndyNeoman likes this.
  38. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    I too would like that duplication beta, I have plenty of models that use the same animator controller but having to set up the 20+ anims is a bit tedious
     
    radiantboy likes this.
  39. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi bhs when I go to the integration docs some codes are missing even when I rotate my phone to landscape mode to view the codes are like cut
     
  40. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    And is it possible that it also supports the injector 1.2.3 version?
     
  41. combatsheep

    combatsheep

    Joined:
    Jan 30, 2015
    Posts:
    133
    You are right, BHS.

    >NavMesh Radii too high
    This was the cause.
    I set the scale of the scorpion's model 10 times.
    So, maybe NavMesh Radius also become 10 times.

    And It has been fixed and works well.;)


    Thanks!
     
  42. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Does Emerald AI work with the Melee aspect of UFPS 1.7? Sorry switching from Invector TPC Shooter to UFPS 1.7
     
  43. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    @BHS When is Crux 2.0 coming out? I know you had the new interface done a while back.
     
  44. FractalCore

    FractalCore

    Joined:
    May 15, 2009
    Posts:
    151
    I'm having the same issue with sending damage to the AI using Playmaker. It used to be easy, like the previous poster said, using "Void Damage". Which was implemented in such a way that Playmaker could "talk" to it without requiring specific Playmaker Actions be created.

    But you've removed it and this new...

    void Damage (int DamageAmount, EmeraldAISystem.TargetType TargetType, Transform AttackerTransform, int RagdollForce)

    ...system doesn't work the same way.

    I'm posting a picture of what the "Call Method" Action shows inside Playmaker. You probably recognize the collection of "Methods" in here, since Playmaker has found them inside your "Emerald AI System" script. There used to be one called "Void Damage" which let you specify how much damage and who applied the damage. It worked perfectly. All the options in there now don't work for this since the 2.2 change.

    Is there any way you could add back in a method the same as it was (on top of the way you've got it working now). Or would you consider finding out more about Playmaker and creating some Actions of your own. The Playmaker community would very much appreciate it I'm sure.
     

    Attached Files:

    micuccio likes this.
  45. A2GStudios

    A2GStudios

    Joined:
    Nov 21, 2016
    Posts:
    52
    I am using the Legacy Opsive 3rd person controller with Emerald AI, after removing and updating to the Emerald 2.2 I im getting errors with the OpsiveBridge for Emerald. Do you have any documentation for Emerald 2.2 with Opsive 3rd person controller. Here is the code OpsiveBridge.



    using UnityEngine;
    using Opsive.ThirdPersonController;

    public class OpsiveBridge : MonoBehaviour
    {
    private Emerald_AI _emeraldAI;

    private void Awake()
    {
    EventHandler.RegisterEvent<float, Vector3, Vector3, GameObject>(gameObject, "Damaged", ApplyDamage);
    _emeraldAI = GetComponent<Emerald_AI>();
    }

    private void ApplyDamage(float amount, Vector3 point, Vector3 normal, GameObject originator)
    {
    if (_emeraldAI != null)
    {
    _emeraldAI.Damage((int)amount, Emerald_AI.TargetType.Player);
    }

    //Debug.Log(this.name + " took " + amount + " damaged at location " + point + " with normal " + normal + " from object " + originator);
    }
    }
     
  46. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @BHS can you do an integration for blocking for invector 1.2.3 I got errors when I integrate it with my project
     
  47. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    This is the code I wrote. I updated the documentation to integrate new Emerald AI with New Opsive, but I never updated it for New Emerald with Old Opsive. Although I think it should work the same. Can you give it a try and let me know if additional changes are required?

    https://www.opsive.com/forum/index.php?attachments/opsive_v2_emeraldai_intgration-pdf.891/

    [EDIT]
    Actually, I don't think it will work exactly because it references new Opsive using statements. However, I think if you just modify the OpsiveBridge component to look like the new one, but keep the old using statements then it should work.

    [EDIT 2]
    Actually, just give this a try. I can't test, but I think it should work.

    Code (CSharp):
    1. using UnityEngine;
    2. using Opsive.ThirdPersonController;
    3.  
    4. public class OpsiveBridge : MonoBehaviour
    5. {
    6.     private EmeraldAISystem _emeraldAI;
    7.  
    8.     private void Awake()
    9.     {
    10.         EventHandler.RegisterEvent<float, Vector3, Vector3, GameObject>(gameObject, "Damaged", ApplyDamage);
    11.         _emeraldAI = GetComponent<EmeraldAISystem>();
    12.     }
    13.  
    14. private void ApplyDamage(float amount, Vector3 point, Vector3 normal, GameObject originator)
    15. {
    16.     if (_emeraldAI != null)
    17.     {
    18.      _emeraldAI.Damage((int)amount, EmeraldAISystem.TargetType.Player, originator.transform);
    19.  
    20.         //Debug.Log(this.name + " took " + amount + " damaged at location " + point + " with normal " + normal + " from object " + originator);
    21.     }
    22. }
    23.  
     
    Last edited: Mar 6, 2019
  48. LTurek

    LTurek

    Joined:
    Feb 21, 2016
    Posts:
    4
    Hi,
    in my project i made the following change to EmeraldAIPlayerHealth

    public UnityEventGameObjectInt onReceivedDamage;

    public void DamagePlayer (int DamageAmount)
    {
    CurrentHealth -= DamageAmount;
    DamageEvent.Invoke();

    onReceivedDamage.Invoke(gameObject, DamageAmount);

    if (CurrentHealth <= 0)
    {
    PlayerDeath();
    }
    }

    to be able to integrate emerald into another project (usurvive) that needs to get updated on damage as well.
    Is there a way without changing the code?
    BR
     
  49. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    @BHS How do I get the mass setup tool?
    I have no messages in my inbox, and there don't seem to be any replies in my email.
    I am quite eager to test it and hopefully get all my characters configured soon.

    Thanks!
    Mark
     
  50. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    Anyone having issues where the ranged AI would not attack the player? I'm using Core GameKit to spawn the AI into the game. The ranged AI would follow the player and rotate as well but will not shoot. I have added the Animation Event but still nothing.

    If you stand behind the range AI and shoot it, it will turn around and look but that's it.
     
    Last edited: Mar 7, 2019