Jump to content

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


nightingale

Recommended Posts

2 hours ago, nightingale said:

#404'd

I'll have to give it some thought.  Ideally I'd like it to be smart enough to just silently drop those contracts, but in general those pop-ups are there so when stuff goes pear-shaped there's the possibility to recover.

Out of curiosity, what other side effects did you see from removing the parts?  If the rest of KSP is pretty graceful about it, then I definitely need to do something.

It can be whereever you want - I just didn't expect that you had stuff in ContractPacks/spacetux/ and spacetux/

It turned out to be an issue with some testing I was doing.  It does not happen in the wild, although now that I think about it, I may need to change something for people who install it without CKAN

Link to comment
Share on other sites

4 hours ago, Kerbas_ad_astra said:

Any ships that use removed parts get eaten on first load, and cannot be loaded in the VAB.  If the part in question is a cockpit that is being used as the ship of a stranded Kerbal, that contract fails.  Honestly, you're already being more graceful than stock with that popup!  I had thought that the parameter could be silently dropped, but that only works because my contracts are a one-of-several kind of setup -- it wouldn't work very well if somebody removes a part that is the only way to complete a contract.

I think I may just make it drop the "bad" contract, while still showing the dialog box.  If I do anything more than that, I think there could be bad side effects in other areas (like not knowing when you've put a bad part in your PartValidation in the CONTRACT_TYPE).

1 hour ago, linuxgurugamer said:

That was it.

any chance to get this changed so you can start a string with an expression?

The reason it's like that is that Contract Configurator supports strings in the following forms:

s1 = This is a string
s2 = This is a string with a @variable replacement
s3 = @String + @From + @Variables
s4 = "This is a quoted string" + @with + @variables

So when it sees you string, it thinks it's parsing the s3 scenario above.  I could probably make it smarter, but I really hate going into the parser code since it's so complicated with a high chance of breakage.  Besides, there are workarounds.  I believe either of the following should work for you:

s5 = "@String that starts with a variable"
s6 = @String + " that starts with a variable"

 

Link to comment
Share on other sites

Oh.  ok, that makes sense.  I actually solved it by adding a word in front of the variable on the title line, but will keep the s5/s6 solution in mind.

Thanks

On another note, I'm working on the descriptions for the Rover missions (all of them currently say "visit the interesting place"), once this is done, I hope to release it 

LGG

 

Link to comment
Share on other sites

Question about a list and a data node.

The rover missions have 5 separate titles.  I assume the following will work, but how do I make sure that a2-a5 don't repeat any of the previous ones: 

 

DATA
{
    type = List<string>
    allareas = [ "First string", "Second string", "third string", "4th string", "5th" string ]
    a1 = allareas.Random()
    a2 = allareas.Random()
    a3 = allareas.Random()
    a4 = allareas.Random()
    a5 = allareas.Random()

}
Link to comment
Share on other sites

2 minutes ago, linuxgurugamer said:

Question about a list and a data node.

The rover missions have 5 separate titles.  I assume the following will work, but how do I make sure that a2-a5 don't repeat any of the previous ones: 

 


DATA
{
    type = List<string>
    allareas = [ "First string", "Second string", "third string", "4th string", "5th" string ]
    a1 = allareas.Random()
    a2 = allareas.Random()
    a3 = allareas.Random()
    a4 = allareas.Random()
    a5 = allareas.Random()

}

You are going to get duplicates, because it's picking an entry at random. What you need, is to be able to pick the string you need.

So (untested):

DATA
{
    type = List<string>
    allareas = [ "First string", "Second string", "third string", "4th string", "5th" string ]
    a1 = allareas.ElementAt(0)
    a2 = allareas.ElementAt(1)     
	a3 = allareas.ElementAt(2)     
	a4 = allareas.ElementAt(3)    
	a5 = allareas.ElementAt(4)
}

 

Link to comment
Share on other sites

42 minutes ago, linuxgurugamer said:

Is there anyway to make the wiki searchable?

Nope - take it up with GitHub.  Interestingly enough, there is a chrome extension for GitHub wiki search though (see here).

33 minutes ago, severedsolo said:

You are going to get duplicates, because it's picking an entry at random. What you need, is to be able to pick the string you need.

So (untested):


DATA
{
    type = List<string>
    allareas = [ "First string", "Second string", "third string", "4th string", "5th" string ]
    a1 = allareas.ElementAt(0)
    a2 = allareas.ElementAt(1)     
	a3 = allareas.ElementAt(2)     
	a4 = allareas.ElementAt(3)    
	a5 = allareas.ElementAt(4)
}

 

Also, if you wanted it to be in a random order, you can do:

DATA
{
    type = List<string>
    allareas = [ "First string", "Second string", "third string", "4th string", "5th string" ].Random(5)
    a1 = allareas.ElementAt(0)
    a2 = allareas.ElementAt(1)     
    a3 = allareas.ElementAt(2)     
    a4 = allareas.ElementAt(3)    
    a5 = allareas.ElementAt(4)
}

 

Link to comment
Share on other sites

nightingale,

Ok im on to working on randomizing my distress call contract. It's the one with a ship and two kerbals spawned at a location in the ocean.

I know how to randomize the distress waypoint, but how can I feed that random waypoint info into the location attributes for SpawnVessel and SpawnKerbal so those functions know where to spawn the ship and kerbals at the random waypoint?

Link to comment
Share on other sites

1 hour ago, inigma said:

nightingale,

Ok im on to working on randomizing my distress call contract. It's the one with a ship and two kerbals spawned at a location in the ocean.

I know how to randomize the distress waypoint, but how can I feed that random waypoint info into the location attributes for SpawnVessel and SpawnKerbal so those functions know where to spawn the ship and kerbals at the random waypoint?

Can't dig up the details on this one for you at the moment, will do so tomorrow if you still need support.  The short version is you can use an expression to get the waypoints out of the WaypointGenerator behaviour - look WaypointGenerator on the expressions page on the wiki.  Once you have that you can get the lat/lon/alt from it and feed into other things.  I thought there was an example out there in one of my contract packs, but can't think what it would be at the moment (maybe something in Field Research)

Link to comment
Share on other sites

3 minutes ago, nightingale said:

Can't dig up the details on this one for you at the moment, will do so tomorrow if you still need support.  The short version is you can use an expression to get the waypoints out of the WaypointGenerator behaviour - look WaypointGenerator on the expressions page on the wiki.  Once you have that you can get the lat/lon/alt from it and feed into other things.  I thought there was an example out there in one of my contract packs, but can't think what it would be at the moment (maybe something in Field Research)

I just found it.  Is there a way to extract PQS values from the Waypoint Generator Behavior?

Link to comment
Share on other sites

5 hours ago, severedsolo said:

Quck question - disabledContractType - does this only disable stock contracts? or could I disable (for instance) station science contracts, if I used the name that CC picks up on in the in-game window?

Works for anything using the stock system, including station science

Link to comment
Share on other sites

How would I go about polling a list to see if it contains a specific entry?

Basically, what I want to do, is run through a list of parts on a vessel, and see if they have a specific part (the Station Science Lab specifically).

I've got as far as

DATA
{
type = Vessel
targetVessel1 = AllVessels().Where(v => v.IsOrbiting() && v.VesselType() == Station).Random()
}


DATA
{
type = List<AvailablePart>
parts = @/targetVessel1.Parts()
}

but I don't know how to find what I want in that list.

ElementAt() doesn't seem right, as I'd need to know where in the list it occurs. Random() might work, but that's leaving alot to chance.

Incidentally, is there a better way of doing what I want to do? It seems like this would run into dead ends alot.

Edit: Never mind. I should read the wiki. I think Contains() is what I want.

	DATA
    {
        type = List<Vessel>
        VesselList = AllVessels().Where(v => v.IsOrbiting() && v.VesselType() == Station)
    }

	DATA
	{
	type = Vessel
	targetVessel1 = @/VesselList.Where(p => p.Parts().Contains(StnSciLab)).Random()
	}

 

Edited by severedsolo
Link to comment
Share on other sites

Just a note that GAP 0.4 is ready to release with a really awesome and fully fleshed out Coast Guard multiple buoy drop mission, however CC bug #407 apparently exists in CC 1.9.1 and not just CC dev, so I am unable to publish GAP until it can get fixed since essentially it prevents about 70% of my contract pack from completing and I consider this a critical bug at this point. I have no idea how it escaped my quality check when I released GAP 0.3.

I'll skip to just working on GAP 0.5 for now as a result and wait for a CC 1.9.2 to fix things.

Link to comment
Share on other sites

22 hours ago, Thegamer211 said:

CKAN version does not update to 1.9.1.

cf43d032a16e4f557a79576721d65662.png

 

You may need to refresh the CKAN repository, as the .ckan file for 1.9.1 was correctly generator.

3 hours ago, inigma said:

Just a note that GAP 0.4 is ready to release with a really awesome and fully fleshed out Coast Guard multiple buoy drop mission, however CC bug #407 apparently exists in CC 1.9.1 and not just CC dev, so I am unable to publish GAP until it can get fixed since essentially it prevents about 70% of my contract pack from completing and I consider this a critical bug at this point. I have no idea how it escaped my quality check when I released GAP 0.3.

I'll skip to just working on GAP 0.5 for now as a result and wait for a CC 1.9.2 to fix things.

Didn't get too much time for modding this weekend, I'll see if I can get a 1.9.2 release out sometime before Christmas.

Link to comment
Share on other sites

2 minutes ago, nightingale said:

You may need to refresh the CKAN repository, as the .ckan file for 1.9.1 was correctly generator.

Didn't get too much time for modding this weekend, I'll see if I can get a 1.9.2 release out sometime before Christmas.

no rush. yet. most of my testers are using alt f12 for now to complete and move on, but before New Years would be great. :) thanks nightingale! :D

Link to comment
Share on other sites

I keep running consistently into a scenario that when I spawn a kerbal on water, and I fly in a craft to rescue him, as I approach the kerbal or hover over him, the spawned kerbal starts to sink. Rapidly. In fact he will sink all the way to the ocean floor. It's as if he loses all buoyancy.

If I then load another contract that spawns kerbals on water after that point, even if I load the kerbal directly first before flying over to him, he spawns on the ocean floor and starts to float up or in most cases just has no buoyancy and stays walking on the sea floor.

Link to comment
Share on other sites

2 hours ago, inigma said:

I keep running consistently into a scenario that when I spawn a kerbal on water, and I fly in a craft to rescue him, as I approach the kerbal or hover over him, the spawned kerbal starts to sink. Rapidly. In fact he will sink all the way to the ocean floor. It's as if he loses all buoyancy.

If I then load another contract that spawns kerbals on water after that point, even if I load the kerbal directly first before flying over to him, he spawns on the ocean floor and starts to float up or in most cases just has no buoyancy and stays walking on the sea floor.

Probably a spawning issue related to the new buoyancy model.  Can you raise a GitHub issue?

Link to comment
Share on other sites

6 minutes ago, nightingale said:

Probably a spawning issue related to the new buoyancy model.  Can you raise a GitHub issue?

I'm still gathering data and steps to replicate. I will soon. Prob late late tonight.

When it happens, all Kerbals lose buoyancy,  including my own crew such as Jeb or Bill if I EVA them out of the helicopter and have them go for a swim.

Edited by inigma
Link to comment
Share on other sites

26 minutes ago, inigma said:

I'm still gathering data and steps to replicate. I will soon. Prob late late tonight.

When it happens, all Kerbals lose buoyancy,  including my own crew such as Jeb or Bill if I EVA them out of the helicopter and have them go for a swim.

I think I've seen it before, it's because the Kerbal doesn't get set up properly (situation is LANDED instead of SPLASHED).  If you're not spawning it at 0.0 altitude that could be the issue too.

Link to comment
Share on other sites

2 minutes ago, nightingale said:

I think I've seen it before, it's because the Kerbal doesn't get set up properly (situation is LANDED instead of SPLASHED).  If you're not spawning it at 0.0 altitude that could be the issue too.

I tried 0.0 and 20 and no alt. 0.0 and no alt has kerbal spawn on surface but when flying close to it kerbal stays but after a few seconds or more it suddenly loses buoyancy... all kerbals seem to lose it too aftetwards requiring a game restart.

Alt 20 spawn has kerbal spawning on ocean floor.  Its interesting. Ill have to create a bug case and submit to you replication steps but I think you might be onto something regarding the landed vs splashed state change.

Link to comment
Share on other sites

30 minutes ago, inigma said:

I tried 0.0 and 20 and no alt. 0.0 and no alt has kerbal spawn on surface but when flying close to it kerbal stays but after a few seconds or more it suddenly loses buoyancy... all kerbals seem to lose it too aftetwards requiring a game restart.

Alt 20 spawn has kerbal spawning on ocean floor.  Its interesting. Ill have to create a bug case and submit to you replication steps but I think you might be onto something regarding the landed vs splashed state change.

Yeah, find the EVA Kerbal (Vessel) in the save file and look at the situation there - if it isn't getting set to SPLASHED when you set the altitude to 0.0 (or leave it out), then that's the bug.  If not, it's something else. :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...