Athywren Posted April 15, 2015 Share Posted April 15, 2015 (edited) Ohhh yes, I approve of this mod!Ok, so I've got an idea for a collection of training incentives contracts - you know, like an NVQ in being an astronaut... I would take the hell out of that course - and I've had a look through the wiki but I want to quickly check that I have a clue before I dive in and start fiddling with things.If I were to use the following code, would it come up when your space program only has one crew member of the specified trait and level, and no crew members ahead or one level behind them? Say, one pilot at level four, and maybe twelve pilots at level two or lower, but none at three or five?REQUIREMENT{name = All type = All REQUIREMENT { name = HasCrew type = HasCrew trait = Pilot minExperience = 4 maxExperience = 4 maxCount = 1 } REQUIREMENT { name = HasCrew type = HasCrew trait = Pilot minExperience = 3 maxCount = 1}}I'm pretty much certain it would, but I thought I'd ask before I start down a rabbit trail and find out that HasCrew actually only refers to space craft or something. Also, is it safe to leave the parameters I have out - minCount and maxExperience - or do they need to be included even though they have defaults? Edited April 15, 2015 by Athywren Quote Link to comment Share on other sites More sharing options...
futrtrubl Posted April 15, 2015 Share Posted April 15, 2015 It looks to me like it says 0 or 1 level 4 pilot and 0 or 1 pilot with greater than 3 experience. Quote Link to comment Share on other sites More sharing options...
nightingale Posted April 15, 2015 Author Share Posted April 15, 2015 Correct. So if you wanted "one pilot at level four, and maybe twelve pilots at level two or lower, but none at three or five", then you would do:[COLOR=#333333]REQUIREMENT[/COLOR][COLOR=#333333]{[/COLOR][COLOR=#333333] name = HasCrew[/COLOR][COLOR=#333333] type = HasCrew[/COLOR][COLOR=#333333] trait = Pilot[/COLOR][COLOR=#333333] minExperience = 4[/COLOR][COLOR=#333333] maxExperience = 4[/COLOR][COLOR=#333333] maxCount = 1[/COLOR][COLOR=#333333]}[/COLOR][COLOR=#333333]REQUIREMENT[/COLOR][COLOR=#333333]{[/COLOR][COLOR=#333333] name = HasCrew[/COLOR][COLOR=#333333] type = HasCrew[/COLOR][COLOR=#333333] trait = Pilot[/COLOR][COLOR=#333333] minExperience = 5[/COLOR][COLOR=#333333] maxExperience = 5[/COLOR][COLOR=#333333] maxCount = 0[/COLOR][COLOR=#333333]}[/COLOR][COLOR=#333333]REQUIREMENT[/COLOR][COLOR=#333333]{[/COLOR][COLOR=#333333] name = HasCrew[/COLOR][COLOR=#333333] type = HasCrew[/COLOR][COLOR=#333333] trait = Pilot[/COLOR][COLOR=#333333] minExperience = 3[/COLOR][COLOR=#333333] maxExperience = 3[/COLOR][COLOR=#333333] maxCount = 0[/COLOR][COLOR=#333333]}[/COLOR]Although those are fairly rigid requirements. Maybe just having contracts for "none at level 5", "none at level 4+", "none at level 3+", etc. may make more sense. Quote Link to comment Share on other sites More sharing options...
Athywren Posted April 15, 2015 Share Posted April 15, 2015 Excellent! I thought it would work, but it was a hastily thrown together bit of nonsense based on very quickly skimming the wiki and making assumptions (like that a parameter with a default probably doesn't need to be defined if it's only going to be defined as its default). What I'm trying to have it look for is a single crew member at level n, and that there are no crew members of the same career path between level n-1 and 5 other than the one at n, so if minXP=3/maxXP=5/maxCount=1 works, and min&maxXP=4/maxCount=1 works, then the crew member at 4 must be the one in that range.I can think of a much simpler way to do it, which would be to call for the highest level crew member with the required trait, then check the count between n-1 & 5 to make sure there's the skill gap. I just don't know how to do that yet. I'll have to have a proper go at the wiki in a bit. For now, though, I'm done pretending to be an adult for the day, so I'm going to take the brute force route first - see if I can make it do what I want before I figure out how to finesse it.I'm more excited about this than is healthy... Quote Link to comment Share on other sites More sharing options...
nightingale Posted April 15, 2015 Author Share Posted April 15, 2015 In that case you may want to look at an expression to "select" the Kerbal that meets your criteria. Tourism contract pack would have examples, although I may need to add methods for you to get the trait and experience level (they may already be there, can't check at the moment). Quote Link to comment Share on other sites More sharing options...
Athywren Posted April 15, 2015 Share Posted April 15, 2015 Thanks, I'll check the Tourism pack out tomorrow, see what I can learn from it. You've written a brilliant tool here... I'm sure you know that, but, you know, it needed to be said.What I've got in mind is a two part thing. The first is a contract that shows up if you have a single kerbonaut on any of the career paths shooting ahead of their colleagues in terms of level, and offers you a decent bit of reputation for training up a backup, for in case it turns out that sitting on top of several hundred tons of highly compressed explosive chemicals is somehow dangerous. The other is for when the astronaut complex is a little upgraded, and you've got a decent collection of crew members. It offers a little cash and reputation for training a certain percentage of your kerbonauts to different levels, so a group of 20 would have a contract for getting maybe 16 to level 2 or above, one for 8 to 3 or above, 4 to 4 etc. Basically, it's an HR mod (because, hey, just because they're weird little green fictional people, that doesn't mean they don't have a right to continuing education and professional development!)I've actually got it working in a Conan The Barbarian kind of way, but it definitely needs a bit of... pruning. Quote Link to comment Share on other sites More sharing options...
nightingale Posted April 15, 2015 Author Share Posted April 15, 2015 Here's what it would look like with an expression - I ended up keeping the requirements to match exactly what you're looking for:CONTRACT_TYPE{ name = KerbalExperienceTest title = Kerbal Pilot Experience description = Do something with @targetKerbal! DATA { type = Kerbal // Get a Kerbal that matches our criteria targetKerbal = AllKerbals().Where(k => k.ExperienceTrait() == Pilot && k.ExperienceLevel() == 4).Random() } REQUIREMENT { name = HasCrew type = HasCrew trait = Pilot minExperience = 4 maxExperience = 4 maxCount = 1 } REQUIREMENT { name = HasCrew type = HasCrew trait = Pilot minExperience = 5 maxExperience = 5 maxCount = 0 } REQUIREMENT { name = HasCrew type = HasCrew trait = Pilot minExperience = 3 maxExperience = 3 maxCount = 0 }}I ran some quick tests and there were minor issues (which will be fixed in 0.7.12). So if you can wait a couple days, the above should work, or you can grab the development dll here. Quote Link to comment Share on other sites More sharing options...
nightingale Posted April 16, 2015 Author Share Posted April 16, 2015 I needed to get 0.7.12 out for some fixes related to something special I'm working on.... check back in about 30 minutes for a new mini-contract pack. Download 0.7.12 now!Contract Configurator 0.7.12Fix issue when loading part names with non-standard characters (thanks tattagreis).Fix issue with using custom behaviours.Can now provide multiple techs, parts and part modules in PartModuleUnlocked, PartUnlocked and TechResearched requirements.TechResearched requirement now supports selecting techs by specifying parts.WaypointGenerator now supports a hidden attribute for waypoints.Hash contract configuration details, and cancel offered contracts if the hashed values do not match. This prevents old contracts from staying on offer when a contract pack is upgraded.Improved handling of invalid vessel identifiers.SpawnVessel now properly supports landed vessels.Support for hierarchies of contract groups.Fixes for Expression requirement.Minor bug fixes. Quote Link to comment Share on other sites More sharing options...
SpacedInvader Posted April 16, 2015 Share Posted April 16, 2015 So, immediately after updating to the new version, I am presented with the following:Exception occured while loading contract parameter 'HasCrew5703' in contract 'unknown':System.TypeInitializationException: An exception was thrown by the type initializer for ContractConfigurator.ExpressionParser.BaseParser ---> System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded. at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool) at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0 at ContractConfigurator.ContractConfigurator+<GetAllTypes>d__1e`1[ContractConfigurator.ExpressionParser.IExpressionParserRegistrer].MoveNext () [0x00000] in <filename unknown>:0 at ContractConfigurator.ExpressionParser.BaseParser..cctor () [0x00000] in <filename unknown>:0 --- End of inner exception stack trace --- at ContractConfigurator.ConfigNodeUtil.ParseSingleValue[Int32] (System.String key, System.String stringValue, Boolean allowExpression) [0x00000] in <filename unknown>:0 at ContractConfigurator.ConfigNodeUtil.ParseValue[Int32] (.ConfigNode configNode, System.String key, Boolean allowExpression) [0x00000] in <filename unknown>:0 at ContractConfigurator.ConfigNodeUtil.ParseValue[Int32] (.ConfigNode configNode, System.String key, Int32 defaultValue) [0x00000] in <filename unknown>:0 at ContractConfigurator.RemoteTech.RemoteTechProgressTracker.OnLoad (.ConfigNode node) [0x00000] in <filename unknown>:0 at ScenarioModule.Load (.ConfigNode node) [0x00000] in <filename unknown>:0 at ScenarioRunner.AddModule (.ConfigNode node) [0x00000] in <filename unknown>:0 at ProtoScenarioModule.Load (.ScenarioRunner host) [0x00000] in <filename unknown>:0 at ScenarioRunner+ .MoveNext () [0x00000] in <filename unknown>:0 Also, this apparently breaks Kerbal Construction Time somehow as that mod is now reporting errors which would make the game "unplayable" (it's words). Quote Link to comment Share on other sites More sharing options...
nightingale Posted April 16, 2015 Author Share Posted April 16, 2015 That's not good. Can I get your list of installed mods? Also a full log file may help here. Quote Link to comment Share on other sites More sharing options...
SpacedInvader Posted April 16, 2015 Share Posted April 16, 2015 Currently checking to see if reverting to the previous version is going to fix the issue (I have a lot of mods, so it takes a while). Has anyone ever come up with a way to quickly list all installed mods? I have 116 folders in my GameData folder and I'm not super keen on typing them all out... Quote Link to comment Share on other sites More sharing options...
severedsolo Posted April 16, 2015 Share Posted April 16, 2015 Currently checking to see if reverting to the previous version is going to fix the issue (I have a lot of mods, so it takes a while). Has anyone ever come up with a way to quickly list all installed mods? I have 116 folders in my GameData folder and I'm not super keen on typing them all out...If you have AVC you can screenshot that list, that should cut it down considerably. Or screenshot your "installed" list on CKAN? Quote Link to comment Share on other sites More sharing options...
nightingale Posted April 16, 2015 Author Share Posted April 16, 2015 Fix for the above issue is out. Download it now!Contract Configurator 0.7.13Fix exception when loading types from assemblies that have been improperly compiled (thanks SpacedInvader).Basically what happened is I mucked up some exception handling code that protects Contract Configurator from other mod that are improperly compiled against the wrong .Net version. That code is now fixed in 0.7.13. If you can provide logs under 0.7.13, it should identify which mod is the one that is compiled wrong (and it can be reported on their thread). Quote Link to comment Share on other sites More sharing options...
severedsolo Posted April 16, 2015 Share Posted April 16, 2015 I reckon KCT has to be a good suspect here... I play with KCT too though, so if it kicks off, I'll let you know when CKAN actually registers the update (still says 0.7.11) Quote Link to comment Share on other sites More sharing options...
nightingale Posted April 16, 2015 Author Share Posted April 16, 2015 Once you update to 0.7.13, just look for the following message in the log:Error loading types from assembly <assembly>.​ Quote Link to comment Share on other sites More sharing options...
futrtrubl Posted April 16, 2015 Share Posted April 16, 2015 Currently checking to see if reverting to the previous version is going to fix the issue (I have a lot of mods, so it takes a while). Has anyone ever come up with a way to quickly list all installed mods? I have 116 folders in my GameData folder and I'm not super keen on typing them all out...If you are on windows open a command prompt in your gamedata folder (or better a folder of all the downloaded mods still in archives) and typedir /b /o:n > modlist.txtAnd will output a list of contents of the folder and save it in modlist.txt. Quote Link to comment Share on other sites More sharing options...
SpacedInvader Posted April 16, 2015 Share Posted April 16, 2015 So it looks like it's Firespitter throwing the error which is going to be a problem since I don't think it's been updated in quite some time.As for the contents of my GameData folder, here it is, just in case any of the rest of it is relevant:000_Toolbar000_USIToolsAIES_AerospaceAJEAnimatedDecouplersArcanumIndustriesARTASETB9_AerospaceBackgroundProcessing-0.4.0.1.dllblackheartChattererCITCMESCoherentContractsCommunityResourcePackCommunityTechTreeConnectedLivingSpaceContract_science_modifierContractConfiguratorContractPacksContractsWindowCrossFeedEnablerCrowdSourcedScienceCustomAsteroidsDDSLoaderDeadlyReentryDiazoDistantObjectDMagicOrbitalScienceEditorExtensionsEngineIgnitorEnhancedNavBallExtraplanetaryLaunchpadsFASAFerramAerospaceResearchFieldExperienceFinalFrontier.datFirespitterFreedomTexftmn_newFuseboxGCMonitorJSIKASKAXKerbalConstructionTimeKerbalIspDifficultyScalerKerbalJointReinforcementKerbalStatsKerbalStockLauncherOverhaulKineTechAnimationKittopiaSpaceKlockheed_Martian_GimbalKopernicusKOSMOSKSPAPIExtKSP-AVCKWRocketryLICENSE_DDSLoader.txtLICENSE_KittopiaTech.txtLICENSE_Kopernicus.txtLICENSE_KopernicusTech.txtLICENSE_ModuleManager.txtLICENSE_OuterPlanetsMod.txtMagicSmokeIndustriesMechJeb2MechJebAndEngineerForAll.cfgmodlist.txtModuleManager.2.5.1.dllModuleManager.2.5.13.dllModuleManager.2.5.8.dllModuleManager.ConfigCacheModuleManager.ConfigSHAModuleRCSFXMunarSurfaceExperimentPackageMyModsNASAmissionNavyFishNearFutureConstructionNearFutureElectricalNearFuturePropsNearFuturePropulsionNearFutureSolarNereidNovaPunch2OpenResourceSystemOPMOPTORSResourcePackOuterPlanetsMod.versionPlanetShinePreciseNodeProceduralFairingsProceduralPartsRCSBuildAidRealChuteRealFuelsRegolithRemoteTechResGenRLA_StockalikeSane StrategiesSCANsatScienceAlertSDHISETISETIgreenhouseShipManifestspacetuxSquadStageRecoveryStationScienceStockBugFixModulesTechManagerTextureReplacerThrottleControlledAvionicsThunderAerospaceToadicusToolstoolbar-settings.datTrajectoriesTriggerTechTweakableEverythingTweakScaleUmbraSpaceIndustriesUniversalStorageVenStockRevampVirgin KalacticVNGWaypointManagerWombatConversionsYarbrough08000_FilterExtensions Quote Link to comment Share on other sites More sharing options...
nightingale Posted April 16, 2015 Author Share Posted April 16, 2015 As long as it's just the error I mentioned earlier it shouldn't be a problem under 0.7.13. I'll grab firespitter and double check in the morning. Quote Link to comment Share on other sites More sharing options...
futrtrubl Posted April 16, 2015 Share Posted April 16, 2015 There was an unofficial updated firespitter dll released, grab it from MKS. Quote Link to comment Share on other sites More sharing options...
SpacedInvader Posted April 16, 2015 Share Posted April 16, 2015 There was an unofficial updated firespitter dll released, grab it from MKS.I'll give that a try to see if there are any changes in loading. I already have MKS, but I'm sure I've overwritten the firespitter.dll with the most recent one from the release thread. Quote Link to comment Share on other sites More sharing options...
nightingale Posted April 18, 2015 Author Share Posted April 18, 2015 New version out, a few fixes for the Tourism pack. Download it now!Contract Configurator 0.7.14Expressions now work in child nodes (for WaypointGenerator and other behaviours that support it).Fix issues with fairness when generating contracts (should now give appropriate consideration to all contract packs).Fix errors in Tourism contract pack introduced by 0.7.13.Minor bug fixes. Quote Link to comment Share on other sites More sharing options...
severedsolo Posted April 18, 2015 Share Posted April 18, 2015 (edited) So I used hideChildren for the first time, but it seems to have missed some? It's hidden what parts I'm looking for, but still says that I'm looking for parts. Is this intentional? It looks a bit silly IMO.I should mention, this seems to be a problem either with using "Any" or "partModule" as the Cupola + Station Docking Port parameters are just looking for one part, and not a module and they work fine. Edited April 18, 2015 by severedsolo Quote Link to comment Share on other sites More sharing options...
nightingale Posted April 18, 2015 Author Share Posted April 18, 2015 Hmm... I'm not 100% clear what you're trying to accomplish on this one. Could you provide your contract cfg and I'll take a look? Also, what is it about the "default" look that you don't like? Is there some other thing I could change or make customizable to make this work for you? Quote Link to comment Share on other sites More sharing options...
severedsolo Posted April 18, 2015 Share Posted April 18, 2015 Cfg is here: https://github.com/severedsolo/KerbinSpaceStation/blob/master/Kerbin/KerbinStationCore.cfgThe thing I don't like specifically about the example above, is that my title says "have a way of generating power" - the modules are removed in the next two lines (as they should be), but it still says "parts" (twice). I would like those two "Parts" lines to also be hidden, and just my title shown instead (as it does for the "Have the Station Core Docking Port" parameter, and the "Include a cupola" parameter.This is what it looks like with no hideChildren lines:This is ALOT of information, and most of it is duplicated. For example, my title is "Have a way of generating power" - I don't then need "with module Deployable solar panel" or "with module Generator"Or: "Have the Station Core Docking Port on board."CC then inserts "with type: Station Core Docking Port" + "Count: At least 1" - Duplicated information.In an ideal world, if I choose to use hideChildren - I would like everything under the "title" to be removed.The thing is though (and I know I'm being awkward now), sometimes I LIKE those lines. Orbit for example - it's handy to have that, rather than me needing to spell it out in the title. I guess I just want the option to choose. Quote Link to comment Share on other sites More sharing options...
nightingale Posted April 18, 2015 Author Share Posted April 18, 2015 Agree on all points - just wanted to make sure there wasn't other changes that might've been acceptable here. I'll take a look at this as soon as I can today. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.