Jump to content

[1.10.1+] Contract Configurator [v1.30.5] [2020-10-05]


nightingale

Recommended Posts

Is it possible to add MM checking to PartValidation?

            PARAMETER
            {
                name = PartValidation
                type = PartValidation:!NEEDS[RemoteTech]
                title = each having a transmitter
                
                partModule = ModuleDataTransmitter            
                minCount = 2
                
                disableOnStateChange = true
                hideChildren = true
                
            }
            
            PARAMETER
            {
                name = PartValidation
                type = PartValidation:NEEDS[RemoteTech]
                title = each having a transmitter
                
                partModule = ModuleRTAntenna    
                minCount = 2
                
                disableOnStateChange = true
                hideChildren = true
                
            }

 

 I found that RT renames the module from ModuleDataTransmitter to ModuleRTAntenna and I need to check for this. The above though doesn't seem to pass the CC debug reload:

[Error]: ContractConfigurator.ParameterFactory: CONTRACT_TYPE 'CoastGuard-DropBuoys',PARAMETER 'PartValidation' of type 'PartValidation:NEEDS[RemoteTech]': Unknown parameter 'PartValidation:NEEDS[RemoteTech]'.

 

Is there a way to check for either or without resorting to an Any set parameter?

 

edit: im such a dufus. nevermind.  PARAMETER:NEEDS argh.

Edited by inigma
Link to comment
Share on other sites

37 minutes ago, inigma said:

Is it possible to add MM checking to PartValidation?

<snip>

edit: im such a dufus. nevermind.  PARAMETER:NEEDS argh.

Yup.  Here's a bit from Tourism that also handles AntennaRange (and the bizzare combination of both RemoteTech + AntennaRange), you may be able to do something similar without having to completely duplicate the blocks:

// RemoteTech changes the antenna module, so change it in our config too to
// support RemoteTech installs.
@CONTRACT_TYPE[Tourism_Casino]:FOR[Tourism]:NEEDS[RemoteTech]
{
    @PARAMETER[VesselParameterGroup]
    {
        @PARAMETER[AntennaPart]
        {
            @partModule = ModuleRTAntenna
        }
    }
}

// AntennaRange changes the antenna module, so change it in our config too to
// support AntennaRange installs.
@CONTRACT_TYPE[Tourism_Casino]:FOR[Tourism]:NEEDS[AntennaRange&!RemoteTech]
{
    @PARAMETER[VesselParameterGroup]
    {
        @PARAMETER[AntennaPart]
        {
            @partModule = ModuleLimitedDataTransmitter
        }
    }
}

 

Edited by nightingale
Link to comment
Share on other sites

2 hours ago, nightingale said:

Yup.  Here's a bit from Tourism that also handles AntennaRange (and the bizzare combination of both RemoteTech + AntennaRange), you may be able to do something similar without having to completely duplicate the blocks:


// RemoteTech changes the antenna module, so change it in our config too to
// support RemoteTech installs.
@CONTRACT_TYPE[Tourism_Casino]:FOR[Tourism]:NEEDS[RemoteTech]
{
    @PARAMETER[VesselParameterGroup]
    {
        @PARAMETER[AntennaPart]
        {
            @partModule = ModuleRTAntenna
        }
    }
}

// AntennaRange changes the antenna module, so change it in our config too to
// support AntennaRange installs.
@CONTRACT_TYPE[Tourism_Casino]:FOR[Tourism]:NEEDS[AntennaRange&!RemoteTech]
{
    @PARAMETER[VesselParameterGroup]
    {
        @PARAMETER[AntennaPart]
        {
            @partModule = ModuleLimitedDataTransmitter
        }
    }
}

 

I do run into a slight problem with this - and I am sure your players would too: CKAN does not remove the directory when a mod such as RemoteTech is uninstalled. This causes MM to still see the RemoteTech folder, and thus for MM to apply the patch to the contract, and then causes CC to fail loading the contract since that part does not exist.

I then tried:

@CONTRACT_TYPE[CoastGuard-DropBuoys]:FOR[KSC?Coast?Guard]:NEEDS[RemoteTech]:HAS[@MODULE[ModuleRTAntenna]]

as the condition for applying the patch

but it was to no avail though. This was my best attempt for MM to check if there is a RemoteTech folder in GameData, to also then check if there is a ModuleRTAntenna module available, and only then apply the patch.  But apparently my syntax is wrong (possible, it's almost 2 am) and MM thinks ModuleRTAntenna exists and thus applying the patch, since the patch still gets applied when seeing the RemoteTech folder and then CC fails loading contract since the part does not exist.

I did various combinations to simplify the check, using just the HAS or removing the NEEDS and FOR, but again, to no avail. Same result, the patch is always applied, until I delete the RemoteTech folder manually. Lots of fun. 


Edit:

4 excruciating hours trying to figure this out (why am i beating my head over a CKAN issue?). I gave up on it and decided to just remove the antenna check to avoid GAP requiring MM for anything.

Edited by inigma
Link to comment
Share on other sites

6 hours ago, inigma said:

I do run into a slight problem with this - and I am sure your players would too: CKAN does not remove the directory when a mod such as RemoteTech is uninstalled. This causes MM to still see the RemoteTech folder, and thus for MM to apply the patch to the contract, and then causes CC to fail loading the contract since that part does not exist.

I then tried:

@CONTRACT_TYPE[CoastGuard-DropBuoys]:FOR[KSC?Coast?Guard]:NEEDS[RemoteTech]:HAS[@MODULE[ModuleRTAntenna]]

as the condition for applying the patch

but it was to no avail though. This was my best attempt for MM to check if there is a RemoteTech folder in GameData, to also then check if there is a ModuleRTAntenna module available, and only then apply the patch.  But apparently my syntax is wrong (possible, it's almost 2 am) and MM thinks ModuleRTAntenna exists and thus applying the patch, since the patch still gets applied when seeing the RemoteTech folder and then CC fails loading contract since the part does not exist.

I did various combinations to simplify the check, using just the HAS or removing the NEEDS and FOR, but again, to no avail. Same result, the patch is always applied, until I delete the RemoteTech folder manually. Lots of fun. 


Edit:

4 excruciating hours trying to figure this out (why am i beating my head over a CKAN issue?). I gave up on it and decided to just remove the antenna check to avoid GAP requiring MM for anything.

You're on the Contract Configurator thread, trying figure out how to use Module Manager to work around a CKAN or RemoteTech bug. :)

I would start with CKAN. I'm guessing though that there is something left in the directory so it's not empty. If it's something you had added, problem solved. If it's something generated by RemoteTech as part of normal operation, then RemoteTech needs to change, or CKAN needs a mechanism to handle it. 

All up, I wouldn't use this as a reason to not use Module Manager, as it seems like quite the edge case. 

Link to comment
Share on other sites

In my RO/RSS/RP-0 game, I'm running the "Moon/1" landing contract.  The craft I used was basically the "FASA Saturn V Apollo Lunar" that comes with RO, though I did make a couple of tweaks to it. I've already flown the CSM+LM to the moon and landed the LM in the correct biome.  My mission timer says I've effectively completed the mission.  Now all I need to do is separate the Ascent stage from the Descent, rendezvous with the CSM, fly home and spash down.  Trouble is, every time I decouple the Ascent stage to take off, the timer is mission timer is resetting itself.  After a bit of trial and error, I think the problem stems from the fact that the LM is built backwards.  I.E., to build the LM "under" the CSM on the Saturn V, you put a decoupler into the "FASASaturnSLA", then attach the descent engine, then the descent stage, then the decoupler ring, then the ascent engine and then the ascent stage (plus landing gear and such).  So when you look at the VESSEL in your save game, the first part listed is the Descent Engine.  From what I can tell, when you activate the decoupler ring, the parts below it on the original vessel (in this case the Ascent Engine, Ascent Stage, LM Antenna and my science stuff) become a new vessel and the contract's completion status doesn't link to this "new" vessel.  Is there any way to make it so that contact status applies to the main vessel plus any vessels that "break off" from the main?

Link to comment
Share on other sites

7 hours ago, chrisl said:

In my RO/RSS/RP-0 game, I'm running the "Moon/1" landing contract.  The craft I used was basically the "FASA Saturn V Apollo Lunar" that comes with RO, though I did make a couple of tweaks to it. I've already flown the CSM+LM to the moon and landed the LM in the correct biome.  My mission timer says I've effectively completed the mission.  Now all I need to do is separate the Ascent stage from the Descent, rendezvous with the CSM, fly home and spash down.  Trouble is, every time I decouple the Ascent stage to take off, the timer is mission timer is resetting itself.  After a bit of trial and error, I think the problem stems from the fact that the LM is built backwards.  I.E., to build the LM "under" the CSM on the Saturn V, you put a decoupler into the "FASASaturnSLA", then attach the descent engine, then the descent stage, then the decoupler ring, then the ascent engine and then the ascent stage (plus landing gear and such).  So when you look at the VESSEL in your save game, the first part listed is the Descent Engine.  From what I can tell, when you activate the decoupler ring, the parts below it on the original vessel (in this case the Ascent Engine, Ascent Stage, LM Antenna and my science stuff) become a new vessel and the contract's completion status doesn't link to this "new" vessel.  Is there any way to make it so that contact status applies to the main vessel plus any vessels that "break off" from the main?

Yup, you've pretty much hit the nail on the head.  This is one of the cases where I'm not doing anything special with vessel tracking, KSP just decides on its own what part of the vessel should be the "main" part and which part is then the debris/lander/whatever when you decouple/undock.  I'll have to give some thought as to the fix here, if there is an easy one.  Raised [#467].

Link to comment
Share on other sites

Another big meaty release: download here.

Contract Configurator 1.9.5

  • Output additional log files when log level is debug or higher (thanks linuxgurugamer).
  • VesselParameterGroup now supports a defineList attribute to add a vessel to a list on contract completion.
  • PartValidation module checks now check the parent type.  This allows mod-introduced PartModules that inherit from stock ones to count for PartValidation checks that look for the stock module (eg. ModuleEnginesFX = ModulesEngines).
  • Added SubAssembly as a valid option for CopyCraftFile.craftType.
  • Added NewKerbals() methods to generate lists of Kerbals.
  • AwardExperience now supports awarding experience directly to Kerbals (instead of via a VesselParameterGroup).
  • Limited the impact of a problem where the final Anomaly Surveyor contract causes revert to editor to leave a vessel on the pad (thanks lodestar).
  • Fixed problem introduced in 1.9.4 where all waypoints without a name get called "site" (thanks smjjames).
  • Fixed issue where Kerbal spawning behaviours didn't clean up properly when the Kerbal was in a command chair (thanks inigma & nobodyhasthis2).
  • Fixed issue with Expression requirement bleeding through between different contracts (thanks Yemo, smjjames and nobodyhasthis2).
  • Added logic to prevent duplicate Kerbal names from coming up in the same (or recent) contracts.
  • Fixed issue with VesselParameterGroup where the vessel wasn't set correctly when loading a Kerbal into an EVA seat triggered the completion (thanks inigma).
  • Minor bug fixes.
Link to comment
Share on other sites

Another awesome release! Thank you! I am looking forward to using the new NewKerbals() and SubAssemblies features.

Some questions:

1. Can you give me a use case for defineList?

2. What do you think of this pioneering contract I've been working on:  (btw, I've play tested it and it works very well, and am looking for testers before releasing it)

calling @BahamutoD and @selfish_meme

Link to comment
Share on other sites

1 hour ago, inigma said:

Another awesome release! Thank you! I am looking forward to using the new NewKerbals() and SubAssemblies features.

Some questions:

1. Can you give me a use case for defineList?

2. What do you think of this pioneering contract I've been working on:  (btw, I've play tested it and it works very well, and am looking for testers before releasing it)

calling @BahamutoD and @selfish_meme

While I like the idea, and the idea of your contract pack I have never had a desire to play career. Sorry.

Link to comment
Share on other sites

8 hours ago, inigma said:

1. Can you give me a use case for defineList?

Have a look at the recent Tourism release - I use it for the repeatable Hotel/Casino tourism contracts to create lists of vessels that are either casinos or hotels.

Other ideas - use it to track satellites that are launched for a GPS or RemoteTech constellation, and then provide some sort of follow up contract (eg. replace faulty satellite).  Or closer to your bread and butter, you can use to track all the navigation buoys and then have a contract that requires visiting them in a randomized order (Vessel.Location() can be used to create a waypoint).

8 hours ago, inigma said:

2. What do you think of this pioneering contract I've been working on:  (btw, I've play tested it and it works very well, and am looking for testers before releasing it)

calling @BahamutoD and @selfish_meme

Haha, very cute!  You should release it and see if @illectro will stream playing it while "Stream Hack 2016" is still relevant news.

Link to comment
Share on other sites

This may be answered upthread already but It's a lot of reading to slog through:

AVC claims that ContractConfigurator is now up to version 1.9.5.  But CKAN still only has it at 1.9.4.1 so in order to obtain it and make the AVC complaint go away I have to go outside of CKAN to do it.  Is that deliberate?  Is 1.9.5 just an alpha release that's being kept off CKAN deliberately or is this a mistake that it's not on there?

 

Edited by Steven Mading
Link to comment
Share on other sites

1 hour ago, Steven Mading said:

This may be answered upthread already but It's a lot of reading to slog through:

AVC claims that ContractConfigurator is now up to version 1.9.5.  But CKAN still only has it at 1.9.4.1 so in order to obtain it and make the AVC complaint go away I have to go outside of CKAN to do it.  Is that deliberate?  Is 1.9.5 just an alpha release that's being kept off CKAN deliberately or is this a mistake that it's not on there?

 

CKAN meta-files look like they got updated correctly after release, so should be working correctly on CKAN.  Make sure to hit the refresh button in CKAN.  I don't know much beyond that on the client side, so you'll have to look to the CKAN folk for support if that doesn't do it.

Link to comment
Share on other sites

1 hour ago, nightingale said:

CKAN meta-files look like they got updated correctly after release, so should be working correctly on CKAN.  Make sure to hit the refresh button in CKAN.  I don't know much beyond that on the client side, so you'll have to look to the CKAN folk for support if that doesn't do it.

I hit the refresh before issuing the report just to be sure.

But, just now to be really sure I wiped CKAN entirely, re-installed it from scratch, and now it's showing up.  Refresh wasn't working for some reason.  Not your problem then.  Never mind.

Edited by Steven Mading
Link to comment
Share on other sites

39 minutes ago, renoplane said:

Thanks,  I've edited it now. 

Looks like you've got a CONTRACT_TYPE with a missing/blank name field.  I've fixed the code so it won't fall over in that case, but for the moment I have no way of telling where it came from.  If you have a look in the GameData/ModuleManager.ConfigCache, and search for CONTRACT_TYPE you might be able to tell where the issue is (or just post up the file and I'll take a look).  That being said, it looks like you might not even have Module Manager installed, which is needed for many (if not all) contract packs to work properly.

Link to comment
Share on other sites

@nightingale- Well, I seem to have fixed it. I did some testing, and found the contract making problems. I still don't know exactly what caused it, but I fixed some syntax errors in that contract and it worked fine after that. Everything has been going well since, thanks for your help!

Edited by renoplane
Link to comment
Share on other sites

Is it possible to have the generated waypoints take into account the slope of the terrain? Because I was forced to cancel a survey contract (I think it was the stock one) because I was having trouble getting to a cluster of waypoints that were on a very steep hillside.

Link to comment
Share on other sites

56 minutes ago, smjjames said:

Is it possible to have the generated waypoints take into account the slope of the terrain? Because I was forced to cancel a survey contract (I think it was the stock one) because I was having trouble getting to a cluster of waypoints that were on a very steep hillside.

Hypothetically possible, but computationally expensive, because it requires sampling points around the selected point.  More importantly, that data isn't loaded by KSP until you have a vessel pretty much right there, so it means that you'd have do really expensive queries to the PQS to actually get that information at the time a contract is being generated.

Link to comment
Share on other sites

On ‎2‎/‎3‎/‎2016 at 10:01 PM, nightingale said:

Another big meaty release: download here.

Contract Configurator 1.9.5

  • Output additional log files when log level is debug or higher (thanks linuxgurugamer).
  • VesselParameterGroup now supports a defineList attribute to add a vessel to a list on contract completion.
  • PartValidation module checks now check the parent type.  This allows mod-introduced PartModules that inherit from stock ones to count for PartValidation checks that look for the stock module (eg. ModuleEnginesFX = ModulesEngines).
  • Added SubAssembly as a valid option for CopyCraftFile.craftType.
  • Added NewKerbals() methods to generate lists of Kerbals.
  • AwardExperience now supports awarding experience directly to Kerbals (instead of via a VesselParameterGroup).
  • Limited the impact of a problem where the final Anomaly Surveyor contract causes revert to editor to leave a vessel on the pad (thanks lodestar).
  • Fixed problem introduced in 1.9.4 where all waypoints without a name get called "site" (thanks smjjames).
  • Fixed issue where Kerbal spawning behaviours didn't clean up properly when the Kerbal was in a command chair (thanks inigma & nobodyhasthis2).
  • Fixed issue with Expression requirement bleeding through between different contracts (thanks Yemo, smjjames and nobodyhasthis2).
  • Added logic to prevent duplicate Kerbal names from coming up in the same (or recent) contracts.
  • Fixed issue with VesselParameterGroup where the vessel wasn't set correctly when loading a Kerbal into an EVA seat triggered the completion (thanks inigma).
  • Minor bug fixes.

Can't seem to find any information in the Docs about the AwardExperience command.

Link to comment
Share on other sites

Would installing contract packs cause this to happen when I try to launch a vessel? It looks like there's no vessel loaded and it focuses on the sun when I go to map view. The space center view looks normal but there's some weirdness inside the SPH and VAB. Never had this happen before, it started after I installed a few contract packs (Tourism plus, field research, bases, and GAP). The tourist waypoints were also in weird places and not where they said they were.  It's like they were shifted west about a km or so. Restarting KSP fixes it for one launch but anything I do after that appears to be bugged.

 

Edited by oniontrain
Link to comment
Share on other sites

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...