Jump to content

[1.2.2] Contract Pack: Clever Sats 1.4 (13/12/2016)


severedsolo

Recommended Posts

I know this mod doesn't officially support 1.10.1, but I'm wondering if this issue can be fixed on my side or if I should report it to Contract Configurator. I encounter lots of errors like this one:

  Reveal hidden contents

"09153 Olympus 9" is a name of my vessel. Apparently, the mod doesn't like that it has spaces in the name and throws an exception. As a result, I also don't get CleverSatProbeMalfunction contracts.

Link to comment
Share on other sites

  • 3 months later...

Apologies for resurrecting this, but it's the closest to what I am looking for.  This wonderful pack generates contracts to destroy Sats deployed only by this agency.  What of the below should I tweak to have the pack generate contracts to destroy only vessels labelled as debris, thank you.

    CONTRACT_TYPE
{
    name = CleverSatRogueAI
    title = Destroy a rogue satellite
    group = CleverSat
    description = It seems that @/Sat has gone rogue. We need to terminate it.
    genericDescription = One of our satellites has gone rogue. We need to terminate it.
    targetBody = @/Sat.CelestialBody()
    synopsis = Destroy the rogue satellite.
    completedMessage = Crisis averted. Good job.
    rewardFunds = Random(20000,40000)
    rewardReputation = Random(1.0, 2.0)
    maxSimultaneous = 1

    DATA
    {
    type = Vessel    
    Sat = $badSat
    title = One of your satellites must have gone rogue.
    }
    
    PARAMETER
    {
        name = DestroySat
        type = VesselParameterGroup
        vessel = @/Sat
        
        PARAMETER
        {
            name = VesselDestroyed
            type = VesselDestroyed
            title = Destroy @/Sat. With extreme prejudice.
        }
    }
}

Link to comment
Share on other sites

  On 2/20/2021 at 11:02 AM, WhitestWizard said:

What of the below should I tweak to have the pack generate contracts to destroy only vessels labelled as debris, thank you.

Expand  

This is more a question for the Contract Configurator thread, but I'll give you a start:

You'd need to rewrite the DATA node (warning - this has been done from memory so syntax might be wrong, check the Contract Configurator Wiki)
 

DATA
    {
    type = Vessel    
    debrisTarget = AllVessels().Where(v => v.VesselType() == Debris).Random()
    title = //flavour text
    }

That will grab any vessel that has been marked as debris, you would then target the DATA node using @/debrisTarget

You probably don't want to use .Random() though as that will duplicate contracts. What you probably want is a uniqueness check - which you can read all about here: https://github.com/jrossignol/ContractConfigurator/wiki/Data-Node

Link to comment
Share on other sites

  • 3 weeks later...

Hey, I have a question. I have the Stayputnik probe, Solar panels unlocked and the rng is liking me. But it says that I have the Stayputnik probe requirement as unmet for some reason. I don't know if this is because I'm playing with Unkerballed Start or what, but is this some sort of bug?
screenshot5.png
screenshot6.png

Link to comment
Share on other sites

Interesting...

My installation showed the exact same error (didn't pay attention to these contracts for a while, and didn't notice earlier).

The KSP.log showed

[ERR 11:43:45.063] ContractConfigurator.PartUnlockedRequirement: CONTRACT_TYPE 'CleverSatCore', REQUIREMENT 'Probe' of type 'PartUnlocked': Error parsing part

plus

  Reveal hidden contents

Thought to myself, maybe it's due me to purging the old Stayputnik part? I changed the MM patch to

  Reveal hidden contents

and, tatah (wonders of world of tech), now it looks:

Kerbal-Space-Program-2021-03-10-11-51-26

 

Link to comment
Share on other sites

  On 3/10/2021 at 10:46 AM, FabioofSpace said:

Hey, what do I have to correct in line 19? Cause I don't understand what you mean with "(a closing bracket too much)"

Expand  

Count the brackets.

    excludeTargets = $ConstellationList.Add(Target).Where(g => Vessel(g).IsOrbiting() && Vessel(g).Orbit().Inclination() < incThreshold))

should read

    excludeTargets = $ConstellationList.Add(Target).Where(g => Vessel(g).IsOrbiting() && Vessel(g).Orbit().Inclination() < incThreshold)

OK?

Edited by VoidSquid
Link to comment
Share on other sites

  On 3/10/2021 at 10:52 AM, VoidSquid said:

Interesting...

My installation showed the exact same error (didn't pay attention to these contracts for a while, and didn't notice earlier).

The KSP.log showed

[ERR 11:43:45.063] ContractConfigurator.PartUnlockedRequirement: CONTRACT_TYPE 'CleverSatCore', REQUIREMENT 'Probe' of type 'PartUnlocked': Error parsing part

plus

  Reveal hidden contents

Thought to myself, maybe it's due me to purging the old Stayputnik part? I changed the MM patch to

  Reveal hidden contents

and, tatah (wonders of world of tech), now it looks:

Kerbal-Space-Program-2021-03-10-11-51-26

 

Expand  

I applied all the patches, but strangely it is still not showing. Is this because I'm on 1.11? screenshot11.png

Link to comment
Share on other sites

Don't know (I'm using KSP 1.10.1.), but I doubt it.

What does your MM patch read?

Mine now is:

  Reveal hidden contents

And anything regarding CleverSatCore in your KSP.log?

Link to comment
Share on other sites

  On 3/10/2021 at 12:13 PM, VoidSquid said:

Don't know (I'm using KSP 1.10.1.), but I doubt it.

What does your MM patch read?

Mine now is:

  Reveal hidden contents

And anything regarding CleverSatCore in your KSP.log?

Expand  
  Reveal hidden contents
  Reveal hidden contents

This is all I found from the logs and the patch

Link to comment
Share on other sites

@VoidSquid It's been a while since I wrote the patch to include the probe_v2 core into the contract pack and maybe something changed since then so please correct me if I'm wrong but a node of the type "any" like this:

REQUIREMENT
{
	name = Any
	type = Any
	[...]
}

should fulfill the requirement once ANY of them is met...right? 
IIRC that's the reason why I was able to include the kopernicus solar panels without checking if these are actually enabled in the config since it is not necessary to use the kopernicus solarpanels, just because kopernicus is installed.

So, if I'm right, there should be no difference in the result between your edited version of my patch and my original. So, I've got a question for you: do you use kopernicus in your game installed you've used to test this?

As far as I can tell, the issue is actually the missing "s" at the end of "KopernicusSolarPanel", so it should be "KopernicusSolarPanels". Obviously, this issue will not affect you without kopernicus installed.

I swear my patch used to work when I wrote it, so maybe there was an actual change to the name of the partmodule or I actually messed it up and never ever noticed for whatever reason.

Anyway, TLDR ( @FabioofSpace that's the important part for you as well): add an "s" the kopernicus partmodule so it says:

partModule = KopernicusSolarPanels

or if you prefer the whole patch:

//Add revamped probe core to the cleversat contract pack
//Add Kopernicus solarpanel if available
@CONTRACT_TYPE[CleverSatCore]:FINAL
{
	!REQUIREMENT[Probe] {}
	
	REQUIREMENT
	{
		name = Any
		type = Any
		
		REQUIREMENT
		{
			name = Probe
			type = PartUnlocked
			part = probeCoreSphere
		}
		
		REQUIREMENT
		{
			name = Probe_v2
			type = PartUnlocked
			part = probeCoreSphere_v2
		}
	}
	
	@REQUIREMENT[Any]:HAS[@REQUIREMENT[PartModuleUnlocked]]:NEEDS[Kopernicus]
	{
		REQUIREMENT
		{
			name = PartModuleUnlocked
			type = PartModuleUnlocked
			partModule = KopernicusSolarPanels
		}
	}
}

 

Link to comment
Share on other sites

This:

[ERR 12:22:23.944] ContractConfigurator.PartModuleUnlockedRequirement: CONTRACT_TYPE 'CleverSatCore', REQUIREMENT 'PartModuleUnlocked' of type 'PartModuleUnlocked': A validation error occured while loading the key 'partModule' with value 'System.Collections.Generic.List`1[System.String]'.

Is it possible that any mod you have replaces/removes the part?

  On 3/10/2021 at 12:56 PM, 4x4cheesecake said:

so please correct me if I'm wrong

Expand  

Can only say that it works fine for me, after changing the patch to ignore the non-v2 part, as I purged the old Stayputnik v1 via JC.

See the screenshot in my earlier post.

Link to comment
Share on other sites

  On 3/10/2021 at 12:57 PM, VoidSquid said:

Can only say that it works fine for me, after changing the patch to ignore the non-v2 part, as I purged the old Stayputnik v1 via JC.

Expand  

Oh, you purged it via JC that actually makes sense to break then, for the same reason it breaks on the KopernicusSolarPanels: CC still looks for the part/partmodule and will throw an exception if it doesn't find it. Usually the part is just hidden and still accessible but purging via JC completely removes it from the game.

Now I understand why it works for you but still, that should only be the case if you don't have kopernicus installed because the missing "s" is still a thing. Would you mind to satisfy my curiosity and tell me if you run kopernicus on the install you've tried this?

Link to comment
Share on other sites

  

  On 3/10/2021 at 1:13 PM, 4x4cheesecake said:

you purged it via JC that actually makes sense to break then

Expand  

Yepp, and hence removing the respective lines did fix it for me.

I'm wondering if maybe @FabioofSpace also might have purged a specific part?

 

  On 3/10/2021 at 1:13 PM, 4x4cheesecake said:

Would you mind to satisfy my curiosity

Expand  

If you're asking so nicely, I actually would :D

No Kopernicus here.

Edited by VoidSquid
Link to comment
Share on other sites

Still have to wonder though, my error caused by a non existent part was  

  On 3/10/2021 at 10:52 AM, VoidSquid said:

[ERR 11:43:45.063] ContractConfigurator.PartUnlockedRequirement: CONTRACT_TYPE 'CleverSatCore', REQUIREMENT 'Probe' of type 'PartUnlocked': Error parsing part

Expand  

while @FabioofSpace got

  On 3/10/2021 at 12:57 PM, VoidSquid said:

[ERR 12:22:23.944] ContractConfigurator.PartModuleUnlockedRequirement: CONTRACT_TYPE 'CleverSatCore', REQUIREMENT 'PartModuleUnlocked' of type 'PartModuleUnlocked': A validation error occured while loading the key 'partModule' with value 'System.Collections.Generic.List`1[System.String]'.

Expand  

Similar, but not identical. You think it could be because of the Kopernicus typo, @4x4cheesecake ?

Edited by VoidSquid
Link to comment
Share on other sites

  On 3/10/2021 at 1:18 PM, VoidSquid said:

If you're asking so nicely, I actually would :D

No Kopernicus here.

Expand  

Well, thank you very much. In this case, the mystery is solved :)

Regarding the missing "s": This was actually correct for kopernicus for KSP 1.6, back in 2019 when I wrote this patch, I've doubled checked the old kopernicus version on github. So at least I'm not completely dumb and missed a major issue in my own patch, but this need to be changed for KSP 1.8+ to include the "s" :)

  On 3/10/2021 at 1:28 PM, VoidSquid said:

Similar, but not identical.

Expand  

Yes, because it was a missing part for you and it is a missing partmodule for @FabioofSpace ;)

Take a close look at the contract requirements: for the probe core, it says:

type = PartUnlocked

but for the solar panels, it is:

type = PartModuleUnlocked

It makes sense to differentiate between parts and partmodules here, since you will have multiple parts which utilize the same partmodule (for the solar panels) but you will always just have a single part with this specific name (for the probe core).

For each contract, CC checks the list of requirements and looks them up in the game database. In your case, it was a missing part since you purged it via JC, in the other case it's the missing partmodule or more specific, the wrong name so CC wasn't able to find it.

Edited by 4x4cheesecake
Link to comment
Share on other sites

Changes and dependencies, who doesn't love it... ;) 

As you obviously know and understand way more of MM stuff than I do, any idea about @FabioofSpace 's error message?

What I found was this

https://github.com/Kopernicus/Kopernicus/issues/451

If I'm not mistaken, this is the exact "s"-error, isn't it?

@4x4cheesecake Excellent! I think the mysteries are solved then:

1. If you purge a part, remove the checks for that part

2. If you're using Kopernicus 1.8+, add a "s" to the respective line in the MM patch :)

Everyday to learn something new and solve another little mystery, thanks :) 

Edited by VoidSquid
Link to comment
Share on other sites

Well, it seems to now work. Which is great! 

Though I have an another question. Why do the one star contracts take place in High orbits such as 799.212 km? I have always wondered that.

Link to comment
Share on other sites

  

  On 3/10/2021 at 1:56 PM, FabioofSpace said:

Well, it seems to now work. Which is great! 

Expand  

You're welcome, glad we could help :)

  

  On 3/10/2021 at 1:56 PM, FabioofSpace said:

Why do the one star contracts take place in High orbits such as 799.212 km? I have always wondered that.

Expand  

That would be a question for the mod author. :) 

I think though, that altitude is not a difficult thing to do (just some more dv, isn't it?), correct inclination and LAN are more difficult.

Edited by VoidSquid
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...