Page 1 of 1
How to read NodeID with mousepick?
Posted: Wed Feb 11, 2015 6:06 pm
by T4r4ntul4
hey guys,
for some reason i cant find a answer to this: How to read NodeID with mousepick?
i did try this: (both ofcourse in If MouseButton(#PB_MouseButton_Left) etc etc)
Code: Select all
Entity = MousePick(0, MouseX(), MouseY())
nodenr = NodeID(1)
Debug "nodenr: "+Str(nodenr)
and then:
Code: Select all
Entity = MousePick(0, MouseX(), MouseY())
nodenr2 = EntityParentNode(Entity)
Debug "nodenr2: "+Str(nodenr2)
both snippets gives me a long number, i know it gives the system number, but i just want the NodeID as given with the creation of the node. is this possible?
Re: How to read NodeID with mousepick?
Posted: Wed Feb 11, 2015 7:53 pm
by Samuel
Not possible as far as I know.
What I would do is keep track of what nodes are linked to what entities by using an array or structure.
Then when an entity is picked just look up whatever node is linked to it.
Re: How to read NodeID with mousepick?
Posted: Wed Feb 11, 2015 10:24 pm
by T4r4ntul4
okay thnx for the answer. iam gonna use a Map for it, its easier for my situation.
Re: How to read NodeID with mousepick?
Posted: Wed Feb 11, 2015 10:44 pm
by T4r4ntul4
btw, whats the purpose of EntityParentNode() ?
the documentation says:
Syntax
Result = EntityParentNode(#Entity)
Description
Returns the parent NodeID().
Parameters
#Entity The entity to use.
Return value
Returns the parent NodeID(), if any. This can be either a real node, or a bone if the entity is attached to a bone. If the entity has no parent node, it will returns 0.
Supported OS
All
but it gives only that long number, it dont seem logical to give that long number if you read the docs.
Re: How to read NodeID with mousepick?
Posted: Wed Feb 11, 2015 11:00 pm
by Comtois
EntityParentNode() can be useful for commands that require a NodeID(). You dont need to create a node, then attach one entity to this node, you can use directly EntityParentNode().
See the example NodeAnimation2.pb
Re: How to read NodeID with mousepick?
Posted: Thu Feb 12, 2015 5:14 pm
by T4r4ntul4
okay thanks, now i understand =)