Jump to content

Modding Stock contracts?


stryth

Recommended Posts

I don't know if anyone's addressed this before, but does anyone know if there's a way to make the stock satellite contracts look for a science parts experiment id, instead of it's name? i want to be able to use modded science juniors and goo cans to fill those req's.

Link to comment
Share on other sites

It can look for module names instead of part name,in this case "ModuleScienceExperiment".But if you choose to use this method,it will accept any part with the same module name (thermometer,barometer...).You can always change stock part names with yours.

Link to comment
Share on other sites

On 9/12/2015 11:03:17, stryth said:

I don't know if anyone's addressed this before, but does anyone know if there's a way to make the stock satellite contracts look for a science parts experiment id, instead of it's name? i want to be able to use modded science juniors and goo cans to fill those req's.

I have this problem too and I asked about it several times but still don't have a good solution. So if you find one I'd be glad to know about it. I want to do the same thing as you. Right now my only solution is a really bad one. I have a Module Manager patch that deletes all the PART_REQUEST from contracts.cfg and then recreates them by using my mod's part ID. It is a very bad solution because the stock parts don't work anymore to fulfill the contracts. Furthermore it doesn't allow other mods to add to that list. For some reason it seems like the game doesn't allow to create a list of parts ID that would fulfill the request. Only one part ID is acceptable to my knowledge ( I hope I m wrong and there is a way though) If you want to see how this bad solution would look, it is in  the spoiler below. 

Spoiler

@Contracts
{
	@Satellite
	{
		!PART_REQUEST,* { }
		
		PART_REQUEST // A potential OctoSat mystery goo request for satellites
		{
			Article = a // Article (A/An) to be used prior to part description
			PartDescription = OctoSat mystery goo unit // Plain speech description of part for request
			VesselDescription = satellite // Plain speech description of vessel for request
			Keyword = Scientific // Contract briefing keyword
			Part = OctoSat_Sc_Goo // A part ID that triggers this request
			MinimumScience = 7 // A minimum value this request places on science rewards
			Trivial // Easy Contracts
			{
				Weight = 5 // How common this request is in easy contracts
				FundsMultiplier = 1.05 // The multiplier this request places on funds in easy contracts
				ScienceMultiplier = 1.25 // The multiplier this request places on science in easy contracts
				ReputationMultiplier = 1.05 // The multiplier this request places on reputation in easy contracts
			}
			Significant // Medium Contracts
			{
				Weight = 15 // How common this request is in medium contracts
				FundsMultiplier = 1.05 // The multiplier this request places on funds in medium contracts
				ScienceMultiplier = 1.25 // The multiplier this request places on science in medium contracts
				ReputationMultiplier = 1.05 // The multiplier this request places on reputation in medium contracts
			}
			Exceptional // Hard Contracts
			{
				Weight = 25 // How common this request is in hard contracts
				FundsMultiplier = 1.05 // The multiplier this request places on funds in hard contracts
				ScienceMultiplier = 1.25 // The multiplier this request places on science in hard contracts
				ReputationMultiplier = 1.05 // The multiplier this request places on reputation in hard contracts
			}
		}
	}
}

Part ID is the line to replace. And it is to repeat for each PART REQUEST of course as there is a line that deletes them all first.

On 9/12/2015 20:22:54, sebi.zzr said:

It can look for module names instead of part name,in this case "ModuleScienceExperiment".But if you choose to use this method,it will accept any part with the same module name (thermometer,barometer...).You can always change stock part names with yours.

I can't seem to find how this would work. There is some module definitions at the beginning of contracts.cfg but then it seems to be hardcoded when those are called.. There are some more module information in the PART REQUEST but they are coupled with part ID. And technically it wouldn't have to be ModuleScienceExperiment that is the same for all science experiments? If possible why not use ModuleEnviroSensor with sensorType defining the experiment: ACC, PRES, TEMP, GRAV.

So is this module request possible in the cfg file or it needs to be a plug in? Do you have examples?

I can only find PART REQUEST, RESOURCE REQUEST and CREW REQUEST in the cfg file.

Edited by Nookos
Link to comment
Share on other sites

This is stock part request:

PART_REQUEST // A potential mystery goo request for satellites
{
Article = a // Article (A/An) to be used prior to part description
PartDescription = mystery goo unit // Plain speech description of part for request
VesselDescription = satellite // Plain speech description of vessel for request
Keyword = Scientific // Contract briefing keyword
Part = GooExperiment // A part ID that triggers this request
MinimumScience = 7 // A minimum value this request places on science rewards
}

you can change the part name with your own part name

Part = mypartname

it must match the name from part.cfg

PART
{
	name = mypartname
	module = Part
}

or,instead of using part's name,you can use the name of its module:

PART_REQUEST // A potential mystery goo request for satellites
{
Article = a // Article (A/An) to be used prior to part description
PartDescription = mystery goo unit // Plain speech description of part for request
VesselDescription = satellite // Plain speech description of vessel for request
Keyword = Scientific // Contract briefing keyword
Module = ModuleScienceExperiment // A part ID that triggers this request
MinimumScience = 7 // A minimum value this request places on science rewards
}

again,the name of module is in part.cfg

MODULE
{
	name = ModuleScienceExperiment
	experimentID = mysteryGoo
}

the contract will still ask you to have mystery goo onboard,but you can fulfil the request with any part that have this module (MaterialBay,sensorAccelerometer,sensorBarometer...)

You can edit this directly in KSP_win/GameData/Squad/Contracts/Contracts.cfg or via MM patch.

Edited by sebi.zzr
Link to comment
Share on other sites

Thanks indeed that 'works'. It is actually very suitable for the survey scanner because that one has an unique module.

Let's just hope squad makes it possible one day for mod maker to add their part ID alongside the stock ones. 

Just in case others are interested, I tried to add the following lines ( sensorType, experimentID) with and/or without the (Module =..) line and it failed to narrow the requirements.

 

 

Edited by Nookos
Link to comment
Share on other sites

Indeed,it would be much more suitable to look for experimentID instead of part's name.

I also tried to narrow down the requirements(30-40 variants),but with no avail.Those are the only things that worked.Maybe there are other ways that are already implemented,but because of lack documentation we have to wait for SQUAD to show us how to do it.

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