• Got it, I was keeping the ORK2 project as a reference to replicate the same setup on ORK3 before deleting it :)

    What is the class on ORK3 I should now inherit from for my PlayerControl class? Before it was PlayerControl : BasePlayerControl

    After adding the GamingIsLove.ORKFramework and GamingIsLove.Makinom namespaces it's still giving me errors for some ORK2 classes (like ActorEventMover, BaseInteraction...).

    If you have the ORK3 equivalent for MousePlayerController.cs that would be very helpful since I used that as guideline for my custom class.
  • The control component classes are still (named) the same, but they're also in a new namespace: GamingIsLove.ORKFramework.Components
    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!
  • I tried adding also GamingIsLove.ORKFramework.Components namespace but I still get missing type/namespace errors for these lines:
    -----------------------------
    private ActorEventMover mover = null;
    BaseInteraction[] interactions = hit.transform.gameObject.GetComponentsInChildren();
    (EventStartType.Interact == interactions[i].startType)

    and missing definitions / errors for these:
    ----------------------------
    this.combatant = ComponentHelper.GetCombatant(this.transform.root.gameObject);
    Ray ray = ORK.Game.Camera.ScreenPointToRay(point);
    this.ignoreHeightDistance

    I am not sure how to proceed, without a reference this might go beyond my limited programming skills :(
  • Send me an email to contact@orkframework.com, I can send you the current ORK 3 version for the MousePlayerController class.
    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!
  • That would be great, thank you so much!
  • I've noticed that on BETA 25
    Schematics: Movement Nodes
    The Move Component settings now support using a Combatant Movement Component, which is pretty awesome :)

    image

    Since new Method entries were also added to:
    Combatants>Combatants>General Settings > Default Movement Component > Custom
    image

    which Methods are used by the Schematics Movement Node and how?

    I tried using this new feature right away since I have a custom Component Type, but my machine Object moves for an instant but never goes all the way to the destination like it does with Move Component>Auto for example.
  • Well - both - the Move Method is used for updates each frame (e.g. when using fading), the Set Position Method is used when directly setting the position once (e.g. when not fading).
    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 January 2022
    Ok, I saw that in:
    Combatants>Combatants>General Settings>Default Movement Component>Custom
    there's a note:
    "You can create custom movement component integrations by extending from the BaseMovementComponentSettings class"

    I think my old custom movement component is not working anymore and needs to be redone from scratch according to that note.

    Since the BaseMovementComponentSettings class is probably part of the ORKFramework3.dll, could you explain how to create a custom movement component integrations?
    Post edited by ChimpLogik on
  • edited January 2022
    It's actually part of Makinom, i.e. namespace GamingIsLove.Makinom.

    Here's the code for the Default component implementation:
    using UnityEngine;
    using GamingIsLove.Makinom.Components;
    using System.Collections.Generic;

    namespace GamingIsLove.Makinom
    {
    [EditorSettingInfo("Default", "A simple movement component that will move directly to the destination.")]
    public class SimpleMovementComponentSetting : BaseMovementComponentSetting
    {
    [EditorHelp("Add Component", "The component will be added to the game object, if it isn't added already.\n" +
    "If disabled, the component must already be attached to the game object.", "")]
    public bool compAdd = false;

    public SimpleMovementComponentSetting()
    {

    }

    public override IMovementComponent Init(GameObject gameObject)
    {
    return new MoveComponent(gameObject, this);
    }

    public class MoveComponent : IMovementComponent
    {
    private SimpleMove simpleMove;

    public MoveComponent(GameObject gameObject, SimpleMovementComponentSetting setting)
    {
    if(this.simpleMove == null)
    {
    this.simpleMove = gameObject.transform.root.GetComponentInChildren<SimpleMove>();
    if(this.simpleMove == null &&
    setting.compAdd)
    {
    this.simpleMove = gameObject.AddComponent<SimpleMove>();
    }
    }
    }

    public virtual void Move(Vector3 change)
    {
    if(this.simpleMove != null)
    {
    this.simpleMove.Move(change);
    }
    }

    public virtual bool MoveTo(ref Vector3 position, float speed)
    {
    if(this.simpleMove != null)
    {
    this.simpleMove.MoveTo(speed, position);
    return true;
    }
    return false;
    }

    public virtual void SetPosition(Vector3 position)
    {
    if(this.simpleMove != null)
    {
    this.simpleMove.SetPosition(position);
    }
    }

    public virtual void Stop()
    {
    if(this.simpleMove != null)
    {
    this.simpleMove.Stop();
    }
    }
    }
    }
    }


    In short, your settings class generates an instance of something implementing the IMovementComponent interface, which handles all the movement stuff (or forwards it to a component).
    Post edited by gamingislove on
    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!
  • I spent several hours trying to get this working but my moving methods were never called/logged, I apologize in advance about my limited programming skills :(

    These are the steps I followed:

    1) I created my ORKCustomMovementComponent class extending BaseMovementComponentSetting

    using UnityEngine;
    using GamingIsLove.Makinom.Components;

    namespace GamingIsLove.Makinom
    {
    public class ORKCustomMovementComponent : BaseMovementComponentSetting
    {
    public bool compAdd = false;

    public ORKCustomMovementComponent()
    {
    }

    public override IMovementComponent Init(GameObject gameObject)
    {
    return new myMoveComponent(gameObject, this);
    }

    public class myMoveComponent : IMovementComponent
    {
    private ORKCustomMovement myCustomMovement;

    public myMoveComponent(GameObject gameObject, ORKCustomMovementComponent setting)
    {
    if(myCustomMovement==null)
    {
    this.myCustomMovement = gameObject.transform.root.GetComponentInChildren<ORKCustomMovement>();
    if (this.myCustomMovement == null && setting.compAdd)
    {
    this.myCustomMovement = gameObject.AddComponent<ORKCustomMovement>();
    }
    }
    }

    public virtual void Move(Vector3 change)
    {
    if (this.myCustomMovement != null)
    {
    this.myCustomMovement.Move(change);
    }
    }

    public virtual bool MoveTo(ref Vector3 position, float speed)
    {
    if (this.myCustomMovement != null)
    {
    this.myCustomMovement.MoveTo(speed, position);
    return true;
    }
    return false;
    }

    public virtual void SetPosition(Vector3 position)
    {
    if (this.myCustomMovement != null)
    {
    this.myCustomMovement.SetPosition(position);
    }
    }

    public virtual void Stop()
    {
    if (this.myCustomMovement != null)
    {
    this.myCustomMovement.Stop();
    }
    }
    }
    }
    }

    2) I created a second MonoBehaviour class where I would later put my custom movement methods

    using UnityEngine;
    using GamingIsLove.Makinom;

    public class ORKCustomMovement : MonoBehaviour
    {
    public ORKCustomMovementComponent customComponent = new ORKCustomMovementComponent();
    public IMovementComponent _interface;
    public float speed = 5;

    void Start()
    {
    _interface = customComponent.Init(this.gameObject);
    }

    public void SetSpeed(float value)
    {
    // My methods
    Debug.Log("ORKCustomMovement method SetSpeed() was called: " + value.ToString());
    this.speed = value;
    }
    public void Move(Vector3 nextPosition)
    {
    // My methods
    Debug.Log("ORKCustomMovement method Move() was called: " + nextPosition.ToString());
    _interface.Move(nextPosition);
    }
    public void MoveTo(float speed, Vector3 position)
    {
    // My methods
    Debug.Log("ORKCustomMovement method MoveTo() was called: " + position.ToString());
    _interface.Move(position);
    }
    public void SetDestination(Vector3 destination)
    {
    // My methods
    Debug.Log("ORKCustomMovement method SetDestination() was called: " + destination.ToString());
    _interface.MoveTo(ref destination, speed);
    }
    public void SetPosition(Vector3 position)
    {
    // My methods
    Debug.Log("ORKCustomMovement method SetPosition() was called: " + position.ToString());
    _interface.SetPosition(position);
    }
    public void Stop()
    {
    // My methods
    Debug.Log("ORKCustomMovement method Stop() was called");
    _interface.Stop();
    }
    }

    3)
    In Combatants>Combatants>General Settings>Default Movement Component I set the methods names
    image

    Note: except from Stop(), all the methods require one parameter but MoveTo() requires two parameters in IMovementComponent while SetSpeed() seems to be missing..

    4) In Base/Control>Game Controls>Control Behaviours I set the Player Control behaviour 0
    image
  • Adding a custom implementation of BaseMovementComponentSetting will make it available as a selection in the Component Type setting.

    So, you don't use the Custom type here, but the one you created. It should show up without adding an EditorSettingInfo attribute (as in the example I posted), otherwise add that attribute with your custom name/description.

    Btw, regarding #4 - if you're using the Button controls with combatant movement component, you don't need to do that. The control is blocked anyway, the custom movement component is only executing the movement (and is also used when control is blocked, e.g. by schematics animating your actions).
    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!
Sign In or Register to comment.