Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Combat Framework

Discussion in 'Assets and Asset Store' started by username_unity_of_my, Aug 29, 2016.

  1. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    328
    Look into the Cameras folder. There are all the camera scripts.
    Player uses 'OrbitAimCamera'.
     
  2. NightcoreLV

    NightcoreLV

    Joined:
    Feb 26, 2014
    Posts:
    34
    The asset seems not working with 2019.4, any fix incoming?
     
  3. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    328
    Yes, Unity 2019.4 update coming soon
     
  4. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    328
    Update for Unity version 2019.4 uploaded!
     
    NightcoreLV likes this.
  5. lolaswift

    lolaswift

    Joined:
    Jan 10, 2019
    Posts:
    151
    hi, you might want to check your demo 1. It doesn't go into full screen and there is no option to choose a resolution either. The game starts normally but in a small window. Demo 2 has no issues.
     
  6. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    328
    I made it to be like that.
    There is no more Unity start dialog.
    I can make it fullscreen but why is windowed demo problem ?
    I guess I'll make resolutions/options dialog myself in one of the next updates.
    Thank you
     
  7. NightcoreLV

    NightcoreLV

    Joined:
    Feb 26, 2014
    Posts:
    34
  8. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    328

    Hi,
    Path is calculated in NPCScript._calculate_path(...) - there current movement is calculated.
    It sets movement direction currently by getting navmesh path.
    You can change contents of function however you want.
    Just assign movement direction differently.
     
    Last edited: Jul 20, 2020
    Fibonaccov likes this.
  9. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    413
    Why doesnt the spine up vector work? To look at the spine, the up should be -X, open up the equipment window, use the up vector and sure enough -X looks good. Go in playmode, and that offset is what world vector not local? If i look in 1 specific drection it works, but as i turn it goes stupid....
     
  10. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    328
    Hello,
    Try this:
    - open PlayerControl.cs script, at the top you'll see macro //#define LOOK_AT_METHOD_2 which is commented.
    - uncomment it and see does it work now.
    There are 2 ways to calculate aiming, so choose which one is suiting you better.
     
    Last edited: Aug 15, 2020
  11. PesadeloDoEspantalho

    PesadeloDoEspantalho

    Joined:
    May 26, 2017
    Posts:
    45
    Hi, the Multiplayer is an authoritative client-server (or client-host) architecture??
    There are a vehicle system and all feature look like "Gray Cat Character Controller"?
     
  12. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    328
    Its Photon Pun2. Its not authoritative.
    There are mutiple products on Photon plus Photon Server and you can choose which one suits you most.
    Examples are made, like its stated, in Pun2.
    There are no vehicles in CF ( for now ). Only in GrayCat.
    GrayCat and CF share some of the features and some similar features may be differently implemented.
     
  13. PesadeloDoEspantalho

    PesadeloDoEspantalho

    Joined:
    May 26, 2017
    Posts:
    45
    Thanks for reply.
     
  14. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    Hi there - Ive had a couple issues with the most recent version of the combat framework and Unity 2019.4
    Player Models that are auto rigged perform differently than the player provided OEM Player_CF_ThirdPerson prefab

    Notably these menu generated players with a new humanoid model wont go through the reload sequence with a ranged weapon that is created according to your videos. and the OEM Player_CF_ThirdPerson prefab does in fact perform reload when a weapon is out of ammo.

    ALSO these weapons created from the Item creation menu have some issues with them as well for instance the Trigger object and pickup sound and model reference can't be set in the edit window. Melee damage melee range and other fields also dont allow an edit. - but strangly the second half of this edit window does allow changes. Aim Transform Ranged Damage ect all accept edits. And finally I cant get a reload item to replenish the charges via pickup of a combat framework player rigged with the Tools Menu
     
    Last edited: Nov 13, 2020
  15. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    328
    Hi,
    Can you, please, send me email at mariolelascontact@gmail.com.
    Lets go through your points one by one.

    - there is a checkbox in which you choose will the player automatically reload weapon when out of ammo.
    If that checkbox is unchecked - weapon will reload only on reload input.

    - you can modify all created objects in inspector after object ( weapon ) is created

    Thx!
     
  16. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    Sure appreciate the support you are always good that way!
     
    username_unity_of_my likes this.
  17. abcarroll3

    abcarroll3

    Joined:
    Jun 12, 2017
    Posts:
    6
     
  18. abcarroll3

    abcarroll3

    Joined:
    Jun 12, 2017
    Posts:
    6
    I am using the most recent version, downloaded today January 1st 2021.
    Desprite a few compilter errors initially and some scenes not working, I read the docs and was able to get the ranged third person scene working and explore the asset.

    I then followed the instructions and tried to make my own scene but after hours of dabbling i can not get the NPC's to work. I did use the tool menu; baked a navmesh and went step by step. I even experimented with the sequence of steps but the NPC's just stand in one spot and do nothing. They do attack the player in the included demo Ranged scene which I was able to run.
     
  19. abcarroll3

    abcarroll3

    Joined:
    Jun 12, 2017
    Posts:
    6

    Is anyone using both The Combat Framework (CF) and Gray Cat (GC) Assets together?

    I go the basics of CF but when I added GC to the project, I got a massive number of compiler errors and can't build. A lot of duplicate namespaces and such but too many to parse through.

    I would like to use the combined feature set and thought that was possible, but maybe its not yet. I thought I read a post that someone was using both but I'm not sure it that was in the same project.

    If the answer is "no" any timeline on when CF will be updated with the core GC features like cover, vehicle controller and ledges?
     
  20. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    328
    Combat Framework and GrayCat cannot be combined.
    There are some similar features but they may be differently implemented.
    For instance, GrayCat has fixed animation states for all weapons ( locomotion, aim, etc...) while Combat Framework dynamicly switches animations for each weapon.
    You can, of course, extract and implement various features / scripts( like cover or vehicle ) from GC to CF or vice versa - but would require certain amount of work.

    There are ledge climbing in Combat Framework.
     
  21. noahx

    noahx

    Joined:
    Nov 22, 2010
    Posts:
    74
    Hi. What kind of player movement has the "Top Down" controller? Is it Point and Click? Follow cursor? Both?

    Thanks.
     
  22. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    328
    You can choose between point and click and move with input keys.(WSAD for instance)
     
  23. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    From the demo scene GenericTestScene I've changed the teams and set Enemy Teams, but the NPCs won't fight each other o_O
     
  24. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    328
    Hi,
    Did you set disposition to agressive ( If you want them to attack on sight )?

    There are 3 disposition modes: Agressive, Defensive, Passive.
    Agressive: Attacks enemy teams on sight
    Defensive: Do not attack unless attacked
    Passive: Do not attack

    By default, npcs on that scene are set to defensive so they'll not attack eachother on sight.
     
    Last edited: Jul 18, 2021
    MaximilianPs likes this.
  25. JC_LEON

    JC_LEON

    Joined:
    May 20, 2014
    Posts:
    507
    Hi mario I sent you an email btw do you have any plan to add cover system to this great framework.. i'm interested to it but shooter mechanics without covers doesnt looks cool...plus do you have any plan to omprove the shooting ai to use covers .. , flanking and so on ..

    plus doest this asset include the ik weapon preview adjust like the grey cat controller?
     
  26. JC_LEON

    JC_LEON

    Joined:
    May 20, 2014
    Posts:
    507
    someone managed to add and integrate some ai asset from the store... specifically for shhoting .. like enmeyAi, fsm ai , or any other asset?

    the same for cover.. someone managed t oadd cover system from other greycat system?
     
  27. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    328
    Hi, I sent you email!
     
  28. JC_LEON

    JC_LEON

    Joined:
    May 20, 2014
    Posts:
    507
    i see thanks
     
  29. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    tried to run demo scene of latest release in 2021.2.16f1 but character doesn't move -everything else loads and appears to work -- it looks like something simple I'm not doing -- used menu to setup scene and project settings built character.. same
     
  30. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    I got the basic charecter moving by adding a missing input
     
  31. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    I know that feeling, pretty frustrating when you try to do simple things and nothing is working.
    But this asset sill cool, complicate to setup, but rocks ;)
     
  32. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    328
    Hi,
    I haven't released 2021.2 version yet.
    Im working on it, soon ...
     
  33. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    AND THAT'S A GREAT NEWS :-D
     
  34. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    328
    Its out!
     
  35. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    Any news about swimming? :D
    Also would be nice to have some sort of integration with Dialogue System, Emeral AI (3.0) and Love/Hate (for reputation and faction)
    If you're not too much occupied with your "no-name" project :)
     
    Last edited: Apr 20, 2022
  36. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    Sorry to bother, but I need more info on extending NPCBehaviour.
    So I've made a new behavior

    Code (CSharp):
    1. public class NPCPrayBehaviour : NPCBehaviour
    2.     {
    3.         public override void onStart(NPCScript _npc)
    4.         {
    5.             base.onStart(_npc);
    6.         }
    7.         public override void onNonCombat()
    8.         {
    9.             // Default non combat logic - just standing on start position
    10.             // Replace as wished
    11.             base.onNonCombat();
    12.  
    13.             Debug.Log("Entering in Idle");
    14.         }
    then I've made a script to set the new behavior to the NPC
    Code (CSharp):
    1.  
    2.  void Start()
    3.     {
    4.         NPCPrayBehaviour pray = new NPCPrayBehaviour();
    5.         GetComponent<NPCScript>().setNewBehaviour(pray);
    6.     }
    7.  
    ... but the onNonCombat logic never run.... o_O
     
  37. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    328

    Hi, it depends where did you put 'setNewBehaviour' call.
    To make things easier, npcs in project have option to choose one of default behaviours: Guard, Patrol ( there are also mech ).
    NPCScript in initialization set new behaviour based on that choice.
    So, if you put 'setNewBehaviour' before that, your behaviour will be overriden.

    You can remove/delete all default behaviours ( in NPCScript.initialize ),
    or you can call 'setNewBehaviour' after that ( also in NPCScript.initialize )

    Here are the lines which set behaviour based on given choices in inpector:
    ( NPCScript.initialize() )

    NPCBehaviour b;
    switch (basicNpcBehaviour)
    {
    case BasicNpcBehaviours.Guard:
    b = new NPCGuardBehaviour();
    break;
    case BasicNpcBehaviours.Patrol:
    b = new NPCPatrolBehaviour();
    break;
    case BasicNpcBehaviours.Mech:
    b = new NPCMechBehaviour();
    break;
    default:
    b = new NPCGuardBehaviour();
    break;
    }
    m_DefaultBehaviour = b;
    setNewBehaviour(b);


    Like I said, you can remove this and feed behaviors as you wish.
     
    MaximilianPs likes this.
  38. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    ¯\_(ツ)_/¯

    I can't really move this damned NPC, I just placed some code on NPCPray (which inherit from NPCScript)
    whit that code in update


    Code (CSharp):
    1.  public override void lateUpdateNpc()
    2.         {
    3.             base.lateUpdateNpc();
    4.             timer += Time.deltaTime;
    5.  
    6.             if(timer > roamingTimer)
    7.             {
    8.                 Vector3 newDestination = RandomNavMeshSpot(transform.position, roamingRange, -1);
    9.                 Debug.Log("Moving to:" + newDestination);
    10.                 setMovePoint(newDestination);
    11.                 timer = 0;
    12.             }
    13.         }
    The debug confirm the new destination every 10 seconds, but nothing change.
    Another idea that I've got is to assign a waypoint and then to move the waypoint-gameObject at runtime, but looks weird solution to me. o_O

    In the documentation looks easy, but when you start digging it's easy to get lost.
    What I'm trying to achieve here is pretty simple, 'cause the pray have to roaming around, and if anyone get closer he have just to run away faster as he can.

    But later my NPC have to move around, doing jobs, eating and sleeping, but if I'm not able to move the NPC on a specific spot at runtime than I'm stuck. :oops:
     
    Last edited: Apr 23, 2022
  39. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    328
    Hi!
    I would suggest using behaviours for these kind of things.
    Also 'setMovePoint()' doesnt do what you think - it is used by player to move companion to specific spot.
    If you looked inside you'd see that it return you out of it if current behaviour is not follower - so it does nothing for you.

    You can just take a look at patrol behaviour and how it is implemented.

    Here, I made quick behaviour in which npc goes from one position to the other randomly:

    Code (CSharp):
    1. public float roamingRange = 6.0f;
    2.         Vector3? currentDest = null;
    3.         private Vector3 getRandSpot(Vector3 origin, float range)
    4.         {
    5.  
    6.             Vector3 randomDirection = Random.insideUnitSphere * range;
    7.             randomDirection += origin; //
    8.             NavMeshHit hit;
    9.             NavMesh.SamplePosition(randomDirection, out hit, range, -1);
    10.             Vector3 finalPosition = hit.position;
    11.             return finalPosition;
    12.         }
    13.         public override void onNonCombat()
    14.         {
    15.             if (!currentDest.HasValue)
    16.             {
    17.                 Vector3 newDestination = getRandSpot(m_Npc.transform.position, roamingRange);
    18.                 currentDest = newDestination;
    19.             }
    20.             m_CurrentDest = currentDest.Value;
    21.             Vector3 bodyDirection = Vector3.zero;
    22.             Vector3 move = Vector3.zero;
    23.             float distanceFromTarget = Vector3.Distance(m_Npc.transform.position, m_CurrentDest);
    24.             if (distanceFromTarget < m_Npc.waypointReachDistance)
    25.             {
    26.                 m_Npc.character.fullStop();
    27.                 currentDest = null;
    28.                 return;
    29.             }
    30.             m_Npc.calculatePath(ref move, m_CurrentDest, m_Npc.waypointReachDistance);
    31.             float curSpeed = m_Npc.stats.moveSpeed;
    32.             if (m_Npc.enableLocalAvoidance && m_Npc.isVisible)
    33.             {
    34.                 /*float speedMod = */
    35.                 m_Npc.addLocalAvoidance(ref move, m_Npc.avoidanceDistance, /*true,*/ m_Npc.includeNavMesh);
    36.                 //curSpeed *= Mathf.Clamp01(speedMod);
    37.             }
    38.             bodyDirection = move;
    39.             if (m_Npc.isTakingHit)
    40.             {
    41.                 move = Vector3.zero;
    42.                 bodyDirection = Vector3.zero;
    43.             }
    44.             m_Npc.character.move(move, curSpeed, false, false, false, bodyDirection, Vector3.zero, null, null);
    45.         }
     
    MaximilianPs likes this.
  40. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    Now it's clear, thank you so much :)
     
  41. Ritalia

    Ritalia

    Joined:
    Jul 2, 2020
    Posts:
    1
    my name is Taika hello

    HELP -.-

    my char and npc fly , ( i start scene ,game ) and fly my char i have 2022.1.0b16.30 9DX11

    ___________________Screenshot_______________________________


    https://www.directupload.net/file/d/6563/gf59xnwn_jpg.htm

    [/URL][/IMG]
    _________________________________________________
    i Have 13 error in red -

    ArgumentException: Input Button Use is not setup.
    To change the input settings use: Edit -> Settings -> Input
    MLSpace.StandaloneInputs.Update () (at Assets/_CombatFramework/_System/scripts/Input/StandaloneInputs.cs:52)

    ArgumentException: Input Button Pause is not setup.
    To change the input settings use: Edit -> Settings -> Input
    MLSpace.MenuHandler.Update () (at Assets/_CombatFramework/_System/scripts/GUI/MenuHandler.cs:110)

    ------------------

    A game object can only be in one layer. The layer needs to be in the range [0...31]
    UnityEngine.StackTraceUtility:ExtractStackTrace ()
    MLSpace.RagdollManager:disableRagdoll (bool) (at Assets/_CombatFramework/_System/scripts/Character/RagdollSystem/RagdollManager.cs:794)
    MLSpace.RagdollManager:initialize () (at Assets/_CombatFramework/_System/scripts/Character/RagdollSystem/RagdollManager.cs:496)
    MLSpace.RagdollManagerHum:initialize () (at Assets/_CombatFramework/_System/scripts/Character/RagdollSystem/RagdollManagerHum.cs:191)
    MLSpace.Player:initialize () (at Assets/_CombatFramework/_System/scripts/Character/Player.cs:178)
    MLSpace.PlayerThirdPerson:initialize () (at Assets/_CombatFramework/_System/scripts/Character/PlayerThirdPerson.cs:29)
    MLSpace.PlayerControlBase:initialize () (at Assets/_CombatFramework/_System/scripts/Character/PlayerControlBase.cs:1123)
    MLSpace.PlayerControl:initialize () (at Assets/_CombatFramework/_System/scripts/Character/PlayerControl.cs:150)
    MLSpace.PlayerControlBase:OnEnable () (at Assets/_CombatFramework/_System/scripts/Character/PlayerControlBase.cs:902)


    Cannot find ColliderInactiveLayer layer. Does it exist.
    UnityEngine.Debug:LogError (object)
    MLSpace.RagdollManager:initialize () (at Assets/_CombatFramework/_System/scripts/Character/RagdollSystem/RagdollManager.cs:414)
    MLSpace.RagdollManagerHum:initialize () (at Assets/_CombatFramework/_System/scripts/Character/RagdollSystem/RagdollManagerHum.cs:191)
    MLSpace.Player:initialize () (at Assets/_CombatFramework/_System/scripts/Character/Player.cs:178)
    MLSpace.PlayerThirdPerson:initialize () (at Assets/_CombatFramework/_System/scripts/Character/PlayerThirdPerson.cs:29)
    MLSpace.PlayerControlBase:initialize () (at Assets/_CombatFramework/_System/scripts/Character/PlayerControlBase.cs:1123)
    MLSpace.PlayerControl:initialize () (at Assets/_CombatFramework/_System/scripts/Character/PlayerControl.cs:150)
    MLSpace.PlayerControlBase:OnEnable () (at Assets/_CombatFramework/_System/scripts/Character/PlayerControlBase.cs:902)


    Cannot find ColliderLayer layer. Does it exist.
    UnityEngine.Debug:LogError (object)
    MLSpace.RagdollManager:initialize () (at Assets/_CombatFramework/_System/scripts/Character/RagdollSystem/RagdollManager.cs:413)
    MLSpace.RagdollManagerHum:initialize () (at Assets/_CombatFramework/_System/scripts/Character/RagdollSystem/RagdollManagerHum.cs:191)
    MLSpace.Player:initialize () (at Assets/_CombatFramework/_System/scripts/Character/Player.cs:178)
    MLSpace.PlayerThirdPerson:initialize () (at Assets/_CombatFramework/_System/scripts/Character/PlayerThirdPerson.cs:29)
    MLSpace.PlayerControlBase:initialize () (at Assets/_CombatFramework/_System/scripts/Character/PlayerControlBase.cs:1123)
    MLSpace.PlayerControl:initialize () (at Assets/_CombatFramework/_System/scripts/Character/PlayerControl.cs:150)
    MLSpace.PlayerControlBase:OnEnable () (at Assets/_CombatFramework/_System/scripts/Character/PlayerControlBase.cs:902)


    Some features of Combat Framework not supporting current unity version ( 2022.1.0b16 ) . Please wait for next update.
    UnityEngine.Debug:LogError (object)
    MLUtils.InventoryItem:initialize ()
    MLSpace.PhysicsInventoryItem:initialize () (at Assets/_CombatFramework/_System/scripts/Items/Abstract/PhysicsInventoryItem.cs:156)
    MLSpace.WeaponItem:initialize () (at Assets/_CombatFramework/_System/scripts/Items/Abstract/WeaponItem.cs:312)
    MLSpace.RangedWeaponItem:initialize () (at Assets/_CombatFramework/_System/scripts/Items/RangedWeaponItem.cs:483)
    MLSpace.WeaponItem:OnEnable () (at Assets/_CombatFramework/_System/scripts/Items/Abstract/WeaponItem.cs:295)


    and more - 13...











     
  42. username_unity_of_my

    username_unity_of_my

    Joined:
    Feb 24, 2015
    Posts:
    328
    Hi,

    Firstly: I have not yet released Unity2022 version of package - It's not official release, it's pre-release. ( So says my UnityHub ).
    You can use Unity2021 version which is official release( also according to UnityHub ).
    Also keep in mind that I prefer to keep in line with LTS versions which current is 2021.3 according to the this page: https://forum.unity.com/

    Second: First thing you do after import - click on 'Tools/Combat Framework/Setup Project Requirements'. That will create all layers, input and other.
    All these errors are products of missing layers and inputs ( plus not supported version )
     
    Last edited: May 30, 2022
  43. asenetpro

    asenetpro

    Joined:
    Sep 12, 2013
    Posts:
    17
    How Can you enable jump on top down camera setup
     
unityunity