HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: [Resolved] Deleting Nodes  (Read 1514 times)

lileebeta

  • General Accounts
  • *
  • Posts: 48
    • View Profile
[Resolved] Deleting Nodes
« on: Oct 09, 11, 04:29:55 PM »

Given That the CLI command "/DN <node id> " is how we delete nodes via the console - my question is where do I get the Node id from On a GUI object?  I can't seem to find the Node id on my GUI Objects so when I am editing thier positions I get a glob of GUI objects.
Thanks
« Last Edit: Nov 01, 12, 11:13:04 AM by HE-Cooper »
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Deleting Nodes
« Reply #1 on: Oct 10, 11, 12:38:20 AM »

One thing You could do is when the gui is created, either store the noderef in something that will keep the value, or a temporary fix would be to use println() to display the id to the console and copy from there.

Alternatively, if you know the class of the gui, you can Query for Nodes of that class:
Code: [Select]
/qn className
If you can get the id of a parent control to it (or farther up the hierarchy), you could check the children field to see all child controls.
Code: [Select]
/sn <someNodeID>--Shows the details of a Node.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

lileebeta

  • General Accounts
  • *
  • Posts: 48
    • View Profile
Re: Deleting Nodes
« Reply #2 on: Oct 10, 11, 07:21:13 AM »

Great news ,but merely recommending println() is pretty vague.. Print what the node Id?
So println (NodeId)?
Plus every time i try to use println on any thing I just come up with a script error that says cant use external funtions?


What seems to work is to say " /qn _GUIbutton " which brings up a list of all of my current buttons is the order that they were created, then the node id is identifed in the console and then  I just type that node id into the command line.

thus /qn _GUIButton  (quiry node of all gui buttons in the scene) brings up 10000345.
I then type /DN 10000345 (delete node)  thereby deleting the node.

 
 /Thanks <ScottZ>
« Last Edit: Oct 10, 11, 08:26:07 AM by Khalil »
Logged

HE-JAY

  • HeroEngine
  • *****
  • Posts: 122
    • View Profile
Re: Deleting Nodes
« Reply #3 on: Oct 13, 11, 11:06:17 AM »

There are several ways to find a GUI control after creation.

1. use FindGUIControlByName -- an external function that will walk the hierarchy of GUI controls and return a reference to the named control (see examples in script as well as examples in the GUI wiki pages).
2. store a reference to your GUI control in a field (perhaps on a system node) after you've created the GUI control; then, later, reference the ID stored in that field to access your control.
3. use associations to associate a GUI control to another entity you have the ID for (again, a system node would work)

During development-time, it's perfectly acceptable to use /qn to find nodes (as well as the QueryNodes external function) if you don't need to programmatically manipulate them.
Logged