DMagic

Members
  • Content count

    3,843
  • Joined

  • Last visited

Community Reputation

3,402 Excellent

About DMagic

  • Rank
    Capsule Communicator

Recent Profile Visitors

13,805 profile views
  1. This is the relevant section covering what I think is the problem. Your KSP Assembly needs to have a reference to your Unity Assembly. Then your KSP Assembly can call any method and use any interface defined in the Unity Assembly. The reverse isn't true because you wouldn't be able to import your Unity Assembly into Unity if it had a reference to any KSP code.
  2. Really sorry but i need help on implementing a UI button (and slider but in the same prefab).

    My issue is that I have some terrible problems trying to understand this...

    I managed to make an Asset Boundle (not sure if correctly).

    but it shows in game. (even if does not behave fully ok).

    my problem with following your tutorial is, on the way you hook up Unity with the ksp part.

    specially this call: window.SetInitState(...)

    because it gives a script error for me (and it makes sense).

     

    I cannot define that correctly because inside that function you are referencing things of the Unity directly.

    now as I noticed that, I add that to the basic unity, but then, I do not undesrtand how to reference :

    the part i do not understand where it goes is...

     

     

    So now we can set the UI’s initial state by implementing our interface on an object in the KSP Assembly and calling the Setup method.

    		private IExample exampleInterface;
    
    		public void setInitialState(IExample example)
    		{
    			if (example == null)
    				return;
    
    			exampleInterface = example;
    
    			if (m_VersionText != null)
    				m_VersionText.text = example.Version;
    
    			if (m_OrbitToggle != null)
    				m_OrbitToggle.isOn = example.ShowOrbit;
    
    			if (m_AlphaSlider != null)
    				m_AlphaSlider.value = example.Alpha;
    
    			if (m_AlphaText != null)
    				m_AlphaText.text = example.Alpha.ToString("P0");
    
    			loaded = true;
    		}
    
    		public void OrbitPanelToggle(bool isOn)
    		{
    			if (!loaded)
    				return;
    
    			if (m_OrbitToggle == null)
    				return;
    
    			if (exampleInterface != null)
    				exampleInterface.ShowOrbit = isOn;			
    
    			//Turn on Orbit Panel
    		}
    
    		public void mySliderAlpha(float alpha)
    		{
    			if (!loaded)
    				return;
    
    			if (exampleInterface != null)
    				exampleInterface.Alpha = alpha;
    
    			if (m_AlphaText != null)
    				m_AlphaText.text = alpha.ToString("P0");
    
    			//Set panel background transparency
    		}
    • Note that we store a reference to the interface for use by the listener methods
    • Make sure to set the Loaded Flag to true if needed
    • The code for actually turning on the separate panel, or changing the background image’s alpha channel can all be handled within the Unity Assembly

    sorry but, this is truly important for me to finish today, or at worst tomorrow.

    if this goes in the Unity.Unity, then i do not understand how can be hooked to the ksp part.

    If this goes as it is in the ksp part, then does not compiles.

    because m_alphaText for example is not defined.

    and if it goes in the interface, then its also NOT defined there (same problem of ksp).

    May be for you is obvious what the problem is but, this is my first time with UI and its like 10 times harder than I expected. (in fact even if it took time doing all the rest was easier and was not truly easy)

    Please answer me

  3. DMagic

    Universal Storage II

    Just add USDecouple to the MM file: @PART[*]:HAS[@MODULE[USDecouple]]:NEEDS[StageRecovery] { MODULE { name = RecoveryIDModule } }
  4. DMagic

    Time for KSP 2.0

    KSP looks the way it does because it started life as a Unity 3 game from 2011 (here is a good version history video). And for the most part the game's looks haven't really changed that much. The earliest versions of the parts have been replaced, and lots of the effects (reentry, particle trails, etc...) have improved, but the basic look of the parts and the terrain remains mostly unchanged (the earliest terrain was pretty bad, but from about 2012 it has been about the same). The biggest updates in terms of visuals has been the space center and VAB/SPH interior (and UI, but that's a different matter). A lot of that comes down to the very basic shaders KSP uses. Unity provides far more advanced shaders that could improve the look of the parts significantly (don't let the ultra-shiny/reflective look of some of the Textures Unlimited parts fool you, the purpose of PBR is to provide a single workflow and shader that allows for materials that look the way they are supposed to look in all different lighting conditions). I don't expect KSP to ever use that as it would require a complete redo of all the parts. Another thing worth considering for people advocating a different engine is mod support. With Unity all you really need is for the game to load custom plugins and to provide some jumping off point to run code (like Part Modules, Scenario Modules, or KSPAddon). Once you have custom code running you can do a tremendous amount with modding. Games using custom engines, or more closed off engines, can be much more restrictive for modding. And even when they allow for it, it can be in a much more limited capacity, or require a whole lot more work to get going (unpacking game files in weird formats, use some uncommon/poorly document scripting system, require some kind of mod compilation to combine different mods, etc...). Using a different engine for physics is another matter, but I think that's a hard problem to get around.
  5. DMagic

    Universal Storage II

    What is it that those mods do with decouplers and what doesn't work correctly?
  6. DMagic

    Universal Storage II

    The part name? It will probably have to stay wrong since changing that internal name would break any existing crafts.
  7. DMagic

    KSP Weekly: The Orbiters!

    A little better.
  8. DMagic

    KSP Weekly: The Orbiters!

    A quick mockup, in case anyone wants to know what the new version would look like with a bit more color:
  9. DMagic

    KSP Weekly: The Orbiters!

    It's different from the current design, but I don't think there is anything unrealistic here. Apollo suits had boots that went on over the sealed inner boots, and had a collar that extended up from where the gloves attached.
  10. DMagic

    KSP Weekly: The Orbiters!

    I agree with the idea of class based identifiers, but there is no need to have duplicate textures used for every possible variant. It would be far simpler and more flexible to apply a different texture to the stripe areas. Then make that texture entirely white (except for whatever details you want like the scratches and dings on the preview) and apply a tint to it. You could define the tint in the class definition configs so that it would be super easy to modify. You end up with an extremely minor performance trade off (as in, if you had 100 Kerbals on screen with a potato computer you would likely not have a measurable difference), but save space on textures and make it more flexible.
  11. DMagic

    KSP Weekly: The Orbiters!

    If nothing else those gifs are fantastic. If they could just be made into a seamless loop they would be perfect. Also, I agree about the dirty helmets. But what I would really like to see is color on those accents and to make it really great, the ability to configure that color based on class. So the helmet color would immediately identify which class each Kerbal is.
  12. contracts window + in 1.2.2 with a whole list of other mods. my issue is that afteri upgraded mission control to its third level, all of my contracts disappeared from the window. even if i accept a new one, itl show up when i go back to the space center, but on the next scene change itl disappear too. any ideas? installed via ckan.

  13. As far as I know that's how stock scanning data is saved. All SCANsat does is call the method: ResourceMap.Instance.UnlockPlanet(body.flightGlobalsIndex); The log file will only reflect this when the scan is actually done, this only occurs on scene load and when you change the scanning threshold. As the name for the setting implies, it disables basically everything to do with stock scanning from the parts themselves.
  14. @Victor3 Scan data is stored in the save file. It's located in the top section (before the vessel list): SCENARIO { name = SCANcontroller scene = 7, 5, 8 ... } The data for each body is stored in Progress nodes: Progress { Body { Name = Kerbin Disabled = False MinHeightRange = -1500 MaxHeightRange = 6500 ClampHeight = 0 PaletteName = Default PaletteSize = 7 PaletteReverse = False PaletteDiscrete = False Map = CAABAAAA---... } } The actual data is a compressed string, so you won't really be able to make any sense of it. If a planet has no data at all then there simply won't be an entry for it. If the data has been wiped somehow then there could be an entry, but the data in the "Map" line should be something uniform, like a long list of AAAAAA. @Johould To add to the last post, the only way to find the scanning percentage for an individual scanner type is to go that vessel, open the small map, disable all scanners except the one you are interested in, then look at the percentage line under the map (displayed after the scanning status indicators: LO, HI,...). You can also collect science data if that is available. No science will be given at less than a 30% scan, and full science will be given for a 97.5% scan, but in between the amount will reflect the scanning percentage. This probably won't help if you've already collected the science, though. You can also just change the stock scanning threshold value to force a check, if the threshold is met and a stock scan is performed then a message will be written to the log file, "SCANsat resource scanning for <body name> meets threshold value [threshold%] Conducting stock orbital resource scan..."
  15. @Wyzard That's fine, there is no interaction. @Brigadier All of the US science parts are mine (you can tell by the generally mediocre quality ), they just take the outer science bay section of the part from the empty US science bay wedge (the two part models get combined during loading). By themselves the US science parts would just sort of float in space and have hollow backs.