Search Unity

Third person cover controller

Discussion in 'Assets and Asset Store' started by EduardasFunka, May 23, 2017.

  1. GWStudio

    GWStudio

    Joined:
    Sep 27, 2016
    Posts:
    109
    Not working .. the AI Agents will not attack until add ''CharacterMotor'' script
    i get these errors in console if the ''CharacterMotor'' script not attached to the object :
    NullReferenceException: Object reference not set to an instance of an object
    CoverShooter.Actor.GetViewDistance (Single viewDistance, Boolean isAlerted) (at Assets/ThirdPersonCoverShooter/Scripts/AI/Actor.cs:386)
    CoverShooter.AISight.CheckVisibility (CoverShooter.Actor actor) (at Assets/ThirdPersonCoverShooter/Scripts/AI/Controllers/AISight.cs:111)
    CoverShooter.AISight.Update () (at Assets/ThirdPersonCoverShooter/Scripts/AI/Controllers/AISight.cs:194)
     
  2. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    then you will have to add it to registered enemies , you can find this in the CharacterMotor ondeath unregister and in awake register . that should do it , other scripts will be needed like actor i think
     
    GWStudio likes this.
  3. GWStudio

    GWStudio

    Joined:
    Sep 27, 2016
    Posts:
    109
    Sorry But i didn't Understand you .. how to Make the enemy registered !!
     
  4. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    just look up the awake function in CharacterMotor you will find the register function there
     
    GWStudio likes this.
  5. GWStudio

    GWStudio

    Joined:
    Sep 27, 2016
    Posts:
    109
    I found it but after awake function :
    private void LateUpdate()
    {
    if (IsAlive && !_hasRegistered)
    {
    _hasRegistered = true;
    Characters.Register(this);
    }
    else if (!IsAlive && _hasRegistered)
    {
    _hasRegistered = false;
    Characters.Unregister(this);
    }
    }
    This is the part of script concern with registering function i tried to add in a new script I name it Target :
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    namespace CoverShooter
    {
    public class Target : MonoBehaviour
    {
    private bool _hasRegistered;
    public bool IsAlive = true;
    private void LateUpdate()
    {
    if (IsAlive && !_hasRegistered)
    {
    _hasRegistered = true;
    Characters.Register(this);
    }
    else if (!IsAlive && _hasRegistered)
    {
    _hasRegistered = false;
    Characters.Unregister(this);
    }
    }
    }
    }
    But still not working can U Make script to make AI agent to attack without CharacterMotor Script:rolleyes:
     
    Last edited: Jul 23, 2019
  6. appfuncenter

    appfuncenter

    Joined:
    Jul 18, 2016
    Posts:
    4
    hi Eduardas Funka, any news about the update release date? i am about to start a new project and i want to start with the new system.
     
    redoxoder likes this.
  7. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    that's the one i did copy the awake and put the LateUpdate() if (!IsAlive && _hasRegistered) in the ondeath event on the emerald ai script then , did define the emerald ai script in the Characters script since it work with motors only , really sorry i did not touch the code for cover for 3 months , and don't have my edits on me now . will make sure to test this out when i get the chance . good luck will still try to help you on the forum. cheers
     
    GWStudio likes this.
  8. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    Is there not a tutorial on setting up topdown?
     
  9. Lay84

    Lay84

    Joined:
    Mar 8, 2014
    Posts:
    34
    There is one a few pages back from @satchell , major props to him for this as it help me out in the beginning.
     
    satchell likes this.
  10. qaswarzeeshan

    qaswarzeeshan

    Joined:
    Jul 18, 2019
    Posts:
    2
    Hi, I am trying to implement your Kit in a game and while setting up the Controller I came across this error " NotKeyFoundException ".
     

    Attached Files:

  11. SinaFa1987

    SinaFa1987

    Joined:
    Jul 31, 2019
    Posts:
    5
    Inventory System - Video 1/5
     
    Rahd, bwv1056, Toby31 and 1 other person like this.
  12. Toby31

    Toby31

    Joined:
    Jul 7, 2014
    Posts:
    70
    Hi Sina, Your inventory system looks cool. Did you program this yourself or use a plugin like inventory pro?
    I've tried inventory pro to no avail :( I'm currently looking into trying to integrate another template with TPCST but there are no clear instructions with the other template.
     
  13. SinaFa1987

    SinaFa1987

    Joined:
    Jul 31, 2019
    Posts:
    5
  14. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    did anybody found a save system solution yet??
     
  15. hongwaixuexi

    hongwaixuexi

    Joined:
    Dec 11, 2017
    Posts:
    857
    Could you break down CharacterMoter.cs into several modular files? This file is too big and has everything in it. I have to study the whole file just because I want to change some inventory functions.
     
    JBR-games likes this.
  16. Toby31

    Toby31

    Joined:
    Jul 7, 2014
    Posts:
    70
  17. Toby31

    Toby31

    Joined:
    Jul 7, 2014
    Posts:
    70
    Hi I have purchased Easy save to integrate into project but haven't got around to looking at it properly yet. I'm hoping it will be Easy as I have no experience of installing a save system as I'm an artist by trade. ;)
     
    pushingpandas likes this.
  18. SinaFa1987

    SinaFa1987

    Joined:
    Jul 31, 2019
    Posts:
    5
    no . not tutorial. other weapons:
     
  19. SarhanSoft

    SarhanSoft

    Joined:
    Apr 15, 2015
    Posts:
    65
    Hi guys, can help me in this issue:
    1- I want to set player use first gun in inventory with start the game.
    2- I want to stop recoil and shake for the camera, but keep it on the gun Aim itself, how i do that?
     
  20. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    sad. This asset has so much potential but its development is frozen somehow...
     
  21. appfuncenter

    appfuncenter

    Joined:
    Jul 18, 2016
    Posts:
    4
    yes, no response or interaction from the developer ( forum + email )
     
    Lay84 and pushingpandas like this.
  22. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    335
    He said development is done but working on documentation. It will be the best doc ever...
     
    Last edited: Aug 5, 2019
    Lay84, satchell and pushingpandas like this.
  23. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    319
    Like we've said repeatedly, he is working on documentation. Writing a document for a Node based editor is both complicated and time consuming. He also added a bunch of stuff to the asset, its not frozen, its not dead. Keep your pants on.
    Do you know how long it took the UFPS 1.0 dev to release an update?
    Like 6 months, and that asset is crap and was still riddled with bugs after the fact.

    Give Redbee a few more weeks. They are doing the best they can.
    I personally say take your time, get it right. Then we wont have to wait for Bug Fixes.
     
    Hamesh81 and satchell like this.
  24. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    I saw beta version. It did not really impressed me to be honest. I did not saw a lot of changes. Enemy AI was acting like before. Maybe I opened the wrong scences, but from what I saw - well...
     
  25. gsmax

    gsmax

    Joined:
    Jun 12, 2018
    Posts:
    15
    Please has anyone used the wave counter script. Am trying to set it up to spawn new Zombies when the first wave dies out. @EduardasFunka ?
     
  26. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    afik it never worked
     
  27. gsmax

    gsmax

    Joined:
    Jun 12, 2018
    Posts:
    15
    That's unfortunate
     
  28. Unplug

    Unplug

    Joined:
    Aug 23, 2014
    Posts:
    256
    having only a few unit in my scene, AISearch.Update() take a whooping 11.6 ms of CPU time... any suggestion ?
     
  29. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    No, thats the poorly designed AI. I hope with new version its better
     
  30. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Thanks for your review. Could you be more specific what design error you found?
     
  31. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    send me an email will look it to it.
     
  32. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    I believe we never created waves you need to activate yourself when to spawn next wave.
     
  33. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Update:
    Good news I have a new child 6 days old boy :)
    Bad news had to stop working on tutorials and will work less for a couple of weeks.
    if you need beta please send me an email with an invoice number. I can also now send beta for 2017.4.2 and up.
     
    Rahd, combatsheep, gsmax and 9 others like this.
  34. Alexey1B

    Alexey1B

    Joined:
    May 15, 2017
    Posts:
    26
    Congratulations!
    I played with beta and like it, main profit there it is possibility to build any behaviour what you want, and it is main goal of any AI assets
     
  35. Lay84

    Lay84

    Joined:
    Mar 8, 2014
    Posts:
    34
    Congratulations! if this is your first one be prepared for a lot of changes and NO SLEEP. time will also fly by after they start walking, next thing you know he is 8 years old and half way out the house :) (i speak from experience)
     
    EduardasFunka likes this.
  36. Unplug

    Unplug

    Joined:
    Aug 23, 2014
    Posts:
    256
    Deep profile says the main problem is in AISEARCH.glimpse(), the searchbloc and canbeinvestigated function search a lot of time.

    The other problem is with the "debug" if you leave them on, then it also take a lot of CPU power. so basically you cant debug.

    wouldn't be a more optimized solution to have a script that define what a block is so we can give destination point to AI without creating too much. The search zone for instance create a lot of bloc and maybe there is no point to create block for every single cover. Doing this manually can take some time, but if it give me FPS ill do it.

    i'm on version 1.5 for aisearch (15 units turns into 11ms)
    can't find in back from my mailbox, pm me the correct email please.

    i will also be interested in the beta for 2017 on update function

    congratulation on the child !
     
    Last edited: Aug 13, 2019
    EduardasFunka likes this.
  37. Toby31

    Toby31

    Joined:
    Jul 7, 2014
    Posts:
    70
    congratulations :) many sleepless nights ahead. I have a two year old and another due in January. exciting times ;)
     
  38. Toby31

    Toby31

    Joined:
    Jul 7, 2014
    Posts:
    70
    Hey

    - has anybody had any issues with A.I running into walls?

    - Falling or jumping from the 1st floor to 2nd, or vice versa?

    - A.I listener not working, can set gun alert fire to 60 and stand next to A.I and shoot and it does nothing?

    I'm on update 1.6.2 of TPCST, using Unity 2019.1.2f1
    I have a modular environment with each modular piece having a box collider.
    Upon play the A.I when spawned try's to find me and ends up getting stuck.
    As you can see in the image, walls are set to nav mesh static and I have 3 floors.
    I have read through the forum and did see Mastermind Interactive having issues with the A.I sight script back in March 2018 not being able to see the player and it having to calculate lots of colliders, could this be causing the A.I to run into walls????

    any advice would be greatly appreciated
     

    Attached Files:

  39. Toby31

    Toby31

    Joined:
    Jul 7, 2014
    Posts:
    70
  40. Lay84

    Lay84

    Joined:
    Mar 8, 2014
    Posts:
    34
    Not sure about the Nav stuff or running into the walls but for the AI not being alerted, is that the only AI that doesnt respond or is it all? Might sound simple but maybe you have that AI on the same side as the player.
     
  41. SarhanSoft

    SarhanSoft

    Joined:
    Apr 15, 2015
    Posts:
    65
    for first video, check your navmesh.
    for seond one, check enemye listen script (should be not 0) and check your weapon alert for the shoutgun (should be not 0), if that okey so the problem from enemy react with fire audio! i forget from which script (maybe fight brain) anyway, copy everything from AI enemy setup that already in the third person cover scene.
     
  42. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
    Does anyone have solution for this? It happens when I start/play the scene (demo scene).
     
  43. Toby31

    Toby31

    Joined:
    Jul 7, 2014
    Posts:
    70
    Hi Sarhanbh
    Thanks for the response, the AI listener is set to 1, the shotgun alerts fire set to 60. I have copied everything from enemy A.I in demo scene.
    Not quite sure what you mean "enemy react with fire audio" could you be more specific please as can't see this in fighter brain? :)

    Thanks for your time
     
  44. Toby31

    Toby31

    Joined:
    Jul 7, 2014
    Posts:
    70
    Hi Lay 84, Yes its all of them I can shoot right next to all A.I heads and nothing happens. unfortunately don't think its the actor script, my character is set to 1 and A.I set to 0 and is ticked as aggressive
     
  45. SarhanSoft

    SarhanSoft

    Joined:
    Apr 15, 2015
    Posts:
    65
    until developer answer you, just try any solution you can do it.

    I mean there are scripts (that I forget the name and now i cant open the project to check that) to determine distance to AI enemy do something when listen fire. I will check that later and write to u

    anyway check these steps to specify from where your problem:
    First:
    - use your character in the example scene of the system, check if yellow enemies listen your fire or not? if not the problem will be from your character in some where.

    Second
    - if first okay, use the example player character in your scene, and check if your AI enemy listen your fire or not? if not the problem will be from your AI, if yes the problem will be from your character or your weapon.
     
  46. SarhanSoft

    SarhanSoft

    Joined:
    Apr 15, 2015
    Posts:
    65
    Hi guys i need some help to improve my gameplay.
    in my game there are (cars and truks) these vechils have a cover in 4 sides, but it very big game object not like (prototype cover in prototype scene) so, the problem is the enemy try to take nearest cover that already face to player. so the player can shoot the enemy because it not in behind.

    is there any way to tell the enemy, this cover face to player so don't get it?

    enemy try to take cover number 1 (look the image)
    upload_2019-8-21_21-51-46.png
     
  47. satchell

    satchell

    Joined:
    Jul 2, 2014
    Posts:
    107
    Maybe add a sphere/box collider positioned to the open side that will look for a trigger or layer(s) and disable the cover when the trigger is present. You'll have to consider a position of the collider away from the object of cover so not to disable it when you need it of course.
     
  48. Alexey1B

    Alexey1B

    Joined:
    May 15, 2017
    Posts:
    26
    Hi, about alerts - is ai actor has AiAlerts and player weapon GunAlerts attached? This should be enough for react on fire at distance defined in those scripts. If need react on bullet hit near actor, you have to Alerts.Broadcast at hit point.
    About cover side - did you play with AiCover settings like MinDefenselessDistance , MaxDefenseAngle , MaxTallCoverThreatAngle, MaxLowCoverThreatAngle ?
     
    f1chris likes this.
  49. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
    Huge performance problem - Android

    I have just noticed that Third Person Camera script attached to Camera doubles my stats. Why is this happening? That makes this asset unusable for me.

    Is there a way to solve this problem?
     

    Attached Files:

    Last edited: Aug 24, 2019
  50. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    1-you have scope camera active
    2- you have a second camera some where ..

    Third Person Camera script just controls the movements ... not sure why you have this