Search Unity

Malbers Animals-Creatures

Discussion in 'Assets and Asset Store' started by Malbers, Nov 12, 2016.

  1. tahir_ali

    tahir_ali

    Joined:
    Jan 6, 2018
    Posts:
    119
    I found the issue.
    Issue is in the damage script. It gets the root first then find components in the children. Issue is if you put all enemies under a game object as child then references will be according to the order in hierarchy.
     
    Last edited: May 3, 2020
    Malbers likes this.
  2. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    You need to use
    Code (CSharp):
    1. aiAnimal.Mode_Activate(ModeEnum.Attack1, attackIndex);
    Since the GetInstance is only used for the Editor... that will give you problems when you build the game
     
  3. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Thank you so much for finding this!

    I've reworked the Attack Trigger script to solve that issue :) :)
     
  4. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    I've made some adjustments for destroying Waypoints at runtime :)
    Use this changes and tell me if your problem continues
     

    Attached Files:

  5. mbussidk

    mbussidk

    Joined:
    May 9, 2017
    Posts:
    67
    So I guess that this would give me problems as well
    Code (CSharp):
    1. MalbersTools.GetInstance<StatID>("Health")
    is there an equivalent for Stats (I have seen one for States)?
     
  6. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Yes for the stat is similar:

    Code (CSharp):
    1. aiAnimal.State_Activate(StateEnum.Fly, attackIndex);
    you can check all the official IDs. here
    https://malbersanimations.gitbook.i...condary-components/scriptables/scriptable-ids

    Remember that you can always check your own :)
    and Also also
    since all the IDs. are on the Resource folder you can access them via:

    Code (CSharp):
    1. Resources.FindObjectsOfTypeAll<T>
     
  7. DeidreReay

    DeidreReay

    Joined:
    Oct 28, 2019
    Posts:
    50
    Hello all. Invector just released a big update to their templates *( we using shooter/melee) Making it much better adding inventory re haul etc. Reaching out here as malbers (using HAP) was throing some errors related to inventory. Will there be an updated integration in the near future? Thanks
     
    Malbers likes this.
  8. mbussidk

    mbussidk

    Joined:
    May 9, 2017
    Posts:
    67
    Hi @Malbers, I had seen the enum for the StateID, but I have not been able to find a corresponding one for the Stat (such as Health, Stamina, etc). I have seen in the list you linked that you have predefined IDs (such as Health = 1). Can I safely assume they will remain like that?
     
    Malbers likes this.
  9. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Thanks for letting me know :) I'll review the Invector integration this month

    all the Official IDs for States, Modes and Stats will remain with their default values, unless someone changes it :)
     
  10. mbussidk

    mbussidk

    Joined:
    May 9, 2017
    Posts:
    67
    Hi @Malbers, how should I change this code to make sure it works in a build?
    Code (CSharp):
    1.             StatModifier healthChange = new StatModifier()
    2.             {
    3.                 ID = MalbersTools.GetInstance<StatID>("Health"),
    4.                 modify = StatOption.SubstractValue,
    5.                 Value = new FloatReference() { UseConstant = true, ConstantValue = value },
    6.             };
    7.  
    what I'm trying to do is to dynamically create a StatModifier and have it apply to an animal. StatModifier.ID only takes a StatID (ScriptableObject). Should I create one on the fly with ScriptableObject.Instantiate?
     
    Malbers likes this.
  11. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    How can I check through code if an animal can fly? The docs seem outdated.
     
    Malbers likes this.
  12. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Hi @Malbers, Is there a way to stop zones affecting certain animals? I.E I have eat zones that spawn near food for the AI to use but I don't wan't these zones to affect the player as he eats on button press (Input). Otherwise if I walk into the zone with no food and the player presses action he will start the eat animation even though he has no food to eat.
     
    Malbers likes this.
  13. mros

    mros

    Joined:
    Nov 20, 2018
    Posts:
    2
    Hi @Malbers . I feel rather silly for asking this question because it seems that I am missing something basic, while I really tried to read through all comments and all your documentation thus far.

    I can't get my AI Horse prefab to move towards waypoints, it just stands still and does nothing. I have checked Auto-Next Target in the M Animal AI Control Script and even added the first Waypoint in Target. I have also added a MWayPoint Script and defined several Waypoints in the Next Way Points list there. I tried this with both your waypoint prefabs and with transforms of empty gameobects of my own.

    I feel like I am overlooking something really basic. Sorry for taking up your time, but could you please help me out? How do I get my horse to move to a waypoint? (Anyone else who can help me out here is welcome too of course to save Malbers the time. I'd be very grateful wtth an explanation of where I'm noobing out here.)
     
  14. gwm0130

    gwm0130

    Joined:
    Jun 24, 2018
    Posts:
    2
    Hi @Malbers, your animations and animals are amazing! I am still learning how to use your controller fully, and I also use Invector. The Third Person Camera is one of the Invector changes that throws an error.

    This is what I found for the camera error in the InvectorHAPLinks.cs file on line 38 (which I commented out and changed)

    //vCamera = vThirdPersonCamera.instance; //Get Invector Camera
    vCamera = FindObjectOfType<vThirdPersonCamera>();//My change

    The vThirdPersonCamera.instance has an error on the ".instance". Since it is trying to capture the third person camera I just used the FindObjectOfType method. I am not sure if this is what you would recommend but it seems to work. You are a much better coder than I am.

    The other error may be with Invector. If I am riding the Wyvern, it seems like the fall damage sets to a value that is too high and the character dies on dismount.

    And I also am finding that the Invector character cannot interact well with the Wagons. The Wagons either slide away like they are having a permanent collision, or the character when dismounting ma just fall over and stop responding.

    Thank you for all your great work.
     
    Malbers likes this.
  15. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Here's the updated documentation:
    https://malbersanimations.gitbook.io/animal-controller/main-components/manimal-controller/states/fly

    use this instead: GetResource

    Code (CSharp):
    1.             StatModifier healthChange = new StatModifier()
    2.             {
    3.                 ID = MalbersTools.GetResource<StatID>("Health"),
    4.                 modify = StatOption.SubstractValue,
    5.                 Value = new FloatReference() { UseConstant = true, ConstantValue = value },
    6.             };
    7.  
    Here is the new code for Get Resources:
     

    Attached Files:

  16. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    That is a great Idea.. I can add a feature to the zone that only affects animal with certain tags..
    I'll add it to the next update :)
    Edit: (Just added it) :D
    I have also solve the issue with the Removing Waypoints at runtime
     
    Last edited: May 6, 2020
    AndyNeoman and ILJI like this.
  17. mbussidk

    mbussidk

    Joined:
    May 9, 2017
    Posts:
    67
    Hi @Malbers and all,
    for my game I've been building a framework to integrate Invector and Malbers HAP/Animal Controller with Behavior Designer to implement a shared set of behaviours. The goal was to have a single way to direct AIs leveraging the strength of both controllers (Invector for humanoids and Malbers for animals and creatures).

    In the following video you can see how I set up my AIs (a group of four Invector agents and one of Malbers dragons) to have them arrange themselves in an arc formation and then go to a target while maintaining formation.



    Besides this, AIs can call horses, mount them and ride them, combat, damage animals and be damaged by them, etc

    @Malbers, I'll have a few questions for you when I start implementing AI flight...
     
  18. mbussidk

    mbussidk

    Joined:
    May 9, 2017
    Posts:
    67
    An Invector AI calling a HAP horse and riding away...
     
    Malbers likes this.
  19. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Have you check that you have the Nav Mesh Baked? the horse.. any animal in fact need that to move.
     
  20. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Yeap that is the correct Solution to change it :)
    I look for that in invectors code and he also uses FindObjectOfType. They remove the Instance.
    Yes, I think you need to change the Fall Damage with the invector controller.


    @Rowlan found out that multiple idles cause the unwanted behaviours on the Wagon...
    upload_2020-5-6_17-0-15.png

    Muting all the other Idles should solve it
     
  21. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    That is AMAZING. very impressive!!
    Of course! :D
     
  22. mros

    mros

    Joined:
    Nov 20, 2018
    Posts:
    2
    Hi @Malbers

    Thanks for replying.

    Yes, I even rebaked it just to be sure. It also has a NavMeshAgent component.
    These are the components I have on the animal and the settings I have on them.


    malbers1.png malbers2.png malbers3.png

    And this is my scene view. But the horse just keeps standing still.

    Again I feel like I'm overlooking something really really basic, which makes it very frustrating that I can't seem to find out what :)

    malbers4.png
     
  23. gwm0130

    gwm0130

    Joined:
    Jun 24, 2018
    Posts:
    2
    @Malbers thank you so much for your help.
     
  24. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    @Malbers, URP is well out of beta, even if it still has a lot to improve on. It might be worth including the URP integration in your packages rather than having them be externally hosted.
     
    Malbers likes this.
  25. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    I'm still not sure how to determine if the mounted animal can fly. I'd like to do something like this...
    if(Rider.Montura.Animal.CanFly)
    but there is no CanFly bool.

    Otherwise, could I check for the existence of the fly stater some other way? Somethink like this?
    if(Rider.Montura.Animal.states.Contains("Fly"))
    ? But that doesn't work.

    Otherwise, if I create a "CanFly" tag on the animal, can i check for that somehow? There are no docs for tags.
     
    Last edited: May 10, 2020
    Malbers likes this.
  26. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Hi @Malbers. I'm having a similar issue to the waypoint problem when I destroy an item that is in hand (picked up) or dropped but still in the focused zone. Is there a way to safely destroy these items? Edit:- I've progressed slightly with this as I now require player to drop item before the destroy is needed so this removes the "item" missing issue but it still leaves the "focused Item" missing when it's destroyed as its destroyed at the players feet in the pickup zone if that makes sense. As the script that destroys the pickable is on itself it doesn't know who has dropped it so it can't alter the Mpickup script which has the 'missing' comment in the focused item slot.

    Also I'm having a strange problem when starting the game on my terrain. The animal will not move (but animations play) it's as if they are in the air slightly. No problem in my test scene on a plane so not sure why it only affects on terrain. If i do an attack the animal does that animation then seems to find terrain and it works normally. Strange how it does not work straight away though.
     
    Last edited: May 11, 2020
    Malbers likes this.
  27. KaoticBrew

    KaoticBrew

    Joined:
    Dec 11, 2016
    Posts:
    7
    Hey @Malbers I'm trying to get the drink animation to loop while using a zone. It seems to always play up to the defined duration for the action (3 seconds I believe) regardless of the other settings I'm using. How can I make it so that the zone can essentially play the drink animation until it's interrupted?
     
    ProceduralCatMaker and mandisaw like this.
  28. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    @Malbers Do you know why I've been getting this error recently? Strangely, it seems to happen only half the time when I enter PlayMode...

    Screen Shot 2020-05-12 at 12.11.07 pm.png
     
  29. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Awesome! I'll finally start to Working on the Malbers Menu then :D :D
    upload_2020-5-11_21-30-11.png

    I have updated the tags documentation
    and also the script now has some good extensions
    https://malbersanimations.gitbook.io/animal-controller/secondary-components/scriptables/tags

    To know if a Mount can fly you can do this:

    if(Rider.Montura.Animal.HasState(StateEnum.Fly))

    or
    if(Rider.Montura.Animal.HasState(10))

    Check all the Ids here:
    https://malbersanimations.gitbook.i...condary-components/scriptables/scriptable-ids

    I will add the code for strings too ;)
    This one, on the next update
    if(Animal.HasState("Fly"))
     

    Attached Files:

    Last edited: May 12, 2020
    mandisaw and transat like this.
  30. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    I'm removing that Debugger .. but you can avoid that by disabling Debug modes on the Debug group on the Animal
     
  31. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Thanks for reporting this... I'm adding a Forever Option on the Status.
    upload_2020-5-11_23-24-53.png

    So the mode can be stop only when Mode_Interrupt is called.



    (All the other questions I'll be fixing them tomorrow :) @AndyNeoman
    But this new update is a juicy once :)
    Check it out here:
    https://malbersanimations.gitbook.io/animal-controller/annex/changelog
     
  32. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,274
    Would it be possible to have a common class for constants instead of magic strings? I'm getting confused with all the possibilities. eg how can I have Unka fly in the air and then have the action breath fire to ground invoked? Is there some list of all the possibilities / constants i can use?
     
  33. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    I had disabled debug modes! That’s when i started getting the errors I think. I think something in my code might have been triggering it though as the errors seem to have disappeared after some tweaking.
     
  34. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    Cheers Malbers!!
     
  35. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    A common Class? Do you mean like the Hash script? with that class you can access the Default ID values for States and Modes
    upload_2020-5-12_12-19-55.png

    In Case of the modes... You or Me create your own IDs for the Modes Animations/Abilities... like the FireBreath.. since not all the Characters Have the same Extra animations for the Attacks, Actions, etc etc. That is why in case of the Mode Abilities there's no specific values... except for Actions.. which were already created from the old controller.
    The name and the IDs for the abilities can be anything you want
    upload_2020-5-12_12-24-37.png

    Hope this helps :D
     
    Rowlan likes this.
  36. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Hey there! I'm doing on my side destroying the Pickable items after is picked but no errors are thrown except that the UI stays Up when the item is destroyed. so Im solving that first.
    If I destroy the item while is Focused (Inside the Pick Up Area) it works too
    I've added this code to the OnDisable on the Pickable:
    upload_2020-5-12_15-17-47.png

    Are you using Gaia or any other kind of terrain?
    and as usual can you make a video of it :)
     
  37. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Yes I'm using Gaia can that be a problem?
     
  38. frogskin

    frogskin

    Joined:
    Sep 27, 2017
    Posts:
    2
    Hi @Malbers
    I'd like to ask is it possible to provide an sample fbx file for testing?
    I really like the animation and rigging of Poly Art Animals Forest Set
    But we want to make sure if it's doable to create our own model to fit in your animation
    If it works great, I'm very happy to buy your pack!
    Many thanks
     
    Last edited: May 13, 2020
  39. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Hi there!
    Actually you can have any model working with my animals :)
    I made a tutorial on how to do it long time ago ;)




    It should not be a problem :) I've seen @Rowlan using the animals with Gaia... but I'm doing some test on my side
     
    mandisaw and frogskin like this.
  40. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Just test it out on gaia and everything is working as expected :)
     
    AndyNeoman likes this.
  41. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,274
    That must have been someone else. I never have, never will
     
    Malbers likes this.
  42. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Thanks @Malbers it was an issue with the trigger collider being on the wrong layer. Fixed now. I've still got the missing issue on the focused item but maybe your update will fix it as I don't have the method you show in the screenshot above (AllPickablesRemove(this)).

    The OnFocused.invoke(false) alone does not do the trick unfortunately.
     
    Last edited: May 14, 2020
  43. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    The Update would be ready tonight so it will be live on the store no further than friday
     
    AndyNeoman likes this.
  44. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Hey guys meet Steve
    he will be part of the Animal Controller as an example of Humanoids controlled by AC ^^
    3dsmax_fPbDNYriNC.png 3dsmax_TV3sWfsgs1.png
     
    mandisaw, ILJI, johaswe and 2 others like this.
  45. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    191
    Just curious, are Steve's clothes separated? If we wanted could we add different clothing to Steve?
     
    transat and Malbers like this.
  46. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Here's some experimenting with TimeLine integration for the Animals :) (in progress)
     
    mandisaw and Vog like this.
  47. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Steve will have only one set of cloth.... because will be included with AC... (with colors changeables within unity)
    But steve will have some new stuff in the future ;)
    upload_2020-5-14_15-55-16.png
     
  48. ash4640

    ash4640

    Joined:
    Jan 19, 2018
    Posts:
    66
    hi I have your Polyart Animals pack; but thought of getting the Polyart Ravens too now as my game needs some crows, should have brought it when the unity sale was going :( (not sure if this was on sale).
    The question is will Raven's animations work with this flock bundle - https://assetstore.unity.com/packages/3d/characters/animals/bird-flock-bundle-25576
    i.e., can I make the raven and it's animations work with that plugin.
    Btw brought your dragons too, just love them.
     
  49. PythonDK

    PythonDK

    Joined:
    Sep 23, 2012
    Posts:
    16
    Will he have scalable bones like your other assets? And maybe a female counterpart?
     
    Malbers likes this.
  50. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    It should work without AC...
    At the end they are just models, textures and animations ;)
     
    ash4640 likes this.