Talk:TorqueScript Console Functions 9

From TDN

--Charlie Sibbach 20:59, 29 March 2008 (PST) I find nameToID to be highly useful an use it all over the place, because of something that is basically undocumented in the official sources- I had to find it in the example code somewhere. That function is the ability to navigate the object hierarchy like a file hierarchy. For example, if I have a GuiTextCtrl "Control1" and a child control of it GuiTextCtrl "Control2", I can get the child control unambiguously by nameToID("Control1/Control2"); This is extremely useful for GUIs in particular, as I have a very large in-game editor gui where namespace clashes were common. As far as I can tell, simply refering to an object by name (Control1.setText() for example) doesn't work well with a hierarchy call- I can't do Control1/Control2.setText(); in the code, I have to do a nameToID() call first. If I have two objects named Control2, I would have major problems here without nameToID(). Why isn't this documented, I have no idea. Honestly, I haven't figured out what the internalName stuff is all about given that I can do this with the real name. I don't want to update the wiki here with this as it is taken pretty much from the Torque Bible, at least until I get some buy-in that I'm not talking complete gibberish here (I wasted many hours experimenting with this, so I know I'm not, but there may be a way to do this without nameToID that I'm not aware of, that doesn't include managing a whole separate InternalName!).