• edited January 2018
    -
    Post edited by Scyra on
  • That mock-up looks incredible. I bought ORK and Invector
  • Since you're going with Invector's controller, you might find these two scripts useful. Put both on your player prefab, and then add them both to the Custom Controls settings in ORK. ThirdPersonControllerBridge needs to be set for when the Player is blocked, while ThirdPersonCameraBridge will be set for when the Camera is blocked. Both components go on the player though.

    using Invector.CharacterController;
    using UnityEngine;

    namespace ORKIntegrationLibrary.Invector
    {
    [RequireComponent(typeof(vThirdPersonInput))]
    public class ThirdPersonControllerBridge : MonoBehaviour
    {
    // Lock cursor when disabling controller input?
    public bool lockCursor = true;
    protected vThirdPersonInput _thirdPersonInput = null;

    [SerializeField]
    protected bool _ShowDebugLog = false;

    void Awake()
    {
    _thirdPersonInput = GetComponent<vThirdPersonInput>();
    }

    void OnEnable()
    {
    _thirdPersonInput.lockInput = false;

    if (_ShowDebugLog)
    {
    Debug.Log("[ThirdPersonControllerBridge] Unlocking input ");
    }

    if (lockCursor) { SetCursorLock(true); }
    }

    void OnDisable()
    {
    _thirdPersonInput.lockInput = true;

    if (_ShowDebugLog)
    {
    Debug.Log("[ThirdPersonControllerBridge] Locking input ");
    }
    SetCursorLock(false);
    }

    public void SetCursorLock(bool cursorLock = true)
    {
    Cursor.visible = !cursorLock;
    Cursor.lockState = cursorLock ? CursorLockMode.Locked : CursorLockMode.None;

    if (_ShowDebugLog)
    {
    Debug.Log("[ThirdPersonControllerBridge] Setting cursor lock: " + cursorLock);
    }
    }
    }
    }





    using Invector.CharacterController;
    using UnityEngine;

    namespace ORKIntegrationLibrary.Invector
    {
    [RequireComponent(typeof(vThirdPersonInput))]
    public class ThirdPersonCameraBridge : MonoBehaviour
    {
    protected vThirdPersonInput _thirdPersonInput = null;

    void Awake()
    {
    _thirdPersonInput = GetComponent<vThirdPersonInput>();
    }

    void OnEnable()
    {
    _thirdPersonInput.lockCameraInput = false;
    }

    void OnDisable()
    {
    _thirdPersonInput.lockCameraInput = true;
    }
    }
    }



    This will get your player & camera controls being blocked properly through ORK.
  • Thanks @Keldryn :)
    You've been working on a game with Invector and ORK then? Is there any footage?
  • You're welcome!

    No, I'm not actually working on a game with Invector & ORK. I was playing around with the controller a bit, but I still really dislike it in general. Very nice demo and it has a good feel out of the box, but I have a number of major issues with how its code base is put together. Frustrates me every time I decide to revisit that particular controller.
  • hello noticed this post is new. Im trying to implement invectors 3rd person melee controller into Ork.

    Basically want to have realtime combat similar to Skyrim. I need Ork to handle all the stats and leveling. Is it possible with Invector, would that posted script work with what I'm doing?

  • edited November 2017
    HI @frenzel1990 I haven't gotten that far yet myself. I'm only learning ORK now and been designing the game. Probably looking into the Invector implementation next week. Keep me posted on your progress with it!? :)

    If you haven't already, check this out, it might help: http://orkframework.com/tutorial/howto/custom-playercamera-controls/

    If I understood correctly you put the above two scripts into the player prefab. Then Set the Player Control Type to None and set the Custom Controls as such: image

    But I don't even have Invectror yet in my project, Im just messing with ORK so can't test that now

    Edit: forgot to add .cs in the first Behaviour name...
    Post edited by TenToes on
  • Don't add .cs, that doesn't work - it's about the name of the class, not the name of the script file :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited November 2017
    @gamingislove oh, that's right. Good thing you came in and helped :) Was the rest of it correct?

    Would you import ORK first and then the controller?
    Post edited by TenToes on
  • @TenToes - Do take note that Invector is classified as a "complete project" and thus it includes its own Project Settings files that will overwrite your own changes. You can if course deselect these on import, but it's not recommended as Invector needs the tags/layers, input keys, and physics settings included in the package.

    Best practice is to import the controller first in a new project, test it to make sure it works, then start adding other assets only as you need them. ;-)

    If you're fine to go back and change any project settings manually, go ahead and import Invector into your existing ORK project. If you've set up the project for HDR (linear/deferred and disabled MSAA) then you'll need to do so again.

  • @Keldryn thanks. I'll add the controller first then. The only ORK Project I have now is just for tutorials/messing around
  • edited January 2018
    -
    Post edited by Scyra on
  • You can take a couple of different approaching with integrating ORK and Invector (or any of the other controllers).

    The "simple" way is to use the controller for movement (and jumping, climbing, etc) and let ORK handle all of the combat. So you'd use the same approach as the tutorials, with Control Maps, Battle Events to animate your attacks, Damage Dealers, etc. If you create an additional layer in your animator controller set to "Override" blend mode and with a full body avatar mask, then ORK can play animations on that layer and override whatever animation the controller is playing. Probably need to disable the controller movement or input when this is happening though.

    The more advanced (and obviously more complex) approach is to also use the controller's combat system, but have ORK handle all of the stats and calculations. This has the advantage of better hit detection and overall a much more responsive and fluid feel to how it controls. I don't find the results of the "simple" integration satisfying in the slightest, so I always go with the more advanced integration.

    I've done the advanced integration with all three controllers (ootii, Opsive, Invector), to at least a basic functional level -- it would take a long time to completely integrate all of ORK's features with all of a controller's features, so I just do it as needed beyond getting the control blocking and weapon combat working. The code I wrote for integrating with Invector is pretty old and was done shortly after the initial release of the Melee Combat Template, so it needs re-writing to work with the current incarnation (Invector's code has changed dramatically and this is my primary beef with the asset -- it's not written or designed in such a way that you can extend it without modifying the asset's source code). So I can offer some assistance with this.

    If you're doing a real-time game that requires responsive controls, then in my experience the best strategy is to treat the character controller as the primary system and ORK as a secondary system that "glues" various subsystems together. When it comes to the player anyway.
  • edited January 2018
    -
    Post edited by Scyra on
  • edited November 2017
    Thanks @Keldryn

    Would you say the "advanced" way is better for real-time battles and "simpler" is better for turn-based?

    So you think those scripts you gave don't work anymore? I could contact Invector about it too, maybe they'll provide new ones. Too bad Opsive's sale was after black friday, after I had already gotten Invector... :/
    Post edited by TenToes on
Sign In or Register to comment.