Jump to content

Grimly

Members
  • Posts

    8
  • Joined

  • Last visited

Reputation

0 Neutral

Profile Information

  • About me
    Bottle Rocketeer
  1. Here I am again and I can't find a good way yet to make my plugin work. I've managed, looking at different plugins such as module manager, tree toppler and tree loader, to come to this instance of my module : http://paste.ubuntu.com/11922597/ It is installed with ModuleManager and the following patch : http://paste.ubuntu.com/11922606/ The file GameData/Squad/PartList/SimpleIcons/R&D_node_icon_end.png is a copy of GameData/Squad/PartList/SimpleIcons/R&D_node_icon_start.png This plugin changes the icon displayed at the top right part of the screen when I select the new R&D node (and here I found out it's ugly, it needs double the resolution) but fails at changing the display on the R&D tree. Here are some logs produced by my plugin : http://paste.ubuntu.com/11922640/ The initial proposal from sarbian had either no effect or something needs an update and I have no clue about what to update. I'll accept any piece of help Thanks.
  2. Hi. So that means we require a plugin to add an icon ? Sounds like a good exercice to make a KSP plugin. Thanks for the answer.
  3. Hello, The tool I present here is nothing an average player may be looking for, this is more for tool developpers. In order to learn how do parsers work, I made myself a LL(1) parser for KSP config files. The parser has been written in Javascript and so the analysed tree is in JSON. Here is the application : https://output.jsbin.com/wudife ( source : https://output.jsbin.com/wudife/edit?html,css,js ) Warning : It's not pretty and I'm not making it pretty. Drop a CFG file (or save file as it has the same format) and it will give you back a JSON file. If I have to give a licence to my parser, then consider it has the WTFPL ( http://www.wtfpl.net/txt/copying/ ). If in a console (hit F12 on your browser) you type the following command, you will find all the building blocs I used and maybe understand all about how the parser was made. Array.prototype.forEach.call(document.querySelectorAll('pre, table'), function(p) { p.style.display = 'block' }); You are free to reuse the javascript parser. I made it easy enough so you just need to build the syntaxical analyzer and make it parse your string : tree = CFGAnalyzer().fullParse(content); This may help web developpers to build applications around a config or save file with more ease as the parsed object is now accessible. Grimly
  4. Hello, I'm looking for what, in the game, links together the "icon" value of a RDNode to the real icon. TechTree{ RDNode { id = start title = Start description = The technology we started out with. cost = 0 hideEmpty = False nodeName = node0_start anyToUnlock = False icon = RDicon_start <=== How does it match "R&D_node_icon_start.png" ??? pos = -2568,1199,-1 scale = 0.6 } I've found that this value is not a filename, because even if it is close for some of them, you cannot achieve the match from the value to the images stored into GameData/Squad/PartList/SimpleIcons through a simple transformation. A simple example that made me first think the icon is the filename is the "Science Tech" node that uses the last icon file (by alphabetic order) RDicon_telescope.png It matches the "icon" value as "RDicon_telescope". I expected then it was the filename without its expansion. Then I realized that some "R&D_node_icon_*" files requires that "R&D_node_icon_*" part to be replaced to "RDicon_*". Finally I came to the "Basic Rocketry" tech node (the first in the config not to fit my rules) and the transformation is not trivial at all. You cannot, by general operation on strings, go from "RDicon_rocketry-basic" to "R&D_node_icon_basicrocketry.png". There must then be some kind of database that makes these matches. But I can't find where. I know it's not in any .cfg file but that's all I know. Adding a node with a matching "icon" value and filename doesn't help, it changes the display to "R&D_node_icon_generic.png" Does someone knows how to add a new icon into the tech tree ? Thanks
  5. Of course you can if you go with intermediate steps : MODULE { name = area value=#$../MODULE[radius]/value$ @value*=#$../MODULE[radius]/value$ @value*=#$../MODULE[pi]/value$ }
  6. Hmmm this may be a stupid question but well : How are we supposed to harvest Karborundum this close to the sun if close to no game object (collectors and tanks included) can handle the heat of the sun ? I still have to try the Starflier as most of the components are 3400°C heat resistant but it doesn't look like the sun is harvestable anymore. Or maybe disable its heat, is it just possible ?
  7. I could guess the volume of a tank from its current then run through all ressources and add all of them with calculations based on density. I made my own rules for my own setup, it let me have one tank full of LF and an other full of Ox and still have the same ratio. If you want such complicated calculations you may be interested into Modular Fuel Tanks mod. It does the job for you with all resources. No harm in this, I'm taking all good pratices I can to help not messing up my patches or later have a mod that conflicts with mine. By the way, is there a way to test a patch just like the test cases I could find on github ? ( I'm an other guy that know nothing of C# ) I know the patch task is fast but having to load the entire Unity engine is a pain even with 3/4 of stock parts removed. I can later provide my tests if you want some non-regression testing.
  8. Hi everyone, I'm trying to do this task with a module manager patch : For all tanks with LFO : - Add the firespitter "FSfuelSwitch" module with the given 3 options - LFO (unchanged) - LF Only (twice the amount of LF from LFO mode) - Ox Only (twice the amount of Ox from LFO mode) - Remove the old resources as they are replaced by firespitter I was kinda pleased with the following patch (it's not balanced yet and makes all tanks available at start so I could check them fast in game) : http://paste.ubuntu.com/11359289/ In the patched version of the game configuration (I'm looking at the ConfigCache file), I can find my variables in the module instance (you may check this result for the Kerbodyne S3-14400 Tank : http://paste.ubuntu.com/11359383/ ) Is there a way to prevent this "pollution" ? Is there a way to use formulas in a patch file ? This patch is not an original idea as it is just a try to make the "Stock Fuel Switch" mod apply to all possible tanks.
×
×
  • Create New...