Jump to content

Codapop

Members
  • Posts

    76
  • Joined

  • Last visited

Posts posted by Codapop

  1. On 4/3/2022 at 7:23 AM, Manul said:

    It's not a bug, 0-9 keyboard keys are now assigned to AGE action groups. Stock AGs assigned to joystick/ECS buttons work as usually.

    It turns out the bug is due to incompatibility with KSP 1.12.2, but 1.12.3 is fine.

     

    However, I've encountered another bug where action groups take two presses to turn off the first time they are assigned. Either pressing the keyboard or clicking the box result in the same issue. After that they function properly.

     

    Logs: https://drive.google.com/file/d/146nzd8bRZGG7ocI8fytqEOsocRBXGjFO/view?usp=sharing

  2. I'm getting a bug that seems to prevent me from using normal action groups when I have AGExt installed.

    Logs: https://drive.google.com/file/d/146nzd8bRZGG7ocI8fytqEOsocRBXGjFO/view?usp=sharing

     

    I build a craft, add the engine to AG 1, put it on the pad, and try pressing 1 on my keyboard, but nothing happens. The action group works when AGExt is not installed. KSP version 1.12.2, AGExt, latest (2.4.1.1).

  3. On 6/7/2021 at 6:47 PM, MoeKitsune said:

    How well does this mod work with tech tree mods such as CTT and Kiwi Tech Tree?

    The mod works with them, but the "Science Colors" config pack that is included in the download is not configured for non-stock tech trees. Using the config editing method I outlined above, you would have to edit the config files and make it compatible with CTT or others.

  4. On 5/30/2021 at 5:33 AM, Donchielo said:

    Thanks, I guessed that, is it possible to use the same method for contracts? I mean I'm currently working  on a gameplay mod with a bunch of different mods, and I want to make contracts. Is it possible to award custom science directly or indirectly by the method of ID?  

    With the current code, I'm actually not sure, and it depends heavily on what the name of the science is when it is awarded. I believe it always shows up in the debug log (alt + F12) so you can try completing a contract and see what gets logged. Then you can pick some keywords from that log to use for the science types. As for awarding directly, it would require a lot of rewriting.

    Something to keep in mind, it is possible to be relatively sneaky with your ID names, such as "high" would result in all "space high over X" being that color, but also every "highlands" science would also qualify. To get around this you can use "high " with a space after it, and it will exclude "highlands". Sorry I can't be much more of a help, but it's difficult to know exactly what you're trying to do. Perhaps one of these days I'll look deeper into contract mechanics if I want to go for a v1.0 release.

  5. On 5/24/2021 at 5:31 PM, Donchielo said:

    Hi, 

    I'm trying to use and modify the config file, but it doesn't seem to work properly. 

    Science+
    {
        BLUE
        {
            type = Blue
            id = Kerbin
            id = Baikerbanur LaunchPad
            id = Island Airfield
            id = Woomerang Launch Site
            id = Administration
            id = Astronaut Complex
            id = Crawlerway
            id = Flag Pole
            id = LaunchPad
            id = Mission Control
            id = R&D
            id = Runway
            id = SPH
            id = Tracking Station
            id = VAB
            
        }
        ORANGE
        {
            type = Orange
            id = Mun
            id = Minmus
        }
        YELLOW
        {
            type = Yellow
            id = space high Sun
            id = space high Duna
            id = space high Eve
            id = space low Duna
            id = space low Eve
            
        }
    }

    this is what i made so far, but Yellow science doesn't seem to work properly. It puts science either in orange or blue science. 

    Any idea why? 

    Thanks in advance. 

    Unfortunately the ID strings have to be exact, as the mod isn't "smart" enough to parse the words from your ID, so "EVA report from space high above Duna" doesn't match "space high Duna" because "above" is in the middle. You could potentially add 'above' (or 'over') to each one and that might fix it, but if not then you'll need to grab the exact text of the science experiment from either the game or the wiki.

  6. I have confirmed that the mod works as intended on 1.11.1 and works with ScienceAlert ReAlert. Would you be able to send me your log file? You could also try removing CTT/Contract Configurator and maybe ScienceAlert one by one and see if it fixes it.

    On that note, the mod doesn't currently work with CTT, but not for the same reason as your issue. The R&D nodes are different between CTT and the stock tech tree, so the colors won't line up and some tech nodes will be unresearchable unless you edit the Science+TechTree.cfg file in the SciencePlus folder to include them. You would just need to add "@RDNode,XX" to the end of the list until you reached the number of tech nodes in CTT. You'd probably also want to do a bit of reorganizing of the colors for game balance, but it's not necessary and would work fine without.

  7. On 3/29/2021 at 11:23 PM, 256 said:

    Okay, so I've installed this mod and I'm having a major bug where my Science plus science total are only showing the totals from my most recent launch. So, for example, I've got 26 science (and it shows that in the stock science display), but science plus only shows that I have 4.5 blue science and 1.4 gold science, so I'm still unable to unlock even the first node. If I do another launch and get an EVA report from another part of KSC, then my total science goes up but now I have 1.4 purple science and NO science of any other colours.

    Am I the only one experiencing this?

    Ver. 1.11.1.3066.

    Mods:

    USI MKS/LS

    CTT

    ScienceAlert ReAlert

    Kerbal Engineer Redux

    Kerbal Alarm Clock

    Contract Configurator

    Visual Mods (EVE, Scatterer)

    Apologies for the late reply. I'll try to recreate the bug and see if I can figure it out.

  8. 16 hours ago, fatcargo said:

    So, this mod can separate science points into types that can be later expended on specific nodes in tech tree...

    Could tech tree nodes be separated completely from main tech tree, in their own root nodes ? Yes, it would make them unresearchable from default research root, but with some additional code those could be unlocked and allow further research as expected.

    I believe that is possible even just by editing the TechTree.cfg file or making a clever ModuleManager patch (or at least that could handle 95% of the work). I'd be able to do it fairly easily, if a bit messy, but I'm not sure if it'd be included in the Science+ main mod or if it'd be a smaller companion mod.

     

    16 hours ago, fatcargo said:

    If managed by mod, any bugs can be compensated for.

    So, completely separate tech trees can be a thing in KSP.

    Like geology, general phyiscs, structural engineering, fluid dynamics,  biology,  psychology, nanotech etc ...

    I'm hinting at the idea replacing current science system to prevent investing science in one branch to be used in another, keeping unrelated fields of study separate.

    One more thing : how are science points being kept separate by type, from generating by the science part to the last step when utilized in tech tree ?

    My mod pretty much accomplishes that already, as the final 3 or 4 nodes of each tech branch require the unique science types that can't be found on Kerbin. All of these parameters can be edited using the config files, so accomplishing your goal can be done entirely using this mod (and its config files) and ModuleManager (if you wish to build your own Tech Tree and distribute it).

    How the mod handles science types:

    1. Science types are detected in the config files and are then built into the persistent.sfs in your save file. You can make as many science types as you want.

    2. Every time science is gained in KSP, the name of the science will be compared with the "id" of the science types in the config files. So if the science name is "Mystery Goo while flying over Kerbin's shores" then it will try to match any part of that with any of the IDs in the config files. In the case of the config files that I included, it sees that "Kerbin" is in both the science name and the id for Blue Science. You can use any part of the science name as your ID, so if you wanted to change that to "Mystery", then it would give Blue Science every time you received science from the Mystery Goo experiment (or any experiment with 'mystery' in the name). And if you change "Blue" to "Nuclear Physics" then you will get "Nuclear Physics Science" every time you receive science from the Mystery Goo experiment. Then this science value is saved in the persistent.sfs file.

    3. When you open the RnD Facility, it looks in the TechTree.cfg file and finds nodes with the new parameter "scitype". This is where ModuleManager comes in handy, because ModuleManager can look at the Science+ config files and edit the TechTree.cfg file to include the scitypes to each node. RDNode,1 is the 2nd node (1st is the default start node) and RDNode,2 is the 3rd node, etc. You can edit these to include your new Science Types by changing/adding/removing the "scitypes" parameters to include the science types that you want to add to the game. The mod will then add these science types to the "Research" button for the tech node.

    4. When you click "Research" for a tech node, the mod will determine if you have enough of that science type to afford the node, and if you do it will subtract that amount from the persistent.sfs file.

  9. 7 hours ago, Morphisor said:

    While an interesting concept, to me requiring locations for specific types of science doesn't make the most sense. It may also be very limiting for certain playstyles. Instead I would suggest to consider coupling the science types to experiment types. This way you could advance structural knowledge by performing materials science and surface samples, for example. Gravitational studies, geophysics, radiation... all could be their own branch.

    That's possible with this mod with only a bit of config node writing, and it could add to immersion without adding much difficulty, as most players I've seen usually outfit each craft with a full suite of science experiments. In that case the science counts would always be a ratio of how much each experiment is worth. However, adding immersion is always a good thing. My Science Colors implementation was specifically designed as a difficulty mod to push players into leaving the Kerbin system earlier than is typical (while still remaining possible without advanced techniques). It's definitely not for everyone, and I wouldn't recommend it for beginners, much like I wouldn't recommend life support mods or similar.

  10. 13 hours ago, OrbitalManeuvers said:

    I'm unclear about the connection between colors and locations. If I know a color that I need for a tree node, how do I figure out what I need to do to get that color?

    I sorta intended the player to explore and find out, though you could always look in the config files. Since the mod allows other modders to create their own config files, it wouldn't be easy to have an in-game chart or something, and it would be up to each modder to decide to add an explanation to their download or to make it intuitive enough to understand on its own. In the case of my Science Colors configs, it should become apparent which color science comes from where after sending out a few interplanetary probes.

     

     

    13 hours ago, Misguided Kerbal said:

    This is a very cool concept, though I'd like to suggest these bodies for the corresponding science:

     

    Gold Science (Why not give the sun gold?) :

     - Kerbol

     

    Green Science (Perhaps bodies with life/biology? Dunno.) :

    - Kerbin

    - Laythe

     

    Silver Science (Boring vacuum bodies)

    - Mun

    - Ike

    - Dres

     

    Red Science (Small, hot bodies perhaps?)

    - Moho

     

    Purple Science (Just Eve)

    - Eve

     

    Yellow Science (Small, asteroid-y bodies)

    - Asteroids

    - Minmus

    - Bop

    - Gilly

    - Pol

     

    Blue Science (Ice is a factor, perhaps? Like the could-be-habitable-barely bodies)

    - Duna

    - Vall

    - Eeloo

     

    Orange Science (Hard-to-get-to bodies)

    - Jool

    - Tylo

     

    I think that in this way, we can classify the bodies according to science type. Orange and Purple science would be end-game science, which would unlock the tech tree. Though this got me thinking, what about expanding it? Instead of colored science, we could have Geology, Biology, etc, etc. Since we already have specialized scanners, that could be interesting. You would require points of all types of science to unlock a node.

    Indeed these were all considerations I made, and in the end I decided on the current config based on how much science there was available for each celestial body and how difficult it is to get to each one. Each color has an easy and a hard way to attain it, and generally the easy way has less science and the hard way has more for the later tech nodes that cost 550 or 1000.

    Regarding your idea for Geology/Biology/etc, that's certainly possible with this mod, and I decided to leave that up to other modders to create to focus on their own implementations and consider things like gameplay and balance. You can take a crack at it if you want, and it should be quite easy to do using the config files, even if you don't have any modding experience.

  11. 4 hours ago, majNUN said:

    I've never played Factorio. So what does this mod really add to the game? What's so special about colours? Some examples would be nice.

     

    The mod isn't really attached to Factorio at all other than to provide inspiration for my work, so no need to have experience with it. I've attached screenshots and examples in the main post as well as in the spoiler below.

     

    In-Game Screenshots (using Science Colors included with the download)

    Spoiler

    Science gained after the first mission: 10.5 Blue Science for the two experiments from Kerbin and 5 Orange Science which was randomly added as the science is not attached to a planet specifically.

    95la9LH.png

     

    Basic Rocketry now costs 5 Blue Science. The early part of the tech tree generally requires Blue Science as that is the majority of what you can attain from Kerbin.

    327mr4l.png

     

    Advanced Electrics requires Purple Science, which can be found on Eve and Bop. The branch of the tech tree following this mostly requires Purple Science, and each Science type has its own branch.

    7cTPzcR.png

     

  12.  

    Are you so unbelievably good at this game that you're able to rendezvous with your eyes closed and nothing but SRBs? Are you a masochist?

     

    Introducing Science+ Randomizer

    This program creates a simple randomized tech tree to make your game difficult in the most soul-crushing way possible. The starting node and shape of the tech tree, as well as the science cost progression, remain the same, but if you're going to complete the tech tree using this mod then you'll have to get creative.

    This mod is intended to be used with Science+ in order to add incentive to branch out to other planets as soon as possible, but it technically has no dependencies. I figured using this randomizer on the vanilla game would result in a very unfun slog of combing Kerbin for crew reports for hours, but I won't stop you.

     

    Instructions

    Just download the .exe and put it in your main KSP folder (NOT the GameData folder, but the root directory) and then run it. Choosing a seed is optional. The new tech tree will then appear inside GameData/SciencePlus-Randomizer. You must go into GameData/Squad/Resources and delete the TechTree.cfg file and insert the randomized file in the same folder.

    Warning: This tool may corrupt your save files. Do not use it in the same KSP folder as anything you wish to keep.

     

    Download

    GitHub: https://github.com/CodapopKSP/SciencePlus-Randomizer/releases/tag/0.1.0

  13.  

    Are you tired of filling out the entire tech tree with a single Minmus biome-hopper? Do you feel like your rocket designs are stale due to always having access to the best parts?

     

    Introducing Science+

    Science+ is a light overhaul of the science system intended to make the game more challenging and to push for a greater variation and creativity in mid-game problem-solving. It allows for the addition of new science types and requirements for spending them in the R&D Facility. These science types can be added by using config files. If the player gets science data that is not specified by the config files, then it will choose a type at random to assign the points to.

    Packaged with Science+ is my own personal implementation of this mod which is loosely based off the different types of science in Factorio. It adds 7 new types (plus default Blue), all based on colors, which can be obtained by visiting other celestial bodies. For instance, Blue Science can be found on Kerbin while Purple Science can be found on Eve. The 8 different colors also have their own branches in the Tech Tree.

    Dependencies: Module Manager

     

    In-Game Screenshots (using Science Colors included with the download)

    Spoiler

    Science gained after the first mission: 10.5 Blue Science for the two experiments from Kerbin and 5 Orange Science which was randomly added as the science is not attached to a planet specifically.

    95la9LH.png

     

    Basic Rocketry now costs 5 Blue Science. The early part of the tech tree generally requires Blue Science as that is the majority of what you can attain from Kerbin.

    327mr4l.png

     

    Advanced Electrics requires Purple Science, which can be found on Eve and Bop. The branch of the tech tree following this mostly requires Purple Science, and each Science type has its own branch.

    7cTPzcR.png

     

    Or Build Your Own!

    I happily encourage others to use this mod to build their own implementations to fit different play styles. You could have Relativity Science be the reward for using the GRAVMAX or have a special science that is only found at the poles of Duna. You could even have a different type of science for each node on the Tech Tree and make it a sort of scavenger hunt.

    Here's how to use the Science+ config file. Don't forget to also edit the TechTree config!

    Spoiler

    Science+
    {
        RED                          // Node Name (Unimportant)
        {
            type = Red        // Science Name (This can be anything you want, such as real life science branches or names of famous scientists.)
            id = Moho         // Requirement (This is how you get the science. It is matched with the experiment name.
            id = Duna          //                                   So "Mystery Goo while Flying Over Laythe's Oceans" could use "Mystery", "Flying", "Laythe" or "Oceans.")
        }
        ORANGE
        {
            type = Orange
            id = Dres
            id = Vall
        }
    ...

     

    Special thanks to xEvilReeperx and Aniruddh for providing much-needed help as well as Diazo and Fengist for their excellent tutorials.

     

    Download

    Github: https://github.com/CodapopKSP/SciencePlus/releases

    SpaceDock: https://spacedock.info/mod/2633/Science%2B

     

    If you're looking for an even greater challenge, check out Science+ Randomizer!

     

  14. 8 hours ago, xEvilReeperx said:

    You can use the same general idea.  In this case, it's easier to straight hijack the live button once it exists. Most of the effort of this is figuring out how to get a reference to the thing you want (conveniently, RDController.Instance.actionButton) and how to manipulate it in a way that doesn't break stock code. Here is some prototype code to get you started:

     

    Wow, thank you very very much!! I've literally spent several tens of hours trying to get this to work prior to your explanation and code. Thank you thank you!!

  15. On 9/4/2016 at 12:42 AM, xEvilReeperx said:

    You can add a listener to the button itself (or add a MonoBehaviour that implements IPointerClickHandler to the button's GameObject). My preference is to edit the prefab wherever possible as it tends to make catching any edge cases a lot simpler. I kind of get the impression that you might want to prevent a part from spawning when clicking with alt held down so here's some code that goes a step further and lets you veto the click by using a small replacement click handler:

    
    public static class EditorIconEvents
    {
        public static readonly EventData<EditorPartIcon, EditorIconClickEvent> OnEditorPartIconClicked =
            new EventData<EditorPartIcon, EditorIconClickEvent>("EditorPartIconClicked");
    
        public class EditorIconClickEvent
        {
            public void Veto() { Vetoed = true; }
            public bool Vetoed { get; private set; }
        }
    
        [KSPAddon(KSPAddon.Startup.EditorAny, true)]
        private class InstallEditorIconEvents : MonoBehaviour
        {
            private IEnumerator Start()
            {
                while (EditorPartList.Instance == null) yield return null;
    
                var prefab = EditorPartList.Instance.partPrefab;
    
                InstallReplacementHandler(prefab);
                    
                // some icons have already been instantiated, need to fix those too. Only needed this first time;
                // after that, the prefab will already contain the changes we want to make
                foreach (var icon in EditorPartList.Instance.gameObject.GetComponentsInChildren<EditorPartIcon>(true))
                    InstallReplacementHandler(icon);
    
                Destroy(gameObject);
            }
    
            private static void InstallReplacementHandler(EditorPartIcon icon)
            {
                icon.gameObject.AddComponent<ReplacementClickHandler>();
            }
        }
    
        private class ReplacementClickHandler : MonoBehaviour, IPointerClickHandler, IPointerDownHandler, IPointerUpHandler
        {
            private EditorPartIcon _icon;
            private PointerClickHandler _originalClickHandler;
            private Button _button;
    
            private void Start()
            {
                _button = GetComponent<Button>();
                _originalClickHandler = GetComponent<PointerClickHandler>();
                _icon = GetComponent<EditorPartIcon>();
    
                if (_button == null || _originalClickHandler == null || _icon == null)
                {
                    Debug.LogError("Couldn't find an expected component");
                    Destroy(this);
                    return;
                }
    
                _originalClickHandler.enabled = false; // we'll be managing these events instead
    
                // unhook EditorPartIcon's listener from the button
                // this will allow us to veto any clicks
                _button.onClick.RemoveListener(_icon.MouseInput_SpawnPart);
            }
    
            public void OnPointerClick(PointerEventData eventData)
            {
                var evt = new EditorIconClickEvent();
    
                OnEditorPartIconClicked.Fire(_icon, evt);
    
                if (evt.Vetoed) return;
    
                _originalClickHandler.OnPointerClick(eventData);
    
                if (_button.interactable) _icon.MouseInput_SpawnPart();
            }
    
            public void OnPointerDown(PointerEventData eventData)
            {
                _originalClickHandler.OnPointerDown(eventData);
            }
    
            public void OnPointerUp(PointerEventData eventData)
            {
                _originalClickHandler.OnPointerUp(eventData);
            }
        }
    }

    And example usage:

    
    [KSPAddon(KSPAddon.Startup.EditorAny, false)]
    class TestTheEvent : MonoBehaviour
    {
        private void Start()
        {
            EditorIconEvents.OnEditorPartIconClicked.Add(IconClicked);
        }
    
        private void OnDestroy()
        {
            EditorIconEvents.OnEditorPartIconClicked.Remove(IconClicked);
        }
    
        private void IconClicked(EditorPartIcon icon, EditorIconEvents.EditorIconClickEvent evt)
        {
            if (!Input.GetKey(KeyCode.LeftAlt) && !Input.GetKey(KeyCode.RightAlt))
                return;
    
            Debug.LogWarning("Icon was clicked for " + icon.partInfo.name + " (" + icon.partInfo.title + ")");
            evt.Veto(); // prevent part from being spawned
        }
    }

     

    Sorry if this is a crazy necro post, but I'm a bit hung up on a mod I'm working on and nearing completion, and I really think this code is close to what I'm looking for in order to finish. However, my understanding of editing prefabs is very limited. Is there a way to change this code slightly to prevent the "Research" button in the TechTree screen from researching a given tech node unless other conditions have been met?

×
×
  • Create New...