TwistedMexi
Members-
Posts
25 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Everything posted by TwistedMexi
-
Do you feel KSP is ready for 1.0?
TwistedMexi replied to hoojiwana's topic in KSP1 Suggestions & Development Discussion
That's good to hear, but with that considered that means there's not a whole lot of reason to release immediately. If you're uncomfortable being an early access game, I can understand that. You don't have to release another Early Access version, but with as many core changes as you guys are making, isn't it fair enough to just ask for a release candidate? Give your community a week, just a week for feedback, so some bugs can get ironed out before you "go live." Without financial burden, I can't think of a good reason for you guys to not take this simple small step. It can only help. I understand you have the experimentals, which undoubtedly help, but experimentals have never stopped (all) bugs from making it to the public before. Let the community help. I don't think that's asking too much. -
Has anyone successfully used AddAttachNode? I haven't been able to find any threads detailing it. I think it's what I need - I need to be able to add a part to an existing part programmatically, so that it behaves the same as if you had attached it in VAB/SPH. I've tried just using GameDatabase.Instance.GetModel() and just setting the transform as the parent, but the part only moves when the core of the transform moves, I need to to be attached to the collider rather than the gameobject directly, if that makes sense. The point would be to automatically add the node and then attach a part to that node. So would I be able to use AddAttachNode to accomplish this, or if not - is there another way? Thanks in advance.
-
I want to keep track of a hatch's rotation, so that I can spawn a part a few inches out from it. So that no matter how the part was rotated in VAB, and/or rotated while in flight, the new part always spawns in front of the hatch. I've tried about 100 different methods and all of them break down if the ship rotates. Is there an easy way to achieve this?
-
private AvailablePart avPart = PartLoader.getPartInfoByName("partname"); This loads the part fine for use, but it's .rigidbody value is null, even after creating a Part object from it. If I try to set it to something, it tells me it's read only. Has anyone else encountered this? I need to apply a force to the rigidbody and can't because I can't seem to get around this. Thanks. Edit: Figured out I needed to do newPart.GameObject.AddComponent<Rigidbody>
-
I have a part that has a force applied to it, to fly off in a random direction. What I need help with, is how do I spawn that part mid-flight, when an existing part has been triggered? I've modified the inline clampotron part as my base model, and ideally when the bay opens, (toggle event) I want to hook into that and then spawn this part, detached from the main vessel, or in a state where I can then tell it to detach. Is there a way to do this? Thanks for any help. Edit: I've figured out how to use instantiate to spawn it, but I keep getting null reference when accessing .rigidbody of my new part.
-
[0.23] PuntJeb - Statistics for your Poor Kerbals' Souls
TwistedMexi replied to TwistedMexi's topic in KSP1 Mod Releases
Thank you! A persistent scoreboard to pit kerbal against kerbal is planned, I'm just toying with how exactly I want to implement it. -
[0.23] PuntJeb - Statistics for your Poor Kerbals' Souls
TwistedMexi replied to TwistedMexi's topic in KSP1 Mod Releases
Someone has already contacted me about almost the same thing. Since this plugin is 90% for fun, I want to keep the overhead low (Don't want people to feel like they have to choose between this and having more room for other mods). I do plan to add in a few more features, so some of what you mentioned will likely be added as optional stats. Definitely interested in the biome suggestion. I do plan to make a separate mod that will be more fleshed out, and will be more about utilities for EVA/command seat. No timeframe as my downtime often gets ran over with work. Thanks for the suggestions -
[0.23] PuntJeb - Statistics for your Poor Kerbals' Souls
TwistedMexi replied to TwistedMexi's topic in KSP1 Mod Releases
You could probably achieve this with stock, using decouplers and a few tanks with engines on them enclosed in a frame. Detach the tanks and activate the engines, then detach the last decoupler holding the kerbal's seat down. -
[0.23] PuntJeb - Statistics for your Poor Kerbals' Souls
TwistedMexi replied to TwistedMexi's topic in KSP1 Mod Releases
Thank you sir! Since I've made it, I've been trying to find new ways to sling them further. Turns out the ladder platform does wonders. -
[PuntJeb: Statistics for your Poor Kerbals' Souls] While watching KerbalKon, it was suggested in jest that a mod should be created to keep track of how far you've slammed your EVA across the surface. Honestly, I couldn't find a reason not to do it. This plugin adds a module to your EVA's that allows you to enable PuntJeb's statistics. When enabled, a window will be displayed that provides: Velocity Last punt achieved Longest punt achieved Total distance traveled since going on EVA. PuntJeb will also inform you of your last distance traveled should your Kerbal be... less than fortunate. Velocity and Total Distance will also work when in an external command seat (rovers included) and is an excellent way of seeing how much ground you've covered. [PuntJeb Trailer] I've made a small demo video for those who prefer visuals. [Download and Install] Download from SpacePort Open the zip and copy the PuntJeb folder into your game directory's "GameData" folder. The source folder doesn't not need to be installed. Once completed, simply start your game, launch a manned ship, and go on EVA. Right-click on your kerbal and press "Enable PuntJeb". Your PuntJeb tracking window will now be shown. Repeating the steps and selecting "Disable PuntJeb" will of course, hide the window. [License] You may not redistribute or modify PuntJeb and/or its source code, but you are welcome to use it as reference for learning about KSP plugins.
-
Thanks. I think if someone could explain why partmodule.OnSave() is getting called multiple times, that'd be a good starting point for me. I don't see why it should be doing that, nor do I understand why it's executing my save function when I'm in the capsule - that seems to be the main problem. EDIT: I may have figured it out. I'll post here shortly if I'm correct... Resolved I edited my original post with the explanation. Thanks.
-
Sorry, I thought I might be too vague. Activated is a boolean I've defined. I have right-click events on the part that toggle (For example: Right-click kerbal, Select "Enable": Activated = true; || Right-click kerbal again, Select "Disable": Activated = false;) OnGui() only draws the window if activated is true. So I'm trying to save activated to file, and load it from file. (if the GUI was active the last time the game saved, then when you reload it, the GUI should start active). EDIT: Also here's the code for config: PluginConfiguration config = PluginConfiguration.CreateForType<Pluginname>();
-
EDIT: I wasn't factoring in that the OnSave() gets called for every ship that's loaded. I had to put a check for ActiveVessel in the OnSave() method. The other kerbals nearby were overriding the value. Thanks. I have a simple OnSave() and OnLoad() for my partmodule, as seen below. The partmodule is attached to a kerbal, and so only active on kerbals. The print() shows up in the console 4 times (3 times false and the last time true) when I quicksave on EVA. If I put the kerbal in a capsule and quicksave, The print() still shows up, 4 times, but all false - I never set the activated Boolean to false though. Can anyone tell me why my code behaving this way? public override void OnSave(ConfigNode node) { config.SetValue("Window Position", _windowPosition); print("Just saved: " + activated); config.SetValue("Activated", activated); config.save(); } public override void OnLoad(ConfigNode node) { config.load(); _windowPosition = config.GetValue<Rect>("Window Position"); activated = config.GetValue<Boolean>("Activated"); }
-
Detecting if an EVA is using RCS?
TwistedMexi replied to TwistedMexi's topic in KSP1 C# Plugin Development Help and Support
I actually found out later that I was going about it wrong, and I should have checked the kerbalEVA component for .isRagdoll I'll keep this for reference. Thanks -
I need to do a check to see if RCS thrusters are currently on for the active EVA. I've tried checking vessel.IsControllable but it seems to stay true even when they're tumbling, and even if it did work, I would still need to know when they're controllable but not using thrusters. Is there a way to check that? If not, maybe a way to check if the EVA's fuel is going lower? Any assistance is appreciated. Thanks.
-
I followed a video tutorial for KSP to get familiar with the basic setup. It said the initial GUI gets called at OnDraw() and I use that for centering the window initially. I also have this: public override void OnStart(StartState state) { if (state != StartState.Editor) { if (!_hasInitStyles) InitStyles(); RenderingManager.AddToPostDrawQueue(0, OnDraw); } } Do I not need OnDraw, and if that's the case, should RenderingManager.AddToPostDrawQueue(0, OnDraw); be RenderingManager.AddToPostDrawQueue(0, OnGui);?
-
Got it! Thanks for the help. Your code seemed off to me, but I was able to figure out what you meant. This is working code, for anyone else's reference. It seems really ineffective to redraw every time like that, but I guess I just need to get used to Unity. public void OnGui() { if (this.vessel == FlightGlobals.ActiveVessel && this.part.IsPrimary(this.vessel.parts, this.ClassID)) { _windowPosition = GUILayout.Window(10, _windowPosition, OnWindow, "This is my Plugin Title", _windowStyle); } } private void OnDraw() { if (this.vessel == FlightGlobals.ActiveVessel && this.part.IsPrimary(this.vessel.parts, this.ClassID)) { _windowPosition = GUILayout.Window(10, _windowPosition, OnWindow, "This is my Plugin Title", _windowStyle); if (_windowPosition.x == 0f && _windowPosition.y == 0f) _windowPosition = _windowPosition.CenterScreen(); } } private void OnWindow(int windowId) { GUILayout.BeginHorizontal(GUILayout.Width(250f)); GUILayout.Label(velocity, _labelStyle); GUILayout.EndHorizontal(); GUI.DragWindow(); }
-
I thought so, but it doesn't seem to update for me. Do I call OnGui() when I want it to update, or does it get called already? I've tried it both ways, but the label in the window stays on "This is a label." I'm used to just doing something like labelname.Text = stringvariable, so I'm unsure of how to specify this label specifically. That may be part of my problem. This is what I have for OnGUI(), OnDraw(), and OnWindow() Velocity is of course a string. public void OnGui() { GUI.Label(_windowPosition, velocity); } private void OnDraw() { if (this.vessel == FlightGlobals.ActiveVessel && this.part.IsPrimary(this.vessel.parts, this.ClassID)) { _windowPosition = GUILayout.Window(10, _windowPosition, OnWindow, "This is my Plugin Title", _windowStyle); if (_windowPosition.x == 0f && _windowPosition.y == 0f) _windowPosition = _windowPosition.CenterScreen(); } } private void OnWindow(int windowId) { GUILayout.BeginHorizontal(GUILayout.Width(250f)); GUILayout.Label("This is a label.", _labelStyle); GUILayout.EndHorizontal(); GUI.DragWindow(); }
-
I've been learning KSP plugins mostly by trial and error, but two things I can't figure out are... 1. [Edit: I was trying to figure out how to hide parts, when I really just needed to delete the part folder. Realized after I posted.] 2. How do I update a GUI window's label during flight? I keep getting errors saying I'm not on the GUI thread but I have no idea where it should be updating from, right now it's using the OnUpdate() method. Thanks in advance.
-
In persistent.sfs, there's a block after each vessel for the action groups, as seen below. My question is, what exactly do the numbers indicate? Is there any way to pull what the actiongroup does from these numbers? I can't find the link. Thanks in advance. ACTIONGROUPS { Stage = True, 1558297.29574396 Gear = True, 465496.786323706 Light = False, 1601905.85618321 RCS = False, 0 SAS = True, 1559011.77574463 Brakes = True, 1559007.17574463 Abort = False, 0 Custom01 = False, 0 Custom02 = False, 0 Custom03 = False, 0 Custom04 = False, 0 Custom05 = False, 0 Custom06 = False, 0 Custom07 = False, 0 Custom08 = False, 0 Custom09 = True, 1558340.995744 Custom10 = True, 1558404.29574406 }