Jump to content

Couple of c# / API questions.


Recommended Posts

My apologies, it's getting late and I overlooked including the log. :(

 

Quote

[LOG 23:59:17.921] Locked on to Kerbin (CelestialBody)
[LOG 23:59:17.922] TMS ORBITAL MECHANICS - Trying to Spawn a Gate
[LOG 23:59:17.923] TMS ORBITAL MECHANICS - Going to GetProtoGate
[LOG 23:59:17.924] TMS ORBITAL MECHANICS - Defining our Gate List
[LOG 23:59:17.925] TMS ORBITAL MECHANICS - Defined our Gate List
[LOG 23:59:17.926] TMS ORBITAL MECHANICS - About to Start our first foreach Loop
[LOG 23:59:17.927] TMS ORBITAL MECHANICS - Gates in list = 0
[LOG 23:59:17.928] TMS ORBITAL MECHANICS - found STARGATE node
[LOG 23:59:17.929] TMS ORBITAL MECHANICS - About to Start our Second ForEach loop
[LOG 23:59:17.930] TMS ORBITAL MECHANICS - found VESSEL node
[LOG 23:59:17.931] TMS ORBITAL MECHANICS - Adding to candidate List
[LOG 23:59:17.932] TMS ORBITAL MECHANICS - Gates in list = 1
[LOG 23:59:17.934] TMS ORBITAL MECHANICS - Returning Info
[LOG 23:59:17.935] TMS ORBITAL MECHANICS - Coming back from GetProtoGate
[LOG 23:59:17.936] TMS ORBITAL MECHANICS - Stargate Name = Kerbin Stargate
[LOG 23:59:17.937] TMS ORBITAL MECHANICS - assign Flight ID
[LOG 23:59:17.946] TMS ORBITAL MECHANICS - Stargate NameVESSEL
[LOG 23:59:17.947] TMS ORBITAL MECHANICS - Get Parts
[LOG 23:59:17.948] TMS ORBITAL MECHANICS - Part NamePART
[LOG 23:59:17.949] TMS ORBITAL MECHANICS - Defining Orbit Details
[LOG 23:59:17.950] TMS ORBITAL MECHANICS - Defining Parameters config node
[LOG 23:59:17.952] TMS ORBITAL MECHANICS - Creating Orbit details
[LOG 23:59:17.953] TMS ORBITAL MECHANICS - Adding all info to the ProtoVesselNode
[LOG 23:59:17.956] TMS ORBITAL MECHANICS - Adding our Gate to the game(I think)
[LOG 23:59:22.377] [ScenarioDestructibles]: Loading... 0 objects registered

Anyway, this is what happened in the log.  As you can see the stargateList (Gates in list) has 1 entry, which it should have.  the stargateList[0].name comes out as 'VESSEL' (Stargate NameVESSEL) which if I'm look at this correctly, it should really be the ship name as defined in the cfg file (which is a slightly modified craft file), and then when I try to grab the PART in the line I mentioned in my previous post, I get a stargateParts[0] value of PART (Part NamePART), which should (I believe) be the actual part assigned to the ship.

All of this is a lot of guesswork tbh but I'm learning, and picking up how stuff works. :)

As for Github, I don't have one as yet, but I plan to sort it out this weekend sometime. :)

Really appreciate the help :)

TheMightySpud

Link to comment
Share on other sites

oh, if its just the names being wrong from ConfigNode.name, its probably because.name isn't actually the name field in a confignode (guessing here, never actually used the .name field). what you probably want is

 Debug.Log("TMS ORBITAL MECHANICS - Stargate Name " + stargateList[0].GetValue("name"));

EDIT

And that wont work because the vessel node doesn't have a name. Try:

Debug.Log("TMS ORBITAL MECHANICS - Stargate Name " + stargateList[0].GetValue("description"));
Debug.Log("TMS ORBITAL MECHANICS - Stargate Name " + stargateList[0].GetValue("ship"));
Edited by Crzyrndm
Link to comment
Share on other sites

Thanks again for that :)

After playing around for a bit more adding in those few lines, it turns out it's doing what it supposed to (It's finding the Node(s) called PART, but the problem is It doesn't seem to be adding any of the info inside the PART node(s) into the ship, which is why I'm getting the 'Craft File not loaded because of missing part ..........' Error when I start up KSP.

I'll have a bit more of a play to see if I can figure it all out :)

TheMightySpud

Link to comment
Share on other sites

Well, I got around to setting myself a git repository so it should be a lot easier to read the stuff I'm going to be asking about :)

Also added the beginnings of a readme with most of what I'm trying to accomplish, so it may give everyone a better idea. :)

I'm going to end this thread, and create a new one specifically for the mod as this was supposed to be general questions and it has evolved somewhat.

TheMightySpud

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...