Search Unity

Controller Third Person Templates by Invector

Discussion in 'Tools In Progress' started by Invector, Aug 20, 2015.

  1. jgiroux

    jgiroux

    Joined:
    Jul 21, 2015
    Posts:
    22
    A simple request @ Invector team.

    I see a lot of comments and requests for added functionality and while I do not wish to condemn any of these wonderful suggestions I truly and heartfelt urge your team to stick with how you have been handling your controller.

    don't add more AI features (as it is, its robust enough to work with and has some really nice code to edit yourself to add functionality), don't add skills and attributes or XP or inventory etc...things of that nature, the reason I love this controller over all the others is its simplicity, it does what it says and I can easily add the functionaility I need as I need it.

    with some of these more feature rich controllers out there, the user ends up getting stuck with tons of code they may not need or want/ have to wade through all that code to remove parts they don't need or that conflict with their own system, the potential to break any forthcoming updates by messing with the core code too much, the list goes on, for instance before your controller I was using another popular one, but even though it was *easy* to set up my own character model in ten minutes, I spent the next 3 months constantly re-writing code to remove 90% of the components I didn't need..which broke things, which meant I spent more time trying to fix something rather than making my game.
    with your awesome controller I was up and ready in like half hour, and was designing my areas, playtesting with friends and scripting an actual story...
    this made a HUGE difference, and I haven't looked at another controller since.

    basically what someone said earlier...
    there are few controllers that are robust but with locked into options and the like, and even fewer melee controllers.

    so just wanted to say I think you are doing an awesome job, and I look forward to your shooter template (but only when *you* are ready to show it off)

    if anything were to be added to your controller that has already been asked for, I would say native multiplayer support. but again, that's something someone with knowledge about networking should be able to setup themselves.

    Thanks for listening!
     
    resequenced and Invector like this.
  2. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Just drag and drop an weapon prefab into the corresponding layer and hit play :)

    Basically you just need faster animations ;)

    Thanks for this awesome text @jgiroux, we also think this way... I don't want to fill the templates with 300 features that 'kind' of work, we prefer to take our time and develop quality stuff for you guys to use as a base, and work on your own unique features because if we just delivery everything ready to go (inventory, save/load, xp, etc), it will result on a Game Template instead of an Character Controller and you guys will basically make the same game with different skins.

    I did answer two recent requests that were not on our roadmap, magic weapon & draggable box and despite you guys liked, honestly I'm still not happy with the results (scripts & gameplay) and I almost remove the dragbox before upload v1.3e yesterday... But we will improve these features later, because right now the Shooter is a priority and we're working very hard to delivery the best system possible :)

    Many of you don't know, but we start Invector making a shooter prototype, about 1 year ago and to be honestly in-game was really awesome, but as a tool for other people to change the character, weapons and set up stuffs was terrible. So we decide to take our time and develop not only a solid character controller but a solid tool that everyone can use and have fun :D

    Again, thanks for your post :p
     
    resequenced and jgiroux like this.
  3. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    Thanks for this! I've just started integrating this controller with ORK Framework, so that was quite helpful.

    You can streamline this a bit by registering a handler for the Combatant.Equipment.Changed event. The event doesn't inform you which Equipment Part was changed, but it frees you up from having the check to see if the current weapon has been changed in your Update() function.

    I use my own CombatantInterface component to encapsulate all access to ORK's Combatant component on the character. This component registers event handlers on ORK classes and then I use ootii's Message Dispatcher to send messages that the rest of my ORK-Invector integration components can listen for.

    So my version of your MeleeWeaponController currently looks like this:

    Code (CSharp):
    1. public class MeleeWeaponController : MonoBehaviour
    2.     {    
    3.         void Awake()
    4.         {
    5.             MessageDispatcher.AddListener(transform.root.gameObject, "EQUIPMENT_CHANGED", OnEquipmentChanged, false);
    6.             _meleeManager = GetComponentInParent<vMeleeManager>();        
    7.         }
    8.  
    9.         void Start()
    10.         {
    11.             StartCoroutine(GetCurrentMeleeWeapon(0.5f));
    12.         }        
    13.    
    14.         void OnEquipmentChanged(IMessage rMessage)
    15.         {
    16.             StartCoroutine(GetCurrentMeleeWeapon(0.1f));
    17.         }
    18.  
    19.         private IEnumerator GetCurrentMeleeWeapon(float timeToSearch)
    20.         {
    21.             _timeStarted = Time.time;
    22.             do
    23.             {
    24.                 if (Time.time - _timeStarted > 0.5f)
    25.                 {
    26.                     Debug.Log("Could not find MeleeWeapon on Combatant");
    27.                     break;
    28.                 }
    29.  
    30.                 _currentMeleeWeapon = GetComponentInChildren<vMeleeWeapon>();
    31.                 yield return null;
    32.             } while (_currentMeleeWeapon == null);
    33.  
    34.             if (_meleeManager == null || _currentMeleeWeapon == null) yield break;
    35.  
    36.             if (_meleeManager.currentMeleeWeaponRA != _currentMeleeWeapon)
    37.             {
    38.                 _meleeManager.InitCustomMeleeWeapon();
    39.             }
    40.         }
    41.  
    42.         private vMeleeManager _meleeManager;
    43.         private vMeleeWeapon _currentMeleeWeapon;
    44.  
    45.         private float _timeStarted;    
    46.     }
    EDIT: I use a coroutine to get the current melee weapon because it won't have been attached to the player when the Awake() and Start() methods are called. I use the same pattern in my CombatantInterface component, as ORK won't have attached the Combatant component to the character in time for any of the other components on the character to find it in Awake() or Start().

    And for (sort of) completeness, the relevant lines from CombatantInterface are:

    Code (CSharp):
    1. private void SetupCombatant()
    2.         {        
    3.             if (this.showDebugOutput)
    4.             {
    5.                 Log.ConsoleWrite(string.Format("{0}: Found Combatant [{1}]",
    6.                     this.GetType().Name, this.Combatant.GetName()));
    7.             }
    8.  
    9.          
    10.             this.Combatant.Equipment.Changed += Equipment_Changed;
    11.  
    12.         }
    13.  
    14.         private void Equipment_Changed(Combatant combatant)
    15.         {
    16.             MessageDispatcher.SendMessage(this, gameObject, "EQUIPMENT_CHANGED", "", 0);
    17.         }
     
    Last edited: Jun 28, 2016
  4. tubbz0r

    tubbz0r

    Joined:
    May 24, 2014
    Posts:
    72
    Thanks for the replies!

    1. I'm a complete animation noob, when you refer to the animation states in mecanim are you refering to CombatController? I've looked everywhere for Allow Movement At and can't locate it :S

    2. With the approach looking bad, would it be down to just replacing the animations to make it look better? For example I can see the first weapon swing looking bad but replacing it with a different one could improve it? Or is it always going to look bad?
     
    Last edited: Jun 30, 2016
  5. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    That's why I ended up with a redundant check in the Update. I'll add a line to disable the script when everything is set. No need to keep it running once it's all set. Messengers... confuse me. My code-fu is weak and I mostly flail about until I manage to come up with something that sort of works and am happy to have accomplished that much!
     
  6. carlosrovira

    carlosrovira

    Joined:
    Dec 23, 2014
    Posts:
    58
    Hi!,

    I'm using a lot Rewired, and want to know if this template is prepared to integrate with Rewired, or If it's planned, or If is something I must do on my own. If is something left to the developer, where I should start.

    Thanks in advance!
     
  7. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Small update but great improvements on the this one guys, and you know the drill: always backup your project!

    Changelog v1.3e

     
    Last edited: Jun 29, 2016
    Kenaz and drewradley like this.
  8. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Yo Carlos, we will take a look at some of the most requested assets for integration after we release a stable version of the Shooter Template which is the priority right now. I pretty sure that some users already are using Rewired with the MeleeCombat, so probably it's not that hard to integrate.
     
  9. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    For some strange reason after updating my spawned player kept flying away! Spawning the character you provided doesn't and it doesn't happen on mine if I don't spawn it. I'm rebuilding it from scratch and adding everything back in to see if I can't figure out why. So far, it hasn't happened. Which means it's probably a problem with my Final IK setup!

    Edit: well, completely rebuilt him and it's fine so I still have no idea why the other one would launch himself into space and this one does not. As far as I can tell they are identical.
     
    Last edited: Jun 29, 2016
  10. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    You create a new project or you have deleted the Invector's folder from the project and imported the update?

    I'm guessing the Extra Gravity value is responsible to ship your v-bot like a spaceship lol, before we used 4 and now is -0.35, you can try to Reset the value by left clicking on the component.
     
  11. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    LOL. Yeah that was it!
     
    Invector likes this.
  12. tubbz0r

    tubbz0r

    Joined:
    May 24, 2014
    Posts:
    72
    Any idea how to get it so we can assign a weapon to the player as a new scene is loaded? I'd prefer to not have a prefab since I have multiple weapons for the player to potentially wield. I'm looking at "EquipMeleeWeapon()" in vThirdPersonController, I'd assume I just call meleeManager.SetRightWeaponHandler() where I want to assign the weapon to the player right away? Hoping to check before I do anything :p
     
  13. Prefab

    Prefab

    Joined:
    May 14, 2013
    Posts:
    68
    Hello, is it possible to use the melee template but not use the hit detection features? I would like to use the weapon creation and equipping, but my combat is not going to use hit detection. Can this be turned off?
     
  14. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Instantiate the player prefab with the weapon attached to the corresponding handler is one way to do it, but since you don't want to use the player as prefab... hmm you can instantiate the weapon with the method EquipMeleeWeapon(weaponPrefab, 1); 1 or -1 is right or left hand.

    Hmmm you could remove the hitbox from the weapon I guess, but it was design to work together, so you can run into a few errors
     
  15. Shadex

    Shadex

    Joined:
    Dec 18, 2013
    Posts:
    89
    The animation states are in Mecanim. Go to Windows - > Animator in unity. Then click on Layers then full body. You should see Basic Attacks, Default Attacks, Magic Attacks, etc. These are the weapon move sets (they correspond with ATK ID. So double click on those and you will see the attack combo's (Attack A, Attack B, Attack C). The arrows are the transitions, and the box's called "Attack A" would be an Animation State. So click on the Attack A box and in the inspector it should have motion, speed, transitions, etc. Underneath that is where you can attach scripts to that animation state (basically the animation) where you will find "Melee Attack Behavior". In that script is "Allow Movement At" variable. Hopefully those are good enough directions.

    2. This is where it kind of gets pretty subjective. You can't change the animation itself (IE the way the bones move) but you can altar the timing and when the animation starts and stops. Those arrows you see that connect the animation states, the transitions, thats where you can control when the animation starts and stops. Exit time is when the animation is allowed to be canceled and potentially when to move on to the next animation.

    Imagine your animation is a left to right swing in a 180 horizontal arc where the sword starts point directly to the left of the character and ends pointing to the right of the character. That looks good for a single big swing, but looks pretty bad when you combo it. So if you setup an exit time of 0.75 you will be able to interrupt the animation after 75% of the animation is complete. This means the character would swing the sword in a 135 degree arc then start the next swing in the combo. Now you have a really good looking combo AND it looks good with a single swing AND they it looks like you have 2 animations. Oh and animation speed is found directly on the animation state (the box)

    I would replace the animations if you want something like a overhead swing vs a side swing or something drastically different. In my experience making a combo look good is in the speed and transitions as exit timing, transition duration, offset all allow you to blend the animation, making it smooth.

    If you have other questions feel free to ask, Mecanim is pretty intimidating to you figure it out. It looks like a mess of spider webs until you understand the logic behind it and when you understand how to use it this asset becomes absolutely incredible.
     
    jgiroux and Invector like this.
  16. jgiroux

    jgiroux

    Joined:
    Jul 21, 2015
    Posts:
    22
    @Shadex.

    sincerely ,
    I am touched by all your thorough answers even towards obvious new beginners, TBH when I read many of these questions I think, man they really shouldn't be at this stage in a personal game development if they are asking questions regarding mechanim animation states and the like, because my first though is...
    id start at the beginning and learn *about* unity before diving into using assets and such.

    however reading your thorough and gentle explanation with no hint of entitlement makes me think, damn I love this community.
    I come mainly from cutthroat gaming/design forums where its almost always cynical, bullying text and worse giving people the wrong info because its *funny*
    but everyone I see here and about is always wonderful to interact with, knowledgeable friendly and above all...have hearts.

    so here is to the Invector Team for their wonderful assets, and the people like Shadex and and so many others behind them offering advice and solutions.
    here here

    sorry shadex for calling you out like that ;)

    @Invector, do you happen to have an alternate forum that has more sub categories like
    general forums
    bug forums
    player contributions/or show off what you have managed to make using this asset.
    etc?

    reason I ask is there is some really good stuff in here (this forum) but its hard to navigate as you have to just go through the whole thread page by page to find that script of snippet you remember reading and now realize you could use it in your own project.
     
    Invector likes this.
  17. Shadex

    Shadex

    Joined:
    Dec 18, 2013
    Posts:
    89
    Hey man i hear ya. I've had my share of those community's (Hello UE3). Honestly i've gotten a lot of help from Invector on some code (I suck at code). So if a 10 minute post saves you a few days of tutorials, then good. We all just want to make a game, so yea, things like the guy giving out the XP system to me is awesome. It saves me weeks of doing it myself.
     
    treshold, Invector and Alverik like this.
  18. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    The way I figure it is that every minute I spend helping someone is a minute @Invector can be working on improvements!
     
    Invector, ScaraBe and jgiroux like this.
  19. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    I couldn't explain better myself :D - Yeah mecanim is kind of hard when you first look at, it took me some MONTHS to understand, but when I get it, it was like:



    One thing that really helps are the [Unity Tutorials], sometimes you need to watch twice and practice at the same time, to fully get it.

    It's really wonderfull to see the community here helping each other, and it's getting bigger every day :D

    We don't have a second forum yet, mostly because it will be kind of hard to administrate email support, this forum, a new forum, and youtube :eek:

    But it could be very nice to have a forum with everything organized with categories and stuff... hmmm.. I will search on that, do you guys have any recommendations?

    And it's working :D we're working so hard on a feature very exciting...... more news soon :rolleyes::rolleyes:
     
  20. nerdares

    nerdares

    Joined:
    Aug 4, 2015
    Posts:
    18
    Ok so I have been running into an issue with the third person controller and the Xbox One controller. Basically, I use rewired input manager for the Xbox One controller because the DPAD is mapped differently than the Xbox 360 controller. I did this so I could have functionality of picking up weapons. The problem is that when I click play and use the controller, I can't go back to the keyboard. Basically what I do is I:
    1) Plug in controller
    2) Press play
    3) Use controller
    4) WHILE GAME IS STILL RUNNING - switch to mouse and keyboard

    I get into an issue where the character flickers, and the UI flickers between "Changed to controller" and "Changed to keyboard".

    Now I thought this had something to do with rewired but just to make sure, i made a completely new project and tried this again. The problem still persists.

    I've asked Invector for this and I believe we are both stuck with this issue so this problem is open to anyone else to figure out, for it may apply to other users using different controllers like Xbox One and PS4

    Edit: Here's something that should help some people out:

    https://ritchielozada.com/2016/01/16/part-11-using-an-xbox-one-controller-with-unity-on-windows-10/

    Again still not sure if this fixes the flickering issue though, but it solves the dpad

    Another Edit: If you alt-tab and go back, this would fix the problem. But again, with the xbox one controller, if you go back to the controller you can't go back to the keyboard and mouse right away

    Edit: Ok so apprently I reimported the XInput folder in the third person controller and I guess that fixed it. Awkward but at least my problem was solved!

    Edit 7/3/16:

    Well looks like im still having the issue. I put in xinput again but the problem still persists. Don't know what's going on

    Final Edit 7/3/16:

    Fixed the issue! Go to vThirdPersonInput and comment out the line where it says Input.GetAxis("Triggers") != 0.0f

    I think what's happening is that once you use the controller, triggers never go back to 0.0 when you put it down. If the value is above or below 0.0, the bool isControllerInput returns true and will never go back to false. This can get hectic but for now, the best fix is just to comment that line out. Its one of the last few lines
     
    Last edited: Jul 4, 2016
  21. Prefab

    Prefab

    Joined:
    May 14, 2013
    Posts:
    68
    The combat in my game will be quite simple and I am concerned about the performance requirements of using hit detection. I am planning to use a simple distance check, which I would think would be better for performance. Also I will be setting the attack distance for each animation manually, and therefore the animation itself would only be a visualization of the attack, and not used to determine if the attack has hit or not. So for example a punch attack would always hit if within 0.5m, where as a sword attack would always hit if within 1m.

    If the hit detection cannot be removed, should I simply set it to work on a layer which it would never hit anyway? Or what would be the best way to keep the hit detection, but not use it and limit its calculations?
     
  22. rbm123

    rbm123

    Joined:
    May 24, 2015
    Posts:
    130
    hi ! not any news for Third person shooter template?

    ***
    is there any package to make mecanim with no coding, with nodes? like RAIN or Game maker which have modes for scripting and AI ?
     
  23. Ghost_Interactive

    Ghost_Interactive

    Joined:
    Jul 8, 2015
    Posts:
    54
    animations is not a problem that one i can make, 1st need to know how to make it shoot able. i am realy bad at scripting.

    or there is a shooting controller coming to to this asset ??
     
  24. xxhaissamxx

    xxhaissamxx

    Joined:
    Jan 12, 2015
    Posts:
    134
    there is shooter asset will release but we don't know when
    if u can't wait than u will find videos in youtube about how to make shoot weapons
     
    Last edited: Jul 2, 2016
  25. schala

    schala

    Joined:
    Jul 24, 2012
    Posts:
    21
    Hi Invector,
    First, I would like to say your asset is one of the best and the best character controller on the asset store! There was a time I was looking for a character controller, but none could fit my needs. Some were too cumbersome and some were just lacking. And let's face it, developing a robust character controller takes a lot of time. Yours is perfect. So I want to thank you for it and for the frequent updates as well. :)

    I just updated to v1.3e, and I've noticed that every once in a while my character keeps repeating the landing animation for a while (sometimes a couple times, but sometimes my character goes crazy and repeat it multiple times). See an example below:



    I've deleted/recreated the character already but it seems to be happening randomly. I can go on for many hours without seen this behavior, then it happens once and it keeps reoccurring for many hours as well. It didn't happen with previous versions (I've been through all versions from 1.2 to 1.3e, and this is the first time I encounter this issue). Any idea?

    Regards,
    Jenn
     
  26. NathanHale1776

    NathanHale1776

    Joined:
    Mar 22, 2014
    Posts:
    46
    Fantastic asset Invector,
    With your upcoming work on shooter template for this, I would like to request bow and arrow shooting and spear melee with option to throw the spear if possible. tyvm - winter
     
    Malbers likes this.
  27. tubbz0r

    tubbz0r

    Joined:
    May 24, 2014
    Posts:
    72
    Any idea where damage is dealt to another player in the scripts? I'm planning on editing the method to the way I want and there seems to be a lot of "TakeDamage" methods in multiple scripts but whenever I debug, none of them get called! (no players recieve damage, even retagging them to Enemy doesn't do anything)
     
  28. Rose-Remnant

    Rose-Remnant

    Joined:
    Nov 14, 2012
    Posts:
    123
    Did you set the proper layers on the terrain?
     
  29. schala

    schala

    Joined:
    Jul 24, 2012
    Posts:
    21
    Hi Draken,

    I have the Default layer for my terrain. I couldn't find in the doc any reference to changing that layer to something else. Also, is it still necessary to update the Ground and Stop Move layer under the ThirdPersonController script as in some previous versions? I tested leaving it as is and also adding the old settings, but that didn't remove the intermittent issue I'm having, yet the doubt still persist if we still have to change those.
     
  30. sebsmax

    sebsmax

    Joined:
    Sep 8, 2015
    Posts:
    118
    Since the last update, I have massive frame rate drop down...Anybody got that too?
     
  31. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    I just take a quick look here, and if you comment the line 272 of the vMeleeManager, he will not activate the hitbox detection, and no errors are given :)

    No news yet, and I mecanim without coding?... hmmm.. I don't think so :confused:

    Yep we're working on the Shooter Template full time, that's why there is not so many new features on the last updates of the Melee Combat, only improvements that we're making on the shooter and we can add on the melee.

    @schala There is 2 things that can be happening, check your Land High Vel value at the Player Inspector, the default value is -12 (v1.3e) you can turn on your Debug Window to check the Vertical Velocity, if is too unstable, there is something wrong with your gravity values or rigidbody. The other thing that can be is the exit time of your animation, check if the bool landHigh is turning false again and exiting the state (which looks like is not)


    Bow is on the list, don't worry ;) - the spear melee... I think it's possible too

    Player: TPMotor > Take Damage()
    AI : AIMotor > Take Damage()
    Other : vCharacterStandAlone > Take Damage()

    Hmmm weird I don't remember change anything on the IK at this last update... will make some tests here
     
  32. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Guys I noticed that Unity 5.3.5f1 is crashing when exiting the demo scene or any scene that contains a EnemyAI Prefab, no idea why this only happen on this version and only with the prefab, if you create another enemy with the exact same components it will work as expected, so if you're having trouble with, just create new enemies.
     
  33. MandatoryDenial

    MandatoryDenial

    Joined:
    Jun 21, 2016
    Posts:
    20
    Hi guys I have a question for you and I am hoping you can suggest a method. So the issue is I want a player to click on a health gaining object. The implementation is set to send a raycast from mouse click and to see if it hits the object. If it does then the player is allowed to regain health. I am taking the code I found in the vhealthItem as a starting point:

    Code (csharp):
    1.  
    2.     void SetCharHealth()
    3.     {
    4.         float value = 50.0f;
    5.         var iChar = gameObject.GetComponent<vCharacter>();
    6.         var targetHealth = iChar.currentHealth + value;
    7.  
    8.         if (iChar.currentHealth < iChar.maxHealth)
    9.         {
    10.             iChar.currentHealth = Mathf.Clamp(targetHealth, 0, iChar.maxHealth);
    11.         }
    12.     }
    13.  
    The code doesn't throw a compiler error but the console does return the following:

    NullReferenceException: Object reference not set to an instance of the object
    ModuleVariables.SetCharHealth() (at Assets/Scripts/ModuleVariables.cs:85)

    This refers to this line of code in the compiler:

    Code (csharp):
    1.  
    2.         var targetHealth = iChar.currentHealth + value;
    3.  
    I think the complaint is that I haven't really connected it to the player issuing the raycast. In the example you run over the object and the player is captured through the collider other. I don't want this type of implementation and it doesn't fit my game. What alternate method could I use to refer to the player and utilize the code given to me by invector?
     
    Last edited: Jul 3, 2016
  34. sebsmax

    sebsmax

    Joined:
    Sep 8, 2015
    Posts:
    118
    By putting "Head weight" in Head Track & IK, I don't have less frame rate issue...
     
    Last edited: Jul 3, 2016
  35. MandatoryDenial

    MandatoryDenial

    Joined:
    Jun 21, 2016
    Posts:
    20
    BTW In case anyone else has this desire to heal your character through clicked on items this code worked. Many thanks to drewradley who posted some of his code that helped answer a lot of my questions on calling libraries. You must also drag and drop the 3rd person player controller in the hierarchy to the game object you attach the script to:


    Make sure you include the line at the top:

    Code (csharp):
    1.  
    2. using Invector.CharacterController;
    3.  
    In your declarations use:

    Code (csharp):
    1.  
    2.     public vThirdPersonController MyC;
    3.  
    Code (csharp):
    1.  
    2.      void SetCharHealth()
    3.     {
    4.         float Value = 50.0f;
    5.         float NewTot;
    6.  
    7. //        MyC = GetComponentInParent <vThirdPersonController> ();
    8.  
    9.         if (MyC != null)
    10.         {
    11.             NewTot = MyC.currentHealth + Value;
    12.             if (NewTot <= MyC.maxHealth)
    13.             {
    14.                 MyC.currentHealth = NewTot;
    15.             }
    16.             else
    17.             {
    18.                 MyC.currentHealth = MyC.maxHealth;
    19.             }
    20.         }
    21.         CurrentHP = MyC.currentHealth;
    22.     }
    23.  
     
    Last edited: Jul 4, 2016
  36. UnderEmpire

    UnderEmpire

    Joined:
    Jul 4, 2016
    Posts:
    2
    Hello, I have recently started to code. I have purchased the tpc and am trying to get it to work with my keyboard and mouse.
    I have check the input manager and all the settings are correct.
    When i hit play on the scene and try to move with my keyboard and mouse the text at the top flashes for a sec and then says changing to controller. I can barley get the player to move with the keyboard but it just flashes the changing back text.
    With an xbox controller i can get it to do every thing perfect. any idea what settings i need to check? it is detecting the mouse and keyboard and it is also reacting when i press a button.

    I tried to re-import the xinput files. i tried to uninstall the project and reinstall. so far i cant seem to figure out why its not allowing the keyboard to fully work.

    Edit: when i open the action input options it says that this controller has been configured to use a xbox 360 controller. if i want to use mouse and keyboard i need to go to input manager and set the Alt positive button. when i look in the manager all of the buttons are currently set correctly.
    There is no other options in the Action Options to change the method to keyboard on start up.

    any ideas would be appreciated.

    Chris
     
    Last edited: Jul 4, 2016
  37. nerdares

    nerdares

    Joined:
    Aug 4, 2015
    Posts:
    18
    What kind of controller are you using? If it's xbox 360, try making a completly new project and only put in the TPC template in.

    Try to unplug the controller during runtime and see if the issue still persists


    This issue sounded a lot similar to mine but again, I can't be of much help because I myself don't know EXACTLY how I fixed it. All I can tell you is that I had an issue with the xbox one controller but then it worked fine, which is really werid

    Edit: Actually, it looks like my issue hasn't been fixed. But that is weird, it was working before... I tried reinputting xinput and nothing different happened.

    Last edit:

    Fixed the issue! Go to vThirdPersonInput and comment out the line where it says Input.GetAxis("Triggers") != 0.0f

    I think what's happening is that once you use the controller, triggers never go back to 0.0 when you put it down. If the value is above or below 0.0, the bool isControllerInput returns true and will never go back to false. This can get hectic but for now, the best fix is just to comment that line out. Its one of the last few lines
     
    Last edited: Jul 4, 2016
  38. UnderEmpire

    UnderEmpire

    Joined:
    Jul 4, 2016
    Posts:
    2
    Hello, and thanks for the reply. I am trying that out now. I also seen this bit near the middle was set to false should be true.


    case InputType.Controler:
    if (isMouseKeyboard())
    {
    inputType = InputType.MouseKeyboard;
    hud.controllerInput = false;
    if (hud != null)
    hud.FadeText("Control scheme changed to Keyboard/Mouse", 2f, 0.5f);
     
  39. carlosrovira

    carlosrovira

    Joined:
    Dec 23, 2014
    Posts:
    58
    Hi,

    I'm want to integrate TPC with Adventure Creator (AC).

    Searching for internet I saw this :


    In the video, this guy talks about @Invector working in a native integration/implementation.

    Is this real? could you share the state of this work?

    If not, although native integration is preferred (like Opsive), some advice would be helpful to try it myself.

    Thanks!

    Carlos
     
    Alverik likes this.
  40. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Yeah, I also want to know. I work with Adventure Creator and would love to be able to use your controller with it. I think your controller is the best at the moment, the one which moves and feels the nicest out of the box, but I'm not a coder, so doing the integration myself is a bit over my head. Honestly, I feel hesitant to use other controllers, but if it gets to that, I may have to turn to Motion controller or Opsive's controller for my current project, simply because they already have an integration...
     
  41. sebsmax

    sebsmax

    Joined:
    Sep 8, 2015
    Posts:
    118
    Hello @Invector, I'm about to merge all my changes in your code. By doing so, I won't be able to update anymore the controller. I wanted to know if you're about to release another update?



    I've implemented a swimming system (sorry for the slow video capture )
     
    wood333, Invector, Alverik and 2 others like this.
  42. mediaticsvc64

    mediaticsvc64

    Joined:
    Nov 7, 2015
    Posts:
    28
    Hi, i just wondering if there were some tutorials for integrations with "dialogue system" and "cinema director", and if there were a good way to use legacy characters like monsters....
     
  43. Shodan0101

    Shodan0101

    Joined:
    Mar 18, 2013
    Posts:
    141
    Your swimming system looks fantastic!! Well done! Would love to see this built into Invector.
     
    Alverik likes this.
  44. carlosrovira

    carlosrovira

    Joined:
    Dec 23, 2014
    Posts:
    58
    @sebsmax, swimming system looks so good, congrats!
    what about to donate in order to get future updates? ;)
     
  45. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Amazing stuff! Great job! I would also love it if something like this could be integrated into the Controller!
     
    Shodan0101 likes this.
  46. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Oh my glob it's so good to see this forum again :p

    @Carlos-Rovira & @Alverik I already contact the AC Dev and he send me a voucher, so we already have the Asset, but it will take some time for us to learn how to use the AC and then, integrate to our Template. This will be done after we release a stable version of the Shooter.

    I believe there is no tutorial for this assets yet, and our AI is still restricted to Humanoids only but we do have plans to add Generic support in the future.
    We already talk by email, but I will leave the answer here too:
    As for updates, we're working on pretty heavy changes and improvements on the main scripts & animator, so we will not post any updates this month I guess
     
    Shodan0101 and Alverik like this.
  47. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    So guys, we're testing a new forum focus only on our templates, and I would like to know what you guys think.
    I personaly like because is fast, clean, has a search tool, you can post scripts, etc...

    Let me know what you think :p - It's open for sign in, post freely!

    http://www.invector.xyz/forum

     
    Malbers and Alverik like this.
  48. Arekon

    Arekon

    Joined:
    Jul 12, 2016
    Posts:
    2
    I only get a blank page. :(
     
  49. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Weird, it opens just fine for me, did you try using another browser?
     
  50. Gojira96

    Gojira96

    Joined:
    Jun 18, 2015
    Posts:
    32
    Hi again,


    I am trying to create a stealth mode.

    I created a short script that for every time a player is crouched,

    his tag changes from „Player“ to „Stealth“.

    Enemies cant see „Stealth“ tag(It is not in sphere sensor) and the Players tag indeed

    does change to „Stealth“,

    but the Enemy still chase me when I enter FoV.

    What else do I need to change so that the Player becomes unoticable?



    Also,I think that you should definitely check out the Chronos – Time control asset.

    It would do wonders with your future releases,like Shooter Addon.

    The combination of two is just mind blowing. :)