Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Add ExtractIDs LogiX node #144

Merged
merged 5 commits into from
Jul 23, 2023
Merged

Add ExtractIDs LogiX node #144

merged 5 commits into from
Jul 23, 2023

Conversation

Nytra
Copy link
Contributor

@Nytra Nytra commented Jul 22, 2023

Takes a RefID and outputs a ulong for Position and a byte for User

This is possible to do in vanilla Neos with a handful of logix nodes but this does it in just one.

Arti said this would be useful.

20230722131841_1

@Xlinka
Copy link
Owner

Xlinka commented Jul 23, 2023

using FrooxEngine.LogiX;

[Category("LogiX/References")]
[NodeName("Extract IDs")]
public class ExtractIDs : LogixNode
{
    public readonly Input<RefID> RefID;
    public readonly Output<ulong> Position;
    public readonly Output<byte> User;

    protected override void OnEvaluate()
    {
        RefID refId = RefID.Evaluate();
        if (refId != null)
        {
            refId.ExtractIDs(out ulong position, out byte user);
            Position.Value = position;
            User.Value = user;
        }
        else
        {
            Position.Value = 0;
            User.Value = 0;
        }
    }
}

this is how i would do this node.

@Nytra
Copy link
Contributor Author

Nytra commented Jul 23, 2023

Updated node to use your code

@Xlinka Xlinka merged commit 0617ce0 into Xlinka:main Jul 23, 2023
1 of 2 checks passed
@Nytra Nytra deleted the ExtractIDs branch July 24, 2023 13:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants