-
Posts
216 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Everything posted by Aniruddh
-
[1.8-1.11.x] Beamed Power Standalone (and Propulsion), v1.1.0
Aniruddh replied to Aniruddh's topic in KSP1 Mod Development
I can edit the poll to make it let you choose multiple choices, if that's what you want. Yes, I will implement this at some point, but currently there are some serious bugs I need to fix and more important features to add into the plugin which take priority. It's technically a pre-release atm. For the first point, either you are talking about photon sails or beamed power thermal rockets, both of which are in KSPIE and work well, the latter of which I will add to this mod as well. The propulsion concept that uses ablation for thrust is a good idea I'm thinking of implementing, although it won't be particularly good gameplay wise (you'd need a lot of power beamed and converted to heat to make this worthwhile, may even be impractical, will do some further research into this). -
[1.8-1.11.x] Beamed Power Standalone (and Propulsion), v1.1.0
Aniruddh replied to Aniruddh's topic in KSP1 Mod Development
Oh, I misunderstood, I though you were asking for it to check when a warp-drive module is engaged, and then turn off the receiver/transmitter when that occurs. Turns out you just want it to check whether the vessel has exceeded speed c. The latter is much easier to implement! For jump-gates, according to your description, the same method can be used as the one for warp-drives, or it can check for a scene switch. I'll definitely be implementing the warp-drives part, but it may take a while longer to implement as satisfactory version that works for jump-gates. Notice: Also, a notice for everyone, v0.2.0 and 0.1.0 both have errors if the receiver goes beyond 2.3 km from the source, the game will throw null-reference exception and the modules will stop working. This means I highly recommend waiting till v0.3.0, where I hopefully can fix this error. I asked how to make KSPField attributes work beyond 2.3 km here: If anyone has any ideas, post in that thread, in the mean time I'm trying to find solutions myself. Bare in mind, I'm a complete newbie at writing plugins for ksp, but have lots of free time to spend learning this stuff. EDIT: The thread's topic has been changed, as I gave up on trying to work on making KSPField variables accessible beyond 2.3 km. -
[1.8-1.11.x] Beamed Power Standalone (and Propulsion), v1.1.0
Aniruddh replied to Aniruddh's topic in KSP1 Mod Development
For the first point, I like the suggestion. It would take a bit of time, as every warp drive mod has slightly different code. This isn't a priority, only once I get this mod out of alpha will I add that. Should I also add red-shift/blue-shift for vessels not using warp-drive but travelling near speed of light? For the second point, I have no clue what a "jump gate" is, I've studied a lot about Alcubierre warp-drives and how they could work, but I don't know the physics for that kind of thing. Is it like a wormhole in any way? -
Nevermind, I gave up on KSPField and decided to store the values in a config node. The config node part is working, but I can't load config nodes from a file on disk. I've looked at this thread on how to do this: Every time the game loads the config node from the file, the game throws null-reference exceptions as it can't retrieve the config nodes from that file, and thus the config node is never initialised. My method: public void SaveNode() { string filepath = KSPUtil.ApplicationRootPath + "GameData/BeamedPowerStandalone/PluginData/save.cfg"; FileInfo info = new FileInfo(filepath); ConfigNode BPNode; if (info.Length > 0) // modify later { BPNode = ConfigNode.Load(KSPUtil.ApplicationRootPath + "GameData/BeamedPowerStandalone/PluginData/save.cfg"); } else { BPNode = new ConfigNode(); } string vesselId = Convert.ToString(this.vessel.persistentId); int n2 = 0; while (n2 < BPNode.nodes.Count) { if (BPNode.nodes[n2].GetValue("persistentId") == vesselId) { break; } n2 += 1; } ConfigNode CorrectNode = new ConfigNode(); if (n2 == BPNode.nodes.Count) { BPNode.AddNode("VESSEL", CorrectNode); } else { CorrectNode = BPNode.nodes[n2]; } CorrectNode.SetValue("persistentId", vesselId, createIfNotFound: true); CorrectNode.SetValue("wavelength", Wavelength, createIfNotFound: true); CorrectNode.SetValue("excess", excess, createIfNotFound: true); CorrectNode.SetValue("constant", constant, createIfNotFound: true); BPNode.Save(KSPUtil.ApplicationRootPath + "GameData/BeamedPowerStandalone/PluginData/save.cfg"); //Saves the confignode to disk. } save.cfg is a config file in the given directory. Any help on this is appreciated. Thanks in advance.
-
[1.8-1.11.x] Beamed Power Standalone (and Propulsion), v1.1.0
Aniruddh replied to Aniruddh's topic in KSP1 Mod Development
Sort of : The power beamed and power received are saved to either save file or are in memory, so they are persistent and work in the background. However, eg. if your base has a nuclear reactor, and it runs out of fuel, any receiver will continue receiving power from the base until you switch back to the base. It's a limitation at the moment, but it could be fixed, I and many other modders are looking into it. Also, does anyone know if CommNet occlusion works if the occluding body is outside the local SOI? I haven't noticed it myself when playing. Looking at SQUAD's implementation of occluder horizon culling, it seems very likely it is limited things in the local SOI, unless there is extra code internally. -
[1.8-1.11.x] Beamed Power Standalone (and Propulsion), v1.1.0
Aniruddh replied to Aniruddh's topic in KSP1 Mod Development
I could add a part module that does that, once I figure out the stock (and system heat) heat mechanics. I could take that value and convert it to thrust and isp Although the math could get complicated, certainly is not impossible to implement. I assume thermally powered engines would get lower isp but higher thrust than electric (ion) engines. -
[1.8-1.11.x] Beamed Power Standalone (and Propulsion), v1.1.0
Aniruddh replied to Aniruddh's topic in KSP1 Mod Development
The plugin makes the receiver spacecraft generate EC, so I though everyone could just use that EC to power plasma engines in mods like Near Future Propulsion. Whenever I get better at part modelling, I could implement the electricity driven turbo jet idea. The EC could come from the beamed power transmitters. I haven't seen that in any mods so far. -
[1.8-1.11.x] Beamed Power Standalone (and Propulsion), v1.1.0
Aniruddh replied to Aniruddh's topic in KSP1 Mod Development
Okay I finished the next update, and it is released on GitHub and Spacedock. The update is not as ambitious as I wanted it- I was planning to add the CommNet Occlusion features, but the occluderhorizonculling function makes FlightGlobals.Vessels list return nothing. I don't why it's doing that. Also, I can't figure out how to update invRotation, as said on the API. That feature is delayed for now. Read the end of the OP for changelog and further details. -
[1.8-1.11.x] Beamed Power Standalone (and Propulsion), v1.1.0
Aniruddh replied to Aniruddh's topic in KSP1 Mod Development
Exactly! And yup, I use Heat Control myself, whenever I get around to adding heat mechanics I will look at that mod's source. I guess a quarter of the progress minimum I've made is through looking at other modders' work. KSP's API is rather low detail, I believe there was a community made API a while back, but the link to the site no longer works. -
[1.8-1.11.x] Beamed Power Standalone (and Propulsion), v1.1.0
Aniruddh replied to Aniruddh's topic in KSP1 Mod Development
The only reason efficiency is there is to provide a drawback for using beamed power for the player. 100% efficiency would mean for short distances, it would be perfect and in my opinion, a little bit cheating. I currently am thinking not to add heat mechanics based on efficiency though, so that's where it may differ from KSPIE. Yup, acknowledged, quite easy to do, added this to my to-do list. My decision will mostly be based on the poll. I understand why you want simplicity, but I think it's rewarding gameplay wise- 'long' wavelength great for short ranges, 'short' wavelengths for long ranges. It makes the user think of compromises and make decisions. I'll add that option to the poll. I was literally going to do that today, google drive is very inconvenient anyways. EDIT: Added GitHub link for source code. -
[1.8-1.11.x] Beamed Power Standalone (and Propulsion), v1.1.0
Aniruddh replied to Aniruddh's topic in KSP1 Mod Development
I will release another version tomorrow which should hopefully add another 5% to that. The idea of this plugin is to not make other modders worry about the code, I have 8 hours a day to spend on this project for the next 2 weeks, so will happily add stuff to it myself. -
[1.8-1.11.x] Beamed Power Standalone (and Propulsion), v1.1.0
Aniruddh replied to Aniruddh's topic in KSP1 Mod Development
That's exactly the parts I was thinking of! Nertea's artstyle is far better than anything I could produce, and NFeX has beautiful part models/textures I did download blender the other day, and the best I could make was yet another cylindrical fuel tank, so yeah. -
Introduction: This is an add-on that adds beamed power parts and modules to the stock game. In this case 'beamed power' just means the wireless transfer of electric-charge between two vessels over a long range. This is achieved by converting the electrical energy into electromagnetic waves (photons) which can travel through a vacuum. These waves are picked up at the other end by a receiver which converts the waves back into electric-charge. The mod also provides engines that can pick up the waves and convert their energy into thermal energy, which can heat the propellant and expel it to produce thrust. This is the idea behind beamed power propulsion. Some background on this mod's development: A while back I wanted a standalone version of beamed power in a mod as I was hesitant in using KSP Interstellar extended. I asked on the forums for help on learning KSPIE as I was told it was the only option. Some great people on the forums helped me learn it and I got the hang of it. All this effort was wasted by the fact that I couldn't use it in my existing save file using NFT and FFT. It does work with those mods, but changes gameplay drastically so most of my vessels were useless. 7 months later, I decided to write a plugin myself and this is that. This is a mod that adds Beamed Power code to the stock game, the plugin is written from scratch, as I wanted to learn how to write plugins in ksp and this was a great learning experience. 4 weeks after the initial release, I also started to learn modelling and texturing in Blender, and now (22nd Sept) the parts I made have reached a state I'm satisfied with, and are now part of the mod. Treat these parts as examples, they aren't perfect yet. How it works: There are currently three part modules this adds that you can use for beamed power in the core mod: WirelessSource, WirelessReceiver and WirelessReflector. At the moment, you'll have to add these part modules to any part you want to use for beamed power. Instructions for how to do that: WirelessSource: WirelessReceiver: WirelessReflector: Optional Extra Part Modules: Download (Spacedock or GitHub): https://spacedock.info/mod/2492/Beamed Power Plugin https://github.com/AniruddhKSP/KSP-Beamed-Power-Standalone-mod/releases Source Code (GitHub): https://github.com/AniruddhKSP/KSP-Beamed-Power-Standalone-mod Unity Project File for parts (Google-Drive): https://drive.google.com/drive/folders/1ogeYe_x4FzYddjxvFiJeQDCqxE_WgStH?usp=sharing Other Info: The plugin and all art assets and configs by me (@Aniruddh) are licensed into the Public Domain, do whatever you like with it! This mod depends on Module Manager! If this isn't installed, other mods can't be supported, and you may also see lots of errors in the log and console. Currently, the following parts are available in the mod: - BP-TE "Unradioactive" Thermal Engine - BP-541L "Starshot" Photon-Sail - BP-AE "Sublimation" Ablative-Engine - BP-T1 "Microwaving" Power Transmitter Unity project files for the parts are on the google drive link above, I couldn't upload to GitHub due to file number restrictions. I'm sharing this so others can use this without starting from scratch, and some can also provide more detailed feedback on the parts. Module-Manager patches to add support to existing parts are welcome, if anyone wants to contribute. I'm completely open to suggestions and feature requests at this stage. I'd highly recommend using the following mods alongside this one: - CryoTanks - Waterfall - Near Future Exploration What this plugin won't do: - Add full realism, (eg. efficiency curves for adjusting wavelength) - Add dedicated UI to stock toolbar, the right click menu is good enough. My current To-do List: - Parts (currently got transmitter dish and reflector left to do) - Fix limitation of receivers not distinguishing two transmitters with same name - Background vessel resource processing - Kerbal Konstructs power plants and beamed-power transmitters Differences with KSPIE: - Receiver doesn't have to point in the right direction towards transmitter, similar to stock CommNet. - A transmitter can only ever beam in one wavelength. To beam power in a different wavelength, you need a different part. Possible FAQs: 1) The transmitter/receiver turns off immediately after I turn it on, why is that? It is either because the part is beyond its core/skin temperature limits, it is retracted (if it is deployable), or the craft it is on isn't generating enough power/batteries are drained. 2) The ablative engine and photon sail are getting too little thrust / no thrust. These two are direction-dependent, make sure the vessel is facing the right way (away from the transmitter). Thrust is scaled based on the angle between the two. 3) The receiver isn't getting any power even though it says it is receiving from the right vessel. Make sure you switch to the transmitter vessel, and cycle through receiver vessels, until 'Transmitting to:' shows the name of the receiving vessel. 4) How to get more wavelength options/ more realistic wavelengths, e.g. Gamma-Rays? If you are doing a manual install, first delete the two .dlls in the plugins folder in the main mod directory, then drag the two .dlls in the Extras folder (these have RW at the ends of their names) into the plugins folder in the main directory. Move the main directory (under GameData) into your GameData folder. If installing through CKAN, just select the 'Beamed Power Standalone - Realistic Wavelengths' option, and CKAN should do the rest. Pictures: All Screenshots Thanks for reading this far down the page! Happy launchings, (and landings) Latest Major Version (25th Dec) changes (1.1.0): Updated for 1.11.x Added a silver variant to "Starshot" photon-sail. Fixed a graphical glitch on thermal-engine's mount when highlighted. Added a transmitter dish part (5m). Improved Wireless-Reflector part module, now the on/off toggle button actually works! Fixed Localization issues. Improved performance when using reflectors. Fixed a bug where a reflector could reflect power to itself. Prevented NREs on wireless-reflector when no transmitter is present. Background resource processing reduces framerates immensely, so I'd recommend not using it for now. There is still the limitation- don't name two transmitter vessels with the exact same name, or the receiver will only detect one of them. This is due to an issue with vessel ids in the game. A workaround is hopefully coming for this limitation.
-
I'm running into an issue, same plugin as above, with this part of the code: public void OnLoad() { if (CorrectVesselList.Count > 0) { excessList.Clear(); constantList.Clear(); CorrectVesselList.Clear(); } for (int x = 0; x < FlightGlobals.Vessels.Count; x++) { for (int y = 0; y < FlightGlobals.Vessels[x].Parts.Count; y++) { if (FlightGlobals.Vessels[x].Parts[y].Modules.Contains<WirelessSource>() == true) { CorrectVesselList.Add(FlightGlobals.Vessels[x]); double excess1 = (double)FlightGlobals.Vessels[x].Parts[y].Modules.GetModule<WirelessSource>().Fields.GetValue("excess"); double constant1 = (double)FlightGlobals.Vessels[x].Parts[y].Modules.GetModule<WirelessSource>().Fields.GetValue("constant"); excessList.Add(excess1); constantList.Add(constant1); break; } } } } It basically gets all vessels in the current save file that have a part that has the WirelessSource part module. For some reason the CorrectVessel List has no elements in it, and any debugging I try to do returns nothing. EDIT: Stupid me is trying to cast an object to double, never do this, I instead used Convert.ToDouble (object Obj), and that worked!!!
-
How do I get a list of all vessels in the current save file, active or not. I tried FlightGlobals.Vessels, but FlightGlobals.Vessels.Count always returns 0, implying there are no vessels even though there should be 2 vessels. Is that a bug in the stock game or is that an incorrect method? I'm running 1.10.1.
-
how to create custom manufacture
Aniruddh replied to cukkoo's topic in KSP1 C# Plugin Development Help and Support
Do you mean agents? Because manufacturers don't have logos, you can just add their name to the relevant part.cfg where it says 'manufacturer = '.