Jump to content

Search the Community

Showing results for tags 'hierarchy'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements
    • Welcome Aboard
  • Kerbal Space Program 1
    • KSP1 Discussion
    • KSP1 Suggestions & Development Discussion
    • KSP1 Challenges & Mission ideas
    • KSP1 The Spacecraft Exchange
    • KSP1 Mission Reports
    • KSP1 Gameplay and Technical Support
    • KSP1 Mods
    • KSP1 Expansions
  • Kerbal Space Program 2
    • KSP2 Dev Updates
    • KSP2 Discussion
    • KSP2 Suggestions and Development Discussion
    • Challenges & Mission Ideas
    • The KSP2 Spacecraft Exchange
    • Mission Reports
    • KSP2 Prelaunch Archive
  • Kerbal Space Program 2 Gameplay & Technical Support
    • KSP2 Gameplay Questions and Tutorials
    • KSP2 Technical Support (PC, unmodded installs)
    • KSP2 Technical Support (PC, modded installs)
  • Kerbal Space Program 2 Mods
    • KSP2 Mod Discussions
    • KSP2 Mod Releases
    • KSP2 Mod Development
  • Community
    • Science & Spaceflight
    • Kerbal Network
    • The Lounge
    • KSP Fan Works
  • International
    • International

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Skype


Twitter


About me


Location


Interests

Found 1 result

  1. I have a part that has specific attach node IDs. I want to grab all the child parts of the attachNodes which have that ID. However, when using Part.findAttachNodes("theID"), though the method does return an array of the right attach nodes, when I try to access the attachNode attachedPart method, to access the child parts, the parts come back with the same reference. When I look at the part.instanceId, the instance IDs are repeated. I've tried just about every way I can think of to access the child parts,but to no avail. Very mysterious... Here's my code. public List<Part> childParts; public getParts() { foreach(AttachNode an in part.findAttachNodes(nodeID) { childParts.Add(an.attachedPart); } } Public rotateParts() { foreach(Part p in childParts) { p.partTransform.findChild("model).RotateAround(transform.position, transform.up, 25 * TimeWarp.deltaTime); if(p.partInfo.internalConfig.hasData) { p.internalModel.transform.RotateAround.transform.position, transform.forward, 25 * TimeWarp.fixedDeltaTime * -1); } } } public override void OnStart(PartModule.StartState state) { if(!HighLogic.loadedSceneIsFlight)return; childParts = new List<Part>(); } public void FixedUpdate() { rotateParts(); } EDIT: So, after more, testing (practically ripped my hair out!), I discovered there was nothing wrong with the code, the problem was how the nodes were defined in the cfg file. Original CFG: node_stack_top = 0.0, 2.8152, 0.00, 0.0, 1.0, 0.0, 3 node_stack_side_1 = 2.8152, 0.0, 0.0, 1.0, 0.0, 0.0, 3 node_stack_side_2 = -2.8152, 0.0, 0.0, -1.0, 0.0, 0.0, 3 node_stack_side_3 = 0.0, 0.0, 2.8152, 0.0, 0.0, 1.0, 3 node_stack_side_4 = 0.0, 0.0, -2.8152, 0.0, 0.0, -1.0, 3 node_stack_bottom = 0.0, -2.8152, 0.00, 0.0, -1.0, 0.0, 3 Fixed CFG: node_stack_top = 0.0, 2.8152, 0.00, 0.0, 1.0, 0.0, 3 node_stack_side1 = 2.8152, 0.0, 0.0, 1.0, 0.0, 0.0, 3 node_stack_side2 = -2.8152, 0.0, 0.0, -1.0, 0.0, 0.0, 3 node_stack_side3 = 0.0, 0.0, 2.8152, 0.0, 0.0, 1.0, 3 node_stack_side4 = 0.0, 0.0, -2.8152, 0.0, 0.0, -1.0, 3 node_stack_bottom = 0.0, -2.8152, 0.00, 0.0, -1.0, 0.0, 3 I looked at how the nodes were defined in Squad's station hub part. Each node was defined uniquely as right, left, back, front and so forth. Apparently, when the config nodes are loaded from the attachNode definition in the cfg, the underscores are stripped out, consequently the values in AttachNodes list were overwritten, although partjoints were still created and the parts were attached.
×
×
  • Create New...