Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[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. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    When you guys have the script finalized could you maybe share it?

    I can see having some use for this in the near future..

    Thank you
     
  2. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    You mean the script I posted as an example?
     
    zKici likes this.
  3. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    Yessir,

    But fully without it being in parts (sorry not a good programmer...)
     
  4. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I wasn't planning on finishing it. Sorry. It was just a quick and dirty example. But maybe the person who needed it might finish it up and provide a final solution.
     
  5. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    No worries - Thank you

    And lets hope so :)
     
  6. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Ideally, the asset author would provide events that can take parameters and then all the information needed could be passed to the event functions. That takes a little more re-work than my sample so that's why I didn't take that approach.
     
  7. PixelPounder

    PixelPounder

    Joined:
    Feb 11, 2014
    Posts:
    56
    With Opsive essentially replacing UFPS and the Third Person Controller that they have out now with their new Ultimate Character Controller... do you have any plans on coming out with an integration for it? I realize it just came out... just curious if this is in your pipeline of things to do... if so, when? Thanks.
     
    Duffer123 likes this.
  8. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    BHS seems to have been afk for while?!
     
  9. DanBanner

    DanBanner

    Joined:
    Dec 11, 2015
    Posts:
    29
    I'll be working on it this week and once I have it working I'll let you know! I'll be happy to share it.
     
    zKici likes this.
  10. DanBanner

    DanBanner

    Joined:
    Dec 11, 2015
    Posts:
    29
    Thank you Magique for that code example, it has put me on the right track. This is why I love this community! Thanks again.
     
    magique likes this.
  11. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    320
    Any news about the new version?
     
  12. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @BHS ,

    Just to mention that Opsive's Ultimate Character Controller and TPC2 are up on the Asset store and Opsive's website has an Integrations section ready for your Integration .. ;). Also, TPC has been deprecated...
     
    Mark_01, BHS and PixelPounder like this.
  13. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    Is Emerald AI still being supported? I haven't seen anything from BHS lately?
     
  14. DanBanner

    DanBanner

    Joined:
    Dec 11, 2015
    Posts:
    29
    Last message was a couple of weeks ago, I assumed it was vacation time.
     
  15. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    Same thing was said about the Aquas dev and ICE Creature Controller dev. Now both of them are gone.
     
  16. DanBanner

    DanBanner

    Joined:
    Dec 11, 2015
    Posts:
    29
    I'm keeping myfingers crossed!
     
  17. PixelPounder

    PixelPounder

    Joined:
    Feb 11, 2014
    Posts:
    56
    Quick question on companions: In the docs it says, "Companion - Will follow around their follow target and attack anything within their target tag list. Companion AI do not use the Confidence system."

    Is there a way where you can set it so it only attacks if you send it to attack? You may not always want it to attack automatically because you're planning an ambush or you're trying to be stealthy. I guess one way to do it is when you select/mouse click/put your aiming reticle and push a button (for joystick games) on something, it adds that target's tag to the target tag list and then I assume it would then attack it? Is that possible?

    Also, I assume companions can take on damage and be killed?
     
  18. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I remember in the sample video it demonstrates a case where the companion will only attack things that you attack so that they won't blow an ambush or expose you when you're trying to sneak around. I can't remember what the setting was though, but the video mentions it.
     
  19. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey everyone!

    Emerald AI, along with my other systems, are all very much alive. My apologies for not being as active on the forums as I should be. I’m very invested in my systems and that’s what’s been keeping me so busy.

    I will respond to each one of your posts soon and I will try my hardest to check for new posts daily.
     
  20. DanBanner

    DanBanner

    Joined:
    Dec 11, 2015
    Posts:
    29
    YAY! I never doubted you for a second!
     
    BHS and Duffer123 like this.
  21. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    Updates cannot come soon enough, been waiting on it like cold Water in the middle of a hot desert.
     
    Duffer123 and SickaGames1 like this.
  22. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    You're welcome. Yes, I can certainly fix it. It's been added to the list.


    Oops, that's because that variable is private. I will make it public with the next update along with some new API to update an AI's wandering position.



    That's odd, the AI should be stopping consistently. If your AI's NavMesh radius is high, this is another thing that can affect stopping distance. I will look into this though. Are you referring to Unity's Debug Mode? This can be set by doing the following:
    DebugModeUnity.png


    I will look into this after I have finished the next Emerald AI update.


    Thanks, I'll take a look.


    Good, I will do a status update within the next couple of days with more details.


    Hey there and great to hear. :)


    With an external script, I would say it's possible. You would have to have colliders that the UFPS bullet component hits instead of Emerald AI directly. Each object could receive the damage done by UFPS's bullet and multiply it based on a variable stored within the body object.


    The rotation for particles is set based off of what it should be. If you're having issues with rotations, you can:

    1) Store your particle effects in an empty gameobject and set the particle effects as the child and adjusting the rotations as needed.
    2) Adjust the rotations for the particle effect with the Particle System using the Shape section.

    The animations and models that come with the pack are just for demonstration purposes. Setting up animations to be used with projectiles is the same as setting them up for melee combat except you use the Attack Delay to time when the projectile fires. If you're looking for free high quality animations, you can use www.mixamo.com. You can get the same animations and models that were used in some of Emerald AI's demo videos.


    Strange, I just tested this with the same version of Unity as you and everything looks as it should. I have a 28 inch monitor and I'm not experiencing this issue. I have no idea why it wouldn't be scaling correctly. I will try to see if I can recreate it though.

    EditorSize.png

    If you're having inconsistencies with AI detection, it's usually because of an AI's raycast detection. This is usually happens when the AI's Box Collider that Emerald AI automatically applies is too small making other AI unable to detect them as targets. This can be fixed by making the Box Collider fit your AI's model better. Make sure the Box Collider is close to the ground to ensure it's not missed. If this doesn't resolve your issue, just let me know.


    I will be reworking/improving events at some point as I see how versatile they can be for users.


    Yes, I wasn't aware that it was release. I'll be reaching out to the developers sometime today. I will work on adding an integration tutorials asap.


    Companions use their own "Confidence" system and that is Combat Style. It's located under the Temperament tab and as either defensive or offensive. Defensive will only allow an AI to attack if its follow target is being attacked and offensive will allow it to attack anything within its attack radius regardless of whether the follow target is being attacked.
     
  23. PlainStudios

    PlainStudios

    Joined:
    Sep 9, 2013
    Posts:
    18
    Could somebody please help me . I'm using UFPS and I can't figure out how to make the AI damage me and how I can damage them . I found some guides on how to setup everything but they are outdated . I also have a problem where the AI would attack eachother but any time I use a UFPS character they would ignore me , I made some objects to test and the AI attack them but they always ignore me
     
  24. DanBanner

    DanBanner

    Joined:
    Dec 11, 2015
    Posts:
    29
    Make sure you have the "Player" layer selected in the AI's "Detection Layers" dropdown (it's multiselect). Found under "Detection & Tags" in the "Tag Options".
     
    PlainStudios likes this.
  25. PlainStudios

    PlainStudios

    Joined:
    Sep 9, 2013
    Posts:
    18
    I do have detection set to the player layer and my player is on the player layer .. The AI just doesn't attack me . I used the exact same setting on a cube I created and they all rushed it . They just won't go for my UFPS character . I tried adding the cube to my character as well but then it just doesn't work either .
     
  26. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Are you using older UFPS or the new version 2.0 just released?

    [EDIT]
    I just tried on older UFPS and it works. Two key things to note. Don't forget to fix your UFPS Physics to disable "Has collision trigger". And if you are using the Line of Sight example, remember that it won't attack unless it has direct line of sight so you may want to change the enemy to Trigger instead of Line of Sight.
     
    Last edited: Sep 20, 2018
  27. PlainStudios

    PlainStudios

    Joined:
    Sep 9, 2013
    Posts:
    18
    Hi , I'm using the older UFPS , I turned off has collision trigger and it still didn't work . So I made a capsule and did all the setting after which they started attacking it then I went ahead and started copying all the scripts to it and they left it alone . I have been trying to get it to work for a week now but nothing I do makes it work . I guess I should just scrap my game because I can't get the AI to work properly . They attack each other and they attack other objects that I create but the won't attak my UFPS character no matter what I do . Thanks for the help though
     
  28. PlainStudios

    PlainStudios

    Joined:
    Sep 9, 2013
    Posts:
    18
    I narrowed down the problem to the vp_fp controller script but it is not the collision trigger setting
     
  29. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I can only guess that you must have followed the instructions wrong or you have made other changes to your project that are affecting this such as layers, tags, physics collisions, etc. You should do a sanity test and create a new project and only import UFPS and Emerald AI and then follow the instructions using the Line of Sight demo. If it still doesn't work then I'm truly baffled because I did that exact thing and it was fine.
     
  30. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    Just in case - here is the link to the UFPS Integration Tutorial . I'm not using UFPS, but if you are using the "older" Version of UFPS i think this should not be outdated.
     
    Last edited: Sep 21, 2018
  31. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Good point. That's the tutorial I used and it worked. But there are older ones out there and maybe that's what he used.
     
    Weblox likes this.
  32. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    @BHS - I know you are super busy with all the updates planned, but speaking of the Integration Tutorials:

    I am using Emerald AI with RFPSP currently and I noticed that Integration is not fully complete. Maybe you can look into the following Issues when finding the time:

    Can you please support us with a script to hook into the Emerald_AI's OnDeath() UnityEvent, that will let us use Emerald AI Agents with the RFPSP "Faction war" and "Wave survival" Modes?

    - RFPSP has its own "Faction war" and "Wave survival" Mode with AI Spawners and a corresponding Wave Manager.To use these Modes and their Spawners the AI Agents must unregister from RFPS when killed, so the Wave Manager & UI can interact with Emerald AI. For example, CharacterDamage.cs does it like this:

    Code (CSharp):
    1. AIComponent.NPCRegistryComponent.UnregisterNPC(AIComponent);//unregister NPC from main NPC registry

    - RFPSP is using Grenades/Mines/Explosives that currently will not damage the Emerald AI Agents. I suppose the Emerald Integration code has to be added to another "case 13" somewhere, but cannot figure out where exactly. :confused:

    As always - Thanks in advance and keep up the good work!
     
    Last edited: Sep 21, 2018
  33. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I can certainly look into these. Adding an OnDeath event programmatically can be done with doing:
    Code (CSharp):
    1. YourEmeraldAIReference.OnDeath.AddListener(() => YourRFPSEvent());
    So, I'll have to look at how RFPS handles their wave system, but it seems like it should be possible.

    I have been meaning to update the tutorial with info on how to add explosives damage. It's essentially the same as the arrow or melee damage script additions. You look for the case that uses the NPC layer and assign the extra code to damage Emerald AI agents.
     
    Weblox likes this.
  34. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    @BHS - Now that was a quick reply! Thanks a lot for all the hints and tipps.

    When it comes to coding I really tend to mess things up, but I am not in a great rush, so I will wait until you find some time to look into these. Especially the Wave System Integration will be essential to my Demo Project. I will try to get Explosives to work somehow, but good to know you plan on adding this to the Integration Tutorial aswell.

    Thanks again for great support!
     
    Last edited: Sep 21, 2018
  35. PlainStudios

    PlainStudios

    Joined:
    Sep 9, 2013
    Posts:
    18
    Thank you SO MUCH !!! I finally got the problem solved by following the guide provided . The other guides were all outdated . Now I can continue developing my game :D
     
  36. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    How are things going with the Emerald AI updates?
     
  37. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    Hi,I have three questions:

    1.When my UFPS Player collides with the Emerald AI, it slides over the BoxCllider.
    2.Emerald_AI always rotates and moves in battle, how to keep it in a position to attack.
    3.When the Emerald_AI goes to the waypoint, it will cross the building on the road, and the building's boxcollider cannot block it.
     
    Last edited: Sep 22, 2018
  38. DanBanner

    DanBanner

    Joined:
    Dec 11, 2015
    Posts:
    29
    To eleborate on the problem i am having with the AI not going to the destination properly. I have recorded my screen and put the video here...
    http://digitalmedic.co.uk/SetDestinationFail.mp4

    If you look at the scene view you can see a Yellow cube and a Green cube. My script simply sets the destination to the position of the cude (in my case a food object).
    ai.SetDestination(foodObject.transform);

    As you can see the AI went directly to the Yellow cube as expected, but the AI goes wrong when going to the Green cube.

    This is a very intermittent problem as this took 7 attempts until it went wrong, the previous 6 attempts all went perfectly.
     
  39. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @BHS ,

    I am really looking forward to integrations with TPC2/UCC. The old TPC has been deprecated.
     
    gamequest likes this.
  40. FolkvangStudios

    FolkvangStudios

    Joined:
    Aug 25, 2017
    Posts:
    91
    2 major problems (to me):
    Enemy waits far too long to attack giving the player enough time to simply step away.

    When enemy dies, it is floating halfway in the air. Not like in the demo video where the ogre fell to his knees then landed on the ground.
     
  41. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Great, I will explain everything in detail within the next couple of days with a status update. The Root Motion support is coming along nicely and looks great, but it's taking longer than expected to implement. I have to completely rebuild the Animator Controllers that Emerald AI generates, but this allows AI to use Blend Trees and have smooth seamless animation transitions. This also means I have to reprogram all of the animation portions of the main scripts. AI that are not using root motion will still of course be supported. I've also been rewriting the code that is responsible for aligning AI with the angle of the terrain and other objects to be far more efficient and look better. I will try to get this update out asap.


    1) This is more of an issue with UFPS. I remember seeing a solution to fix this a little while back, but I cannot remember where unfortunately. I'll see if I can find it again for you.
    2) You can tune this by adjusting the Turning Angle Stationary setting located under AI's Settings>Movement.
    3) You have to bake your scene with Unity's Nav Mesh in order for the AI to properly navigate through your level. A nice guide for this can be found here: https://docs.unity3d.com/Manual/nav-BuildingNavMesh.html


    Thanks for the video. I think I've figured out what's happening. My guess is that the dynamic position generated using the Dynamic Wander Type is never cleared. So, when your AI has reached its destination, it goes to the previously generated dynamic waypoint. Try adding the code below to the top of the SetDestination function within the if statement to see if it fixes your issue. This should reset the NavMesh position before assigning a new one. It's weird because the previous destination should be overwritten by default with Unity's NavMesh system.
    Code (CSharp):
    1. AIAgent.ResetPath();

    I have a copy of UCC so I will work on adding support for it some time this week.


    1) Set your AI's Min and Max Attack Speed to 0. This can be found under AI's Settings>Combat.

    2) You need to make sure you have a death animation applied to the Death Animation slot. You also need to make sure your death animation is supported by your AI's model. Test it in the animation view within the inspector prior to applying it to your AI. Both of these can cause a death animation to float in the air instead of playing.
     
  42. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    Awesome! I think your AI system with the right features will be top notch compared to the others. If the system could somehow do complex fights with the ease of use it has now, you will far and away exceed any other asset store AIs without doing the whole visual scripting thing.
     
    hoodoo likes this.
  43. C_p_H

    C_p_H

    Joined:
    Nov 24, 2014
    Posts:
    153
    Hi @BHS

    There appears to be an issue with EmeraldAi2's windows (for me on Unity 2018.2.9f1 macOS Metal, see attached screen shots below). Eai_Cuts Off even with expanded window.png Eai_Script Window doesn't resize in its panel.png EmaraldAI_Opens Stretched_un-nested.png EmeralAI_Opens Stretched_Nested.png
    Resizing doesn't work properly even if resized to full screen both un-nested and nested(scrolling works to see the cut-off tabs in Unity's Editor but not auto-resizing when adjusting its width) as well as with an old project nor a clean install new project.

    Only errors I can generate in the console is when I attempt to switch the Unity Layout View but not sure if E-Ai2 is a culprit of that, but I've inserted those errors here for your review also just in case it'll provide a clue.
    Failed to destroy views: #44
    HostView
    SplitView

    0 Unity 0x00000001019fcadc _Z13GetStacktracei + 92
    1 Unity 0x0000000100c0ab7b _Z17DebugStringToFileRK21DebugStringToFileData + 795
    2 Unity 0x0000000101e54f26 _ZN15DebugLogHandler12Internal_LogE7LogTypeN4core12basic_stringIcNS1_20StringStorageDefaultIcEEEEP6Object + 310
    3 Unity 0x0000000101e54cfa _Z35DebugLogHandler_CUSTOM_Internal_Log7LogTypeP10MonoStringP10MonoObject + 330
    4 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,string,UnityEngine.Object)
    5 (Mono JIT Code) [WindowLayout.cs:483] UnityEditor.WindowLayout:LoadWindowLayout (string,bool)
    6 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_bool_object_byte (object,intptr,intptr,intptr)
    7 libmonobdwgc-2.0.dylib 0x0000000144f0ec74 mono_jit_runtime_invoke + 2519
    8 libmonobdwgc-2.0.dylib 0x00000001450cf221 do_runtime_invoke + 80
    9 libmonobdwgc-2.0.dylib 0x00000001450cf17f mono_runtime_invoke + 31
    10 Unity 0x0000000101032dfa _ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb + 106
    11 Unity 0x0000000101951ab9 _ZN16WindowLayoutMenu7ExecuteERK8MenuItem + 201
    12 Unity 0x000000010197450e _ZN14MenuController15ExecuteMenuItemER8MenuItemNS_14ExecutionCauseE + 110
    13 Unity 0x00000001006bb9f4 -[CocoaMainMenu executeStandard:] + 324
    14 AppKit 0x00007fff286bea43 -[NSApplication(NSResponder) sendAction:to:from:] + 312
    15 AppKit 0x00007fff28153213 -[NSMenuItem _corePerformAction] + 323
    16 AppKit 0x00007fff28152f9b -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 114
    17 AppKit 0x00007fff281d8c7a -[NSMenu performActionForItemAtIndex:] + 133
    18 AppKit 0x00007fff281d8be5 -[NSMenu _internalPerformActionForItemAtIndex:] + 94
    19 AppKit 0x00007fff281d8a15 -[NSCarbonMenuImpl _carbonCommandProcessEvent:handlerCallRef:] + 106
    20 AppKit 0x00007fff2809f2a2 NSSLMMenuEventHandler + 882
    21 HIToolbox 0x00007fff29c4e904 _ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec + 1541
    22 HIToolbox 0x00007fff29c4dc4d _ZL30SendEventToEventTargetInternalP14OpaqueEventRefP20OpaqueEventTargetRefP14HandlerCallRec + 374
    23 HIToolbox 0x00007fff29c62f21 SendEventToEventTarget + 39
    24 HIToolbox 0x00007fff29cac3f9 _ZL18SendHICommandEventjPK9HICommandjjhPKvP20OpaqueEventTargetRefS5_PP14OpaqueEventRef + 411
    25 HIToolbox 0x00007fff29cd52ee SendMenuCommandWithContextAndModifiers + 49
    26 HIToolbox 0x00007fff29cd52aa SendMenuItemSelectedEvent + 188
    27 HIToolbox 0x00007fff29cd5184 _ZL19FinishMenuSelectionP13SelectionDataP10MenuResultS2_ + 96
    28 HIToolbox 0x00007fff29ded87c _ZL19PopUpMenuSelectCoreP8MenuData5PointdS1_tjjPK4RecttjS4_S4_PK14__CFDictionaryPK10__CFStringPP13OpaqueMenuRefPt + 1662
    29 HIToolbox 0x00007fff29deccf7 _ZL26_HandlePopUpMenuSelection8P13OpaqueMenuRefP14OpaqueEventRefj5PointtjjPK4RecttS6_S6_PK14__CFDictionaryPK10__CFStringPS0_Pt + 409
    30 HIToolbox 0x00007fff29cb540c _HandlePopUpMenuSelectionWithDictionary + 268
    31 AppKit 0x00007fff281cf79a _NSSLMPopUpCarbonMenu3 + 5632
    32 AppKit 0x00007fff281ce0f4 -[NSCarbonMenuImpl popUpMenu:atLocation:width:forView:withSelectedItem:withFont:withFlags:withOptions:] + 439
    33 AppKit 0x00007fff2823e25c -[NSPopUpButtonCell trackMouse:inRect:eek:fView:untilMouseUp:] + 570
    34 AppKit 0x00007fff282b7067 -[NSPopUpButtonCell performClickWithFrame:inView:] + 128
    35 Unity 0x00000001006beb74 _Z22ShowDelayedContextMenuv + 1940
    36 Unity 0x00000001006d828d _ZN7GUIView12OnInputEventER10InputEvent + 1453
    37 Unity 0x000000010194dd82 _ZN7GUIView17ProcessInputEventER10InputEvent + 50
    38 Unity 0x00000001006f0384 -[GUIRenderView mouseDown:] + 132
    39 AppKit 0x00007fff2885dd6d -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 5891
    40 AppKit 0x00007fff2885a9c4 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 2359
    41 AppKit 0x00007fff28859c70 -[NSWindow(NSEventRouting) sendEvent:] + 497
    42 AppKit 0x00007fff286bb236 -[NSApplication(NSEvent) sendEvent:] + 2462
    43 Unity 0x00000001006e2d6b -[EditorApplicationPrincipalClass sendEvent:] + 267
    44 AppKit 0x00007fff27f1b8b5 -[NSApplication run] + 812
    45 AppKit 0x00007fff27eeaa72 NSApplicationMain + 804
    46 Unity 0x00000001006e3217 _Z10EditorMainiPPKc + 839
    47 Unity 0x00000001006e3699 main + 9
    48 libdyld.dylib 0x00007fff52879015 start + 1

    Thanks for taking the time to investigate.:confused:
     
  44. PlainStudios

    PlainStudios

    Joined:
    Sep 9, 2013
    Posts:
    18
    I have a problem . I made one AI enemy and it works fine so I made another the problem now is that when I try to create the animation override controller I get an error .

    This is the error

    NullReferenceException: Object reference not set to an instance of an object
    Emerald_AI_Editor.OnInspectorGUI () (at Assets/AI/Scripts/Editor/Emerald_AI_Editor.cs:4114)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1374)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  45. claudiorodriguescampos

    claudiorodriguescampos

    Joined:
    Jun 23, 2017
    Posts:
    98
    I use Emerald AI integrated with UFPS into two games. One game uses the old Emerald AI version 1. The newer game uses Emerald AI version 2. In the first game, I use a grenade and it works perfectly. I use the same grenade in the second game. But for some reason, the grande doesn't give damage to Emerald AI enemy in Emerald version 2.

    I receive the following error message:
    Code (CSharp):
    1. Failed to call function Damage of class Emerald_AI
    2. Calling function Damage with 1 parameter but the function requires 2.
    3. UnityEngine.GameObject:BroadcastMessage(String, Object, SendMessageOptions)
    4. vp_Explosion:TryDamage() (at Assets/UFPS/Base/Scripts/Gameplay/Combat/vp_Explosion.cs:285)
    5. vp_Explosion:DoExplode() (at Assets/UFPS/Base/Scripts/Gameplay/Combat/vp_Explosion.cs:254)
    6. vp_Explosion:Update() (at Assets/UFPS/Base/Scripts/Gameplay/Combat/vp_Explosion.cs:180)
    the error is coming from this line
    Code (CSharp):
    1. m_TargetCollider.gameObject.BroadcastMessage(DamageMessageName, (DistanceModifier * Damage), SendMessageOptions.DontRequireReceiver);
    How can I fix this?
     
    Last edited: Sep 26, 2018
    nellecter likes this.
  46. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Thanks for the bug report.

    There was another user who was having the same problem with Unity 2018.2.6f1, but I was not able to recreate it. I'm wondering if it is related to Mac. I don't think I have had any other reports of it. As soon as I find out what's causing it, I will be able to find a fix. Sorry for the inconvenience.

    @Darrkbeast There's another user who is having the same window scaling issue, are you using mac as well?


    Hey there,

    There are a few things that can cause an error like that. Are you using the Setup Manager or the Create Animator button within the Emerald AI editor?

    Please double check the following:
    1) Have you rearranged the folder structure of Emerald AI? Currently, it is dependent on having the Emerald AI folder in the main Assets folder.
    2) Is this a duplicate AI or a different model?
    3) Do you have an Animator and Avatar attached to your AI object? Not doing this can cause that error.


    Emerald AI changed the function that handles damage. Is that a custom BroadcastMessage?

    Try using:
    Code (CSharp):
    1. m_TargetCollider.gameObject.GetComponent<Emerald_AI>().Damage(Mathf.Round(DistanceModifier * Damage), Emerald_AI.TargetType.Player);
     
  47. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    What updates does your next release have?
     
  48. claudiorodriguescampos

    claudiorodriguescampos

    Joined:
    Jun 23, 2017
    Posts:
    98
    Your code works, thank you. I just made a small change to it.

    Code (CSharp):
    1. if (m_TargetCollider.gameObject.tag == "Emerald AI"){
    2.     m_TargetCollider.gameObject.GetComponent<Emerald_AI>().Damage( (int)Mathf.Round(DistanceModifier * Damage), Emerald_AI.TargetType.Player);
    3. }
    About the broadcast message that you asked. I must confess that I have no idea where this comes from. If it was from Emerald 1, UFPS or another source code.
     
  49. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    @BHS,

    1. Is there a way to wonder around my 'set location' within an X radius?

    2. Why is the chase distance minimum of 24?
    I'd rather be able to chase only say a distance of 5 outside my 'set' location so it does not go too far from the wonder/waypoint location.

    3. Is there a way to randomly walk the waypoints? If not will you please implement that with your update...

    4. When the NPC walks/runs up to the player, I wan't an instant attack, takes too long to attack the player by the time he is out of reach again.
    I do have min/max attack speed set to 0.
    Also 0 attack delay and run attack delay.

    Attack should be more instant no?

    Thank you
     
    SickaGames1 likes this.
  50. erichey

    erichey

    Joined:
    May 5, 2017
    Posts:
    20
    Any update on a tickbox for ragdoll death?