Jump to content

(KSP 1.10 + 1.12 ) Mission Controller 3.2.0 (Final Version) (Updated 6/25/2021)


malkuth

Recommended Posts

Suggestion:

All Rescue Kerbal contracts have the Kerbal on 0-degree inclination. Can that be randomized, say 0 to 90 degrees? Or even 180 to -180 degrees? Adds more challenge.

not sure. Would have to overwrite the contract somehow. I think I saw something about that I have to dig around.

From what I can tell I can access the template, but not change it for new parameters. At least the Template has no refrences to adding new ones. Can edit some other things but not really all that much.

Edited by malkuth
Link to comment
Share on other sites

not sure. Would have to overwrite the contract somehow. I think I saw something about that I have to dig around.

Thanks for checking.

On another note: MCE vers 1 had a couple screens where you could review past missions and ships for costs and income. I assume that is not possible with the new KSP Contracts and MCE 2 integration.

Link to comment
Share on other sites

Yeah so, I know that icon on right upper corner but... i dont have any idea how use whole mod. Is there somekind of review video or something like that, maybe a manual of this MissionController version? I dont know anything about this mod version... How can i select mission? . Can I get Mission Controller missions from same "building" where is the normal career missions too, or is there a different menu for those and where can i see my money? Is it those normal KSP funds or is there different menu for it? Like you see im completely lost. I was trying to find somekind of review video or manual but what i found, were for old versions :(.

Edited by naapuri9
Link to comment
Share on other sites

Yeah so, I know that icon on right upper corner but... i dont have any idea how use whole mod.

Just install it: C:\Program Files\Steam\SteamApps\common\Kerbal Space Program\GameData\MissionControllerEC

Is there somekind of review video or something like that, maybe a manual of this MissionController version?

There isn't really a need for one.

I dont know anything about this mod version... How can i select mission? . Can I get Mission Controller missions from same "building" where is the normal career missions too,

MCE missions appear in the same list as other missions in the Mission Controller Building. You will normally see ":0" after the name of an MCE mission. See image below

or is there a different menu for those and where can i see my money? Is it those normal KSP funds or is there different menu for it?

MCE-earned funds are integrated in with the standard KSP fund functionality. In your persistent.sfs file, you'll see a line "funds ="

Like you see im completely lost. I was trying to find somekind of review video or manual but what i found, were for old versions :(.

The old MCE has nothing to do with the new, given that KSP 0.24 changed everything with contracts.

4kOtEoz.jpg

Edited by Apollo13
Link to comment
Share on other sites

Hey, so now i see those MCE missions. I didnt know that i had to play start missions to unlock those, haha :D. But first, it seems that mod items comes in science tree in weird order and those parts have no cost? So is there any way to unlock some of the mod parts at start and somehow get a price to mod parts? Thx for helping me, im one step closer to start enjoying this game :D. Btw, can i make my own missions? It was possible in older versions i suppose.

Link to comment
Share on other sites

But first, it seems that mod items comes in science tree in weird order and those parts have no cost? So is there any way to unlock some of the mod parts at start and somehow get a price to mod parts?
In the part.cfg for each part, there is a line: "TechRequired". You can change that to place it anywhere on the tech tree. Change the price as well.
Btw, can i make my own missions? It was possible in older versions i suppose.

Unfortunately, no. KSP's contract system requires that contracts be compiled into the DLL. I prefer the old MCE method as well, using a text file to create missions. But, that is out of malkuth's hands.

Link to comment
Share on other sites

Unfortunately, no. KSP's contract system requires that contracts be compiled into the DLL. I prefer the old MCE method as well, using a text file to create missions. But, that is out of malkuth's hands.

Actually, it would be a cool project for someone to create contracts that can be tweaked via config files.

Link to comment
Share on other sites

Actually, it would be a cool project for someone to create contracts that can be tweaked via config files.

Already did it, thats what the ComSat Contract is. Can set Name Of Contract, Set its Max Orbital Period and Min Orbital period and what planet you want. All inside the game it self.

I will be expanding custom contracts at a later time, might even bring back the old custom contracts from original MCE.. At least something close. The ComSat Contract was a ProtoType.

To edit the ComSat just click on the MCE Icon in the SpaceCenter view.

Edited by malkuth
Link to comment
Share on other sites

I feel like I'm not getting any of the original vanilla missions anymore.

Only time I seen that happen is if the contract system Times Out or Errors out. You can tell its doing that when you delete contracts from the List and nothing replaces them. Eventually you will have no contracts.

I have actually seen this happen on its own, and restart fixes it and I seen it be messed up by a contract getting timed out or Error out. Usually messes up the whole works.

Unless your still getting contracts, but not vanilla. Have not seen that happen yet.

Link to comment
Share on other sites

Okay, thx Apollo 13 for help. Now i know everything that i need to start playing career like i wanted to. :D

Be advised though some of the Contracts in Mission Controller Require Engineer for you can get an Orbital Period readout. And some require max ApA or Min ApA. You can check that in that Map View while in Flight Mode.

Link to comment
Share on other sites

Unless your still getting contracts, but not vanilla. Have not seen that happen yet.

I can confirm that I am not getting the "Test a part" contracts from vanilla in my new Mission Controller save. I am getting the explore a place ones.

Link to comment
Share on other sites

I can confirm that I am not getting the "Test a part" contracts from vanilla in my new Mission Controller save. I am getting the explore a place ones.

Mission Controller doesn't mess with Test Parts at all. Seem to be getting them in my game right now. The problem does come, the more contracts you have the less room you get, and the system starts excluding contracts.

The best way to see this in action is to:

1. Press ALT- F12.

2. In top Tab Select Contract

3. After Select Tools in Bottom Tab.

4. Press Clear Current Contracts to ReCycle the new List. Do this over and over and you will see that sometimes things show, other times they don't.

Link to comment
Share on other sites

Just found something that must have been added in 0.24 when working on one of my mods that might be useful to you for charging funds for hiring kerbals (if you're not already using it). They added a new Event: GameEvents.onKerbalTypeChange that could be used to detect when kerbals go from Applicant to Crew (or Unowned to Crew). You may already be using that, I just know you used to check if the Crew Roster changed manually and you might be using that code again.

Link to comment
Share on other sites

@magico13: when Kerbals are hired or rescued, MCE charges 4000

Be advised though some of the Contracts in Mission Controller Require Engineer for you can get an Orbital Period readout. And some require max ApA or Min ApA. You can check that in that Map View while in Flight Mode.

I use KData. Provides essential info without being obtrusive. Requires no parts.

Edited by Apollo13
Link to comment
Share on other sites

@magico13: when Kerbals are hired or rescued, MCE charges 4000

I know, I'm letting Malkuth know about a different way of detecting the hiring (doing it exactly when it happens rather than checking manually for changes during the Update() in the SpaceCenter scene). I'm talking about the coding of the mod, not whether or not it has a feature, in case he was unaware of the Event that was added in 0.24. Realistically no one would notice the difference as in the end it would have the same result, but it's perhaps a bit "better" (at the very least, it provides an easy way of differentiating between Kerbals who are hired and those who are rescued, less code running per frame, and less points of failure [no need to maintain your own list of hired Kerbals]).

Link to comment
Share on other sites

Just found something that must have been added in 0.24 when working on one of my mods that might be useful to you for charging funds for hiring kerbals (if you're not already using it). They added a new Event: GameEvents.onKerbalTypeChange that could be used to detect when kerbals go from Applicant to Crew (or Unowned to Crew). You may already be using that, I just know you used to check if the Crew Roster changed manually and you might be using that code again.

Ya I saw that when I was adding the New Insurance payment on Death I was adding. I might try it out, will take up less memory doing it that way, and cut down the code a little. Right now I create a List of Crew at gamestart, and check it against the current hired list. When hired list changes MC charges you.

Link to comment
Share on other sites

I know, I'm letting Malkuth know about a different way of detecting the hiring (doing it exactly when it happens rather than checking manually for changes during the Update() in the SpaceCenter scene). I'm talking about the coding of the mod, not whether or not it has a feature, in case he was unaware of the Event that was added in 0.24. Realistically no one would notice the difference as in the end it would have the same result, but it's perhaps a bit "better" (at the very least, it provides an easy way of differentiating between Kerbals who are hired and those who are rescued, less code running per frame, and less points of failure [no need to maintain your own list of hired Kerbals]).

Dam worked like a charm too. Just cut a whole bunch of code into 1 single method that fires without sucking up OnUpdate cycles.. Woohoo.

Now if I can only figure out how to use Scenario to save information to Persistent file.

Edited by malkuth
Link to comment
Share on other sites

Mun Orbital Contract mission still failing. Per previous discussion, I cleared the old pre-2G mission. Just got another one now. All conditions are satisfied. MCE still claims that I am not in orbit around Mun.

When I right-click the orbital scanner part, it shows: Probe Ready To Scan: False

I'm using the same vehicle I used previously.

Edited by Apollo13
Link to comment
Share on other sites

Mun Orbital Contract mission still failing. Per previous discussion, I cleared the old pre-2G mission. Just got another one now. All conditions are satisfied. MCE still claims that I am not in orbit around Mun.

When I right-click the orbital scanner part, it shows: Probe Ready To Scan: False

I'm using the same vehicle I used previously.

Ok Ill check it out.

Edit: Strange I still have my test vehicle in orbit of mun, loaded up a Orbital Research and all goal were completed. Just had to press the Research button wait for countdown and bang. Done. Not sure whats going on Apollo.

Anyone else having issues with Orbital Research?

Edit again. And just used a whole new vessel and no issues. (ya done it so much it takes me minutes to launch to mun.. LOL.)

Edited by malkuth
Link to comment
Share on other sites

Dam worked like a charm too. Just cut a whole bunch of code into 1 single method that fires without sucking up OnUpdate cycles.. Woohoo.

Now if I can only figure out how to use Scenario to save information to Persistent file.

KCT does it, based on TriggerAu's ConfigNode storage stuff (which you're also using). Let me see if I can sum it up at all. The two simplest classes to look at in my code would be the class KerbalConstructionTimeData : ScenarioModule in the Kerbal_Construction_Time.cs file and the KCT_DataStorage : ConfigNodeStorage class (in the KCT_DataStorage.cs file).

Instead of walking through exactly what I have, I'll come up with a simple example (that theoretically would work almost as-is):

KerbalConstructionTimeData : ScenarioModule


public class KerbalConstructionTimeData : ScenarioModule
{
public override void OnSave(ConfigNode node)
{
base.OnSave(node);
KCT_DataStorage kctDS = new KCT_DataStorage();
node.AddNode(kctDS.AsConfigNode());
}
public override void OnLoad(ConfigNode node)
{
base.OnLoad(node)
KCT_DataStorage kctDS = new KCT_DataStorage();
ConfigNode CN = node.GetNode(kctDS.GetType().Name);
if (CN != null)
ConfigNode.LoadObjectFromConfig(kctDS, CN);
}
}

DataStorage : ConfigNodeStorage


public class KCT_DataStorage : ConfigNodeStorage
{
[Persistent] float SomeFloat;

public override void OnDecodeFromConfigNode()
{
KCT_GameStates.SomeFloat = SomeFloat;

}

public override void OnEncodeToConfigNode()
{
SomeFloat = KCT_GameStates.SomeFloat;

}
}

Additionally, in the Start() I have this to add the ScenarioModule to the save (and cause it to read and write to the save in the specified scenes)


ProtoScenarioModule scenario = HighLogic.CurrentGame.scenarios.Find(s => s.moduleName == typeof(KerbalConstructionTimeData).Name);
if (scenario == null)
{
try
{
Debug.Log("[KCT] Adding InternalModule scenario to game '" + HighLogic.CurrentGame.Title + "'");
HighLogic.CurrentGame.AddProtoScenarioModule(typeof(KerbalConstructionTimeData), new GameScenes[] {GameScenes.FLIGHT, GameScenes.SPACECENTER, GameScenes.EDITOR, GameScenes.SPH, GameScenes.TRACKSTATION});
// the game will add this scenario to the appropriate persistent file on save from now on
}
catch (ArgumentException ae)
{
Debug.LogException(ae);
}
catch
{
Debug.Log("[KCT] Unknown failure while adding scenario.");
}
}
else
{
//Debug.Log("[KCT] Scenario is not null.");
if (!scenario.targetScenes.Contains(GameScenes.SPACECENTER))
scenario.targetScenes.Add(GameScenes.SPACECENTER);
if (!scenario.targetScenes.Contains(GameScenes.FLIGHT))
scenario.targetScenes.Add(GameScenes.FLIGHT);
if (!scenario.targetScenes.Contains(GameScenes.EDITOR))
scenario.targetScenes.Add(GameScenes.EDITOR);
if (!scenario.targetScenes.Contains(GameScenes.SPH))
scenario.targetScenes.Add(GameScenes.SPH);
if (!scenario.targetScenes.Contains(GameScenes.TRACKSTATION))
scenario.targetScenes.Add(GameScenes.TRACKSTATION);

}

Instead of storing the values that you actually use in another class like I do (aka, KCT_GameStates), you could just keep a reference to the KCT_DataStorage object and reference the values it contains directly. Then just run an AsConfigNode on it when saving and LoadObjectFromConfig when loading. In order for a value to be saved, you have to have [Persistent] in front of it upon declaration. Most simple objects can be saved, including Lists. Dictionaries can't be, but you can convert them to a list in whatever way you like (I have a Dictionary<string, int> that I save as a List<string> where the first element is the string and the second is the int and they just keep alternating). There are likely better ways of doing it, but when I set this up I was just learning modding (aka, in KCT's first release after I took over in January). If you can break things down into easy to store objects, then you can store more complex things (take a look at how I store KCT_BuildListVessels in KCT_BuildListStorage). If I were better at using ConfigNodes in general I could nest them and do things far easier, but as of right now I still suck at using them efficiently.

Link to comment
Share on other sites

KCT does it, based on TriggerAu's ConfigNode storage stuff (which you're also using). Let me see if I can sum it up at all. The two simplest classes to look at in my code would be the class KerbalConstructionTimeData : ScenarioModule in the Kerbal_Construction_Time.cs file and the KCT_DataStorage : ConfigNodeStorage class (in the KCT_DataStorage.cs file).

Instead of walking through exactly what I have, I'll come up with a simple example (that theoretically would work almost as-is):

KerbalConstructionTimeData : ScenarioModule


public class KerbalConstructionTimeData : ScenarioModule
{
public override void OnSave(ConfigNode node)
{
base.OnSave(node);
KCT_DataStorage kctDS = new KCT_DataStorage();
node.AddNode(kctDS.AsConfigNode());
}
public override void OnLoad(ConfigNode node)
{
base.OnLoad(node)
KCT_DataStorage kctDS = new KCT_DataStorage();
ConfigNode CN = node.GetNode(kctDS.GetType().Name);
if (CN != null)
ConfigNode.LoadObjectFromConfig(kctDS, CN);
}
}

DataStorage : ConfigNodeStorage


public class KCT_DataStorage : ConfigNodeStorage
{
[Persistent] float SomeFloat;

public override void OnDecodeFromConfigNode()
{
KCT_GameStates.SomeFloat = SomeFloat;

}

public override void OnEncodeToConfigNode()
{
SomeFloat = KCT_GameStates.SomeFloat;

}
}

Additionally, in the Start() I have this to add the ScenarioModule to the save (and cause it to read and write to the save in the specified scenes)


ProtoScenarioModule scenario = HighLogic.CurrentGame.scenarios.Find(s => s.moduleName == typeof(KerbalConstructionTimeData).Name);
if (scenario == null)
{
try
{
Debug.Log("[KCT] Adding InternalModule scenario to game '" + HighLogic.CurrentGame.Title + "'");
HighLogic.CurrentGame.AddProtoScenarioModule(typeof(KerbalConstructionTimeData), new GameScenes[] {GameScenes.FLIGHT, GameScenes.SPACECENTER, GameScenes.EDITOR, GameScenes.SPH, GameScenes.TRACKSTATION});
// the game will add this scenario to the appropriate persistent file on save from now on
}
catch (ArgumentException ae)
{
Debug.LogException(ae);
}
catch
{
Debug.Log("[KCT] Unknown failure while adding scenario.");
}
}
else
{
//Debug.Log("[KCT] Scenario is not null.");
if (!scenario.targetScenes.Contains(GameScenes.SPACECENTER))
scenario.targetScenes.Add(GameScenes.SPACECENTER);
if (!scenario.targetScenes.Contains(GameScenes.FLIGHT))
scenario.targetScenes.Add(GameScenes.FLIGHT);
if (!scenario.targetScenes.Contains(GameScenes.EDITOR))
scenario.targetScenes.Add(GameScenes.EDITOR);
if (!scenario.targetScenes.Contains(GameScenes.SPH))
scenario.targetScenes.Add(GameScenes.SPH);
if (!scenario.targetScenes.Contains(GameScenes.TRACKSTATION))
scenario.targetScenes.Add(GameScenes.TRACKSTATION);

}

Instead of storing the values that you actually use in another class like I do (aka, KCT_GameStates), you could just keep a reference to the KCT_DataStorage object and reference the values it contains directly. Then just run an AsConfigNode on it when saving and LoadObjectFromConfig when loading. In order for a value to be saved, you have to have [Persistent] in front of it upon declaration. Most simple objects can be saved, including Lists. Dictionaries can't be, but you can convert them to a list in whatever way you like (I have a Dictionary<string, int> that I save as a List<string> where the first element is the string and the second is the int and they just keep alternating). There are likely better ways of doing it, but when I set this up I was just learning modding (aka, in KCT's first release after I took over in January). If you can break things down into easy to store objects, then you can store more complex things (take a look at how I store KCT_BuildListVessels in KCT_BuildListStorage). If I were better at using ConfigNodes in general I could nest them and do things far easier, but as of right now I still suck at using them efficiently.

thanks magico this is going to help a lot. :)

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...