≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Trouble with getting child node
Posted by:
(you are not logged in)
Enter the missing letter in: "I?ternational"
(you are not logged in)
Text:
[quote][b]dekon_17[/b] wrote: A while ago I made a thread there with the problem of my custom shooting (this is solved by now, so, don't need to check that). As I mentioned there, I made it in order to use hitboxes instead of collision... sphere? Ellipsoid? I don't know. The thing is that after I did this, I've needed to heavily edit my old spawn script. Now, there's the problem: it can't properly find the child node, which is a folder. [img]https://i.postimg.cc/XNZsZjnX/image.png[/img] [code] for (var i = 0; i < ChildCount; ++i); { var Folder = ccbGetChildSceneNode (Node, i); var Hitbox = ccbGetChildSceneNode (Folder, 0); ccbSetSceneNodeProperty (Hitbox, "Name", NewName + "HB" + i); }[/code] I think it might happen because it maybe can't use folders for that, yet it shown that the number of child nodes is 17 (which is how it is supposed to be). Did I done something incorrectly? Also, if this isn't enough, there's full code, it doesn't work (for me) anyway because of this issue: [code]/* <action jsname = "action_BSGSpawn" description = "Spawn enemies in BSG"> <property name = "Enemy" type = "scenenode"/> <property name = "SpawnNodeName" type = "string" default = "Spawn"/> </action> */ action_BSGSpawn = function() { }; action_BSGSpawn.prototype.execute = function() { var Fine = true; var PosArray = []; var RotArray = []; for (var be = 0; Fine == true; ++be) { var Node = ccbGetSceneNodeFromName (this.SpawnNodeName + be) if (Node) { PosArray.push (ccbGetSceneNodeProperty (Node, "PositionAbs")); RotArray.push (ccbGetSceneNodeProperty (Node, "Rotation")); } else var Fine = false; } for (var ni = 0; ni < PosArray.length; ++ni) { var Node = ccbCloneSceneNode (this.Enemy); var Name = ccbGetSceneNodeProperty (Node, "Name"); for (var s = 0; Fine == false; ++s) { var New = ccbGetSceneNodeFromName (Name + s); if (New) { } else { var NewName = Name + s; var Fine = true; } } ccbSetSceneNodeProperty (Node, "Name", NewName); var ChildCount = ccbGetSceneNodeChildCount (Node); for (var i = 0; i < ChildCount; ++i); { var Folder = ccbGetChildSceneNode (Node, i); var Hitbox = ccbGetChildSceneNode (Folder, 0); ccbSetSceneNodeProperty (Hitbox, "Name", NewName + "HB" + i); } var NewPos = PosArray [ni]; ccbSetSceneNodePositionWithoutCollision (Node, NewPos.x, NewPos.y, NewPos.z); var NewRot = RotArray [ni]; ccbSetSceneNodeProperty (Node, "Rotation", NewRot); }; }[/code][/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact