Ishkur
Members-
Posts
23 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Everything posted by Ishkur
-
[0.25]KSP Interstellar (Magnetic Nozzles, ISRU Revamp) Version 0.13
Ishkur replied to Fractal_UK's topic in KSP1 Mod Releases
Having some trouble getting the readings too, after 3 impacts. Are you piloting the impactor ship up until it's destroyed? 'Cause that's the one thing I consistently didn't do (I was in the recording ship watching the impactor's orbit until it crashed). -
[0.25]KSP Interstellar (Magnetic Nozzles, ISRU Revamp) Version 0.13
Ishkur replied to Fractal_UK's topic in KSP1 Mod Releases
Does it bother anybody else to have to keep closing the thermal mechanics window in the vab? Is there any way to disable it and only have it open upon pressing "I"? -
Independently Moving Parts
Ishkur replied to Ishkur's topic in KSP1 C# Plugin Development Help and Support
If I do it as an animation, will the collision mesh move along with the animation? 'Cause I'm under the impression that it doesn't(?) -
Hello, I'm trying to make some cargo bay doors for my personal use. I've managed to rotate a part around an axis that goes through a given point. All the children connected to the part rotates along with it, but the problem is the parent connected to the part try to rotate as well. I've tried changing the attach node in the cfg from FIXED_JOINT to HINGE_JOINT, but that didn't seem to solve the problem. What can I do to create this hinge? using System; using UnityEngine; namespace PartTesting { public class TestPart: PartModule { Transform axle; Transform topAttach; public override void OnStart(StartState state) { axle = part.FindModelTransform("axle"); topAttach = part.FindModelTransform("topAttach"); } public override void OnUpdate() { this.transform.RotateAround(axle.position, Vector3.up, Time.deltaTime*20); } } } Like I said, the problem is EVERYTHING connected to the door rotates along with it, rather than just the door itself. Some pointers would be nice!
-
How to find the transform of a part
Ishkur replied to Ishkur's topic in KSP1 C# Plugin Development Help and Support
I think that's more my inexperience with code, since I still don't understand what you said haha. I don't have "part" defined anywhere in my class, but it still worked for some reason. using System; using UnityEngine; namespace PartTesting { public class TestPart: PartModule { Transform axle; public override void OnStart(StartState state) { axle = part.FindModelTransform("axle"); } public override void OnUpdate() { this.transform.RotateAround(axle.position, Vector3.up, Time.deltaTime*20); } } } -
How to find the transform of a part
Ishkur replied to Ishkur's topic in KSP1 C# Plugin Development Help and Support
Thanks a lot, part.FindModelTransform did it for me! For some reason, though, I had to use underscore part.FindModelTransform rather than your suggested uppercase Part.FindModelTransform (there wasn't any code completion for the uppercase spelling). Any idea why that is? I would've found the method myself if I had looked through the completion for part. rather than Part. -
What're you referring to when you say "the new squishy-suspension format"? Did they publish some new literature?
-
I am using empty gameobjects in unity to assign the attach nodes for my part. How do I get the transform object that I've assigned to the part, without returning the transform of a different part's transform. My current method of getting the transform: public override void OnStart(StartState state) { Debug.Log (GameObject.Find ("topAttach").transform.position); } Sure it works, but when there's multiple of these parts in play, I can't be sure I'm getting the right transform of the corresponding part... On a side note, do you know why I'm getting two logs to console when I put the ship on the pad? Shouldn't it be called only once?
-
Removing Action Option From Part
Ishkur replied to Ishkur's topic in KSP1 C# Plugin Development Help and Support
I had the impression I could deactivate the event in the config file since the field existed in the craft file. I guess there's no choice but to make a module and do it there, then... Ended up making a new module which inherits from ModuleDockingNode and then overwriting the events like so: [KSPEvent(active = false, guiActive = false, guiName = "Decouple Node")] void Decouple() { } It worked, but it's really inelegant. Getting warnings everywhere as I'm hiding the Decouple and other methods from the inherited class. Thanks for your solution, I will switch over to that now! -
Removing Action Option From Part
Ishkur replied to Ishkur's topic in KSP1 C# Plugin Development Help and Support
I think you have that reversed, the guiName in the config is "Decouple Node", which matches with the button in game that I'm trying to get rid of. Undock's guiName is "Undock", and that button is absent already in game. -
Removing Action Option From Part
Ishkur replied to Ishkur's topic in KSP1 C# Plugin Development Help and Support
I'm not sure what you mean? I followed the format for the .cfg from this guy's game save file. Putting that in the part config allowed me to dock, so I guess it did do something unless I'm misunderstanding you. -
I have created a module that acts as a docking node and can dock with another of the same part. I am trying to remove the option to decouple the two parts after docking through the cfg file but it's not behaving as expected: MODULE { name = ModuleDockingNode referenceAttachNode = portDock nodeType = size1 nodeTransformName = portDock EVENTS { Decouple { active = false guiActive = false guiIcon = Decouple Node guiName = Decouple Node3 category = Decouple Node guiActiveUnfocused = false unfocusedRange = 2 externalToEVAOnly = false } } } Any ideas what I'm doing wrong? The parts dock just fine, but I am still allowed to undock. My brackets are all in the right place and everything...
-
Even with verbose debug on, the console doesn't tell me enough to figure this out, so I'm having a tough time here. Would really appreciate some help: void Start() { GameEvents.onLaunch.Add(BuildShip); } public void BuildShip(EventReport e) { AvailablePart ap = PartLoader.getPartInfoByName ("cupola"); UnityEngine.Object obj = UnityEngine.Object.Instantiate(ap.partPrefab); Part newPart = (Part)obj; newPart.gameObject.name = "cupola"; newPart.partInfo = ap; ShipConstruct newShip = new ShipConstruct("hello world", "hello world2", newPart); ShipConstruction.PutShipToGround(newShip, this.part.transform); ShipConstruction.AssembleForLaunch(newShip, "Kerbin", HighLogic.CurrentGame.flagURL, HighLogic.CurrentGame, new VesselCrewManifest()); } Running this gives me this error code at launch: [Exception]: NullReferenceException: Object reference not set to an instance of an object Part.InitializeModules () Vessel.Initialize (Boolean fromShipAssembly) ShipConstruction.AssembleForLaunch (.ShipConstruct ship, System.String landedAt, System.String flagURL, .Game sceneState, .VesselCrewManifest crewManifest) The error disappears when I remove ShipConstruction.AssembleForLaunch, but no ship appears. I printed all my instanced object, so I know everything I've meant to instance so far has been instanced.
-
Hi, I'd like some help to programmatically create a vessel with certain parts and place it at a location. Here's what I've got so far: //Using KSP class ShipConstruct, instantiate a new vessel ShipConstruct newShip = new ShipConstruct(); //Define the part to be added to the vessel. This line doesn't work. I don't know how to look up and reference Parts. Part cockpit = new BaseEventData.Get<Part> ("cupola"); //Add the above referenced part to newShip. I'm pretty sure this line will work. newShip.Add(cockpit); //Using KSP class ShipConstruction, place the vessel at the location of the part calling the instantiate method ShipConstruction.PutShipToGround(newShihp, this.transform); Thanks for the help!
-
Object Instantiation / Spawning
Ishkur replied to Ishkur's topic in KSP1 C# Plugin Development Help and Support
Ok ok, think I might be onto something now. ShipConstruct newShip = new ShipConstruct(); ShipConstruction.PutShipToGround(newShip, this.transform); So ShipConstruct and ShipConstruction are part of the KSP class library. As far as I can tell, that code instantiates a new vessel and places it at the location of the part that called the code. The problem is, the new instantiated ship has no parts, so really its just an empty vessel. I know I can add parts using ShipConstruct.Add(part), but how do I reference/find a part? -
Displaying Kerbals in IVA/EVA - Updated
Ishkur replied to Alskari's topic in KSP1 C# Plugin Development Help and Support
Sorry if I'm missing something apparent, but can't you put the hatch transform position on the inside of the module/model to get the kerbal to be placed where its needed? -
Object Instantiation / Spawning
Ishkur replied to Ishkur's topic in KSP1 C# Plugin Development Help and Support
Just an update, using part.Addmodule(module) only instantiates another script component, but not the entire part (mesh with collider and components). Basically, I'm still trying to figure this out. -
Object Instantiation / Spawning
Ishkur posted a topic in KSP1 C# Plugin Development Help and Support
Hello... again. I am trying to spawn a part in game during a mission. I am familiar with Unity's Object.Instantiate method, but using it in game doesn't yield any results: print (this.transform.position); print (this.transform.rotation); Instantiate(this.gameObject, this.transform.position, this.transform.rotation); The first two prints are working, and so I tried instantiating another copy of the part that called instantiate (mainly because I don't know how to pass the gameobject I actually want spawned into the method). Searching the forum only yielded one other thread asking the same thing. He figured it out, but didn't care to share /: -
Easier Plugin Testing In-Game
Ishkur replied to Ishkur's topic in KSP1 C# Plugin Development Help and Support
Ah I see... that's a bummer. Not sure if I'm able to do that as I got the game through Steam. Thanks for the answer! -
Hello! I'm currently testing some parts and plugins in-game. I know you can use the debug console (Alt-F12) to reload assets in the database, but how do I replace my plugin's .dll file while the game is running? When I try to do it in the windows explorer, it's stopping me because the file is in use. Currently I have to close and relaunch the game every time I build and want to test stuff. There must be an easier way?
-
Looking for event/callback
Ishkur replied to Ishkur's topic in KSP1 C# Plugin Development Help and Support
Wow, that sounds promising, though I'm still too inexperienced to use what you've told me. I'm trying to figure out how to do this object browsing in Mono. Am I supposed to be looking in a specific namespace or assembly to see what you had in your picture? -
Hello! Does anybody know how I would log an event or receive a callback upon a Kerbal being killed? Either during an EVA or in a crashed ship, but preferably both. Any and all information regarding the conditions of the death would be greatly useful also (but really interested in location of death and speed of the Kerbal on EVA or the module it was sitting in at the time of death). Would ideally by able to get the event whether the death occurred in a focused or non-focused vessel. So far, I've looked through Anatid's Documentation for the KSP API haven't found anything I could make use of...