-
Posts
18 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Everything posted by intervenience
-
Realism Overhaul Discussion Thread
intervenience replied to NathanKell's topic in KSP1 Mods Discussions
Is anyone else having issues with the RD-180 from the Soviet Engines Pack (the version being managed by DECQ and Dragon01) not loading into the game? All the other parts from that mod are showing up in game correctly. -
[1.7.2] KK Launchers - Delta, Atlas Pack
intervenience replied to Kartoffelkuchen's topic in KSP1 Mod Releases
The Falcon 9 looks awesome, I can't wait to try it out when it's released. Any ETA? -
So you want to have parts allocated for specific game saves? I think you will have to use config nodes for this, but I'm not entirely sure how you would proceed from there. My question: I'm trying to use ConfigNode to load a string array, but it does not return any results. It just says in the log "System.String[]" Is there a better way to load this information to compare data from the game? In this case, comparing stored values in my config node to the universal time in the game, such that there may be many results to retrieve. If there is no other way to retrieve the data, could someone help me troubleshoot this. (I'm using a custom .cfg file in my mod folder for now) string timeOfRestoration; void Awake() { ConfigNode rtLoadNode = ConfigNode.Load("GameData/recoveryTimer/Recoveries.cfg"); Debug.Log(rtLoadNode.GetValues(timeOfRestoration)); } And yes, I've made sure it's loading the correct file. I've got another line of code in my file to count the nodes in the file and it's returning the correct number so it's definitely working. Thanks.
-
MissionRecoveryDialog isn't returning the reputation, science and funds earned during flight. I've tried using both onVesselRecoveryProcessing and onVesselRecovered but neither of those will give me a value other than 0. However, each function will give me a value for the current universal time so I don't quite understand what's going wrong. An explanation would be very appreciated, thanks. public void Start() { GameEvents.onVesselRecoveryProcessing.Add(RecoveryProcessingCallback); GameEvents.onVesselRecovered.Add(RecoveryProcessing); } void RecoveryProcessingCallback(ProtoVessel pv, MissionRecoveryDialog dlg, float recovery) { MissionRecoveryDialog dialog = new MissionRecoveryDialog(); float repEarned = dialog.reputationEarned; float sciEarned = dialog.scienceEarned; double fundsEarned = dialog.fundsEarned; Debug.Log("[Recovery Timer] Rep: " + repEarned); Debug.Log("[Recovery Timer] Sci: " + sciEarned); Debug.Log("[Recovery Timer] Funds: " + fundsEarned); double currentUniversalTime = Planetarium.GetUniversalTime(); Debug.Log("[Recovery Timer] Time of recovery: " + currentUniversalTime); } void RecoveryProcessing(ProtoVessel pv) { MissionRecoveryDialog secondaryDialog = new MissionRecoveryDialog(); float repEarned = secondaryDialog.reputationEarned; float sciEarned = secondaryDialog.scienceEarned; double fundsEarned = secondaryDialog.fundsEarned; Debug.Log("[Recovery Timer] Rep: " + repEarned); Debug.Log("[Recovery Timer] Sci: " + sciEarned); Debug.Log("[Recovery Timer] Funds: " + fundsEarned); double currentUniversalTime = Planetarium.GetUniversalTime(); Debug.Log("[Recovery Timer] Time of recovery: " + currentUniversalTime); }
-
I think I get what you mean. So theoretically I could have my code look something like this (could I instead use an event listener to wait for the value to change?) float fundsToStore = MissionRecoveryDialog.fundsEarned; public void FixedUpdate() { if (fundsToStore == null) { fundsToStore = 0; //so it creates a real value that can be altered later } else { fundsToStore = MissionRecoveryDialog.fundsEarned; //it changes the value to what the game's output for this variable is } }
-
I've been messing around in a little cs project of mine and I want to be able to access and store the values (funds, rep and science) that are given when in the mission recovery dialog after you recover a vessel. Seems fairly straightforward, problem is I'm getting "An object reference is required for the non-static field, method, or property 'MissionRecoveryDialog.fundsEarned'". I'm also getting this error for the same lines I have written for reputation and science. My code looks like this: float fundsToStore = MissionRecoveryDialog.fundsEarned; float repToStore = MissionRecoveryDialog.reputationEarned; float sciToStore = MissionRecoveryDialog.scienceEarned; I've attempted to troubleshoot the problem by moving the float declarations in several different parts of my file, and attempted to use static and non-static functions (could potentially be an issue according to threads I've read from stackoverflow, however because I can't alter those files directly I cannot do anything about it). If it helps when troubleshooting, the code-assist writer (the menu that pops up with matching text when you type) does not show any variable names under MissionRecoveryDialog. Sorry if it's a little ambiguous and if it's an obvious issue but I'm new to C# and modding in general. Thanks.
-
I'm getting "An object reference is required for the non-static field, method, or property" error for each of my lines trying to store science/funds/rep gained from a mission. Hopefully I'm not being stupid about this Currency storedReputation = MissionRecoveryDialog.reputationEarned; Currency storedScience = MissionRecoveryDialog.scienceEarned; Currency storedFunds = MissionRecoveryDialog.fundsEarned;
-
How do I get the date/time?
intervenience replied to Robotengineer's topic in KSP1 C# Plugin Development Help and Support
Thank you very much Trigger -
How do I get the date/time?
intervenience replied to Robotengineer's topic in KSP1 C# Plugin Development Help and Support
Cool, so I'll just mess about with converting the function then. Also, if you can upload the timelibrary I'll definitely check it out. Thanks. -
How do I get the date/time?
intervenience replied to Robotengineer's topic in KSP1 C# Plugin Development Help and Support
Perhaps I'm misunderstanding something obvious here but when I try to use KSPUtil.GetDateFromUT(Planetarium.GetUniversalTime()); I'm getting an error: "The best overloaded method match for 'KSPUtil.GetDateFromUT(int)' has some invalid arguments" -> "Argument 1: cannot convert from 'double' to 'int'" My code looks like this: double currentUniversalTime = KSPUtil.GetDateFromUT(Planetarium.GetUniversalTime()); -
Any good tutorials?
intervenience replied to Whirligig Girl's topic in KSP1 C# Plugin Development Help and Support
Visual Studio and MonoDevelop are both good (and free) IDE's for C# -
When I try to override I get a 'no suitable method found to override' error. public override void OnVesselRecoveryProcessing() { timeOfRecovery = currentUniversalTime + timeToRecoverVessel; if (currentUniversalTime == timeOfRecovery) { recoveryTimeIsMet = true; } } The process inside it seems right (and is referenced from my .cs file correctly) but I'm not quite sure I understand overrides in C# yet. Would anyone be able to explain why I'm getting this error and how I can fix it? Cheers
-
Any good tutorials?
intervenience replied to Whirligig Girl's topic in KSP1 C# Plugin Development Help and Support
I've only just started learning C# but looking at other people's source codes is helping me quite a bit. It's definitely worth your time.