Shadowmage

[1.7.0] KSP Rescue Pod Validator (no more kerbals spawning in inflatable modules!)

Recommended Posts

10 minutes ago, steedcrugeon said:

Would I be right in thinking that I could add an MM patch to my mod as such:


@RESCUE_POD_TYPES:NEEDS[KSPPodRescueFix]
{
	%name = rektkm1a
	%name = rektmk1d
	%name = rektmk1n
}

and this would implement the pods onto the existing list, where someone has your mod installed

From the top of my head (without looking at the files in detail), yes, that should work.

Share this post


Link to post
Share on other sites

@Shadowmage

From the USI thread I figure I'd post here.  Here is the contract that pulled an invalid part

 

Spoiler

CONTRACT
            {
                guid = 8fd9b469-937a-4c80-bb1f-2e64306e381c
                type = RecoverAsset
                prestige = 1
                seed = 326914807
                state = Active
                viewed = Read
                agent = Probodobodyne Inc
                deadlineType = Floating
                expiryType = Floating
                values = 21600,115020000,89375,204188,89375,0,16.24,16.24,499404.840269712,477842.920269748,115497842.92027,0
                targetBody = 3
                kerbalName = Maucee Kerman
                partName = Malemute.RoverCrewCab
                partID = 3963959330
                recoveryLocation = 2
                recoveryType = 3
                gender = 2
                PARAM
                {
                    name = AcquireCrew
                    enabled = False
                    state = Complete
                    values = 0,0,0,0,0
                    title = Save Maucee Kerman
                    winOn = 0
                }
                PARAM
                {
                    name = AcquirePart
                    enabled = False
                    state = Complete
                    values = 0,0,0,0,0
                    title = Obtain Maucee's Debris
                    winOn = 0
                }
                PARAM
                {
                    name = RecoverKerbal
                    state = Incomplete
                    values = 0,0,0,0,0
                    title = Recover Maucee Kerman on Kerbin
                    failOn = All
                    winOn = All
                    kerbal = Maucee Kerman
                }
                PARAM
                {
                    name = RecoverPart
                    state = Incomplete
                    values = 0,0,0,0,0
                    title = Recover Maucee's Debris on Kerbin
                    failOn = AnyCandidate
                    winOn = AllCandidates
                    part = 3963959330
                }
            }

 

Share this post


Link to post
Share on other sites
10 minutes ago, goldenpsp said:

@Shadowmage

From the USI thread I figure I'd post here.  Here is the contract that pulled an invalid part

 

 

Thanks for the details, that should give me everything that I need to add that contract type, or at least investigate more fully what is going on.  Should likely have an updated version available here in a few days.

Share this post


Link to post
Share on other sites

Apologies for not getting this updated sooner; have had a busy couple of weeks (both RL and other mods...).

Hopefully will have time this weekend to publish a new release.  Fix for the missed contract type is already in place but needs some testing to make sure I properly handled the contract type (and investigate for others that might need to be handled).

Edit: Will also try and include at least MiniAVC for some form of version checking (if I have time).
 

Edited by Shadowmage

Share this post


Link to post
Share on other sites
1 hour ago, Shadowmage said:

Edit: Will also try and include at least MiniAVC for some form of version checking (if I have time).

It's up to you, but I would recommend you consider just including a .version file instead of a full MiniAVC since most people who want version checking will already have AVC. 

Share this post


Link to post
Share on other sites

I think there's a bit of a problem with the handling of the new contract type.

Since I updated to 1.0.0.5, I've been getting several contracts where I'm supposed to rescue a Kerbal and his/her craft. However when I accept the contract, they are on EVA and there is no craft in sight, so it becomes impossible to complete the contract without the cheat menu.

I think the problem is the underscores in the RESCUE_POD_TYPES list. Internally KSP replaces them with a dot instead for some reason. And the problematic contracts all had parts with underscores, such as mk2Cockpit_Standard. Changing the name to mk2Cockpit.Standard made the contract work correctly, when I accepted it the kerbal spawned inside the part and not on EVA.

So you definitely have to change the default cfg file and replace underscores with dots.

Probably it would be best to also validate the list of part names after loading, to make sure you don't set part names that don't exist into contracts, when people accidentally make a typo in the list or just copy them from the part cfg with underscores.

(Looking at the source, it'd probably also be good to check the contract type and make sure it's a RecoverAsset contract, since so far you only look at the fields and assume that if they're present then it must be the right contract type...)

Share this post


Link to post
Share on other sites

Updated release is available:

https://github.com/shadowmage45/KSPRescuePodFix/releases/tag/1.0.0.6

Fixes the above posted problem regarding part names with underscores in them (silly stock code doing unnecessary mangling of part-names).

@jd284  Feel free to submit a PR to validate the contract type specifically.  My familiarity with the contract system begins and ends with the code I have in there already; I'm unsure/unaware of how to get the contract type out of the contracts config node.

Share this post


Link to post
Share on other sites

I'm not very good with either the contract system or github PR's either, but as far as I can tell it would be just checking whether contractData.GetValue("type") != "RecoverAsset". At least that what it looks like in the savegame.

Share this post


Link to post
Share on other sites

Nice mod, now I'll have to write cogs for all the mods I'm currently supporting.

Thanks a lot for making yet MOAR work for me!   :D

Seriously, a great mod.  I'll have my mods updated by this weekend (I hope)

Edited by linuxgurugamer

Share this post


Link to post
Share on other sites
On 11/2/2016 at 9:31 AM, steedcrugeon said:

Would I be right in thinking that I could add an MM patch to my mod as such:


@RESCUE_POD_TYPES:NEEDS[KSPPodRescueFix]
{
	%name = rektkm1a
	%name = rektmk1d
	%name = rektmk1n
}

and this would implement the pods onto the existing list, where someone has your mod installed

I used an identical patch and ran into a problem. In MM, % = create/edit. So what ended up happening in my case was that every pod on my rescue missions was the last edited pod. In the above example I only ever had Kerbals generate in rektmk1n pods.

Again, using the above example, removing the % is what worked for me:

Spoiler

@RESCUE_POD_TYPES:NEEDS[KSPPodRescueFix]
{
    name = rektkm1a
    name = rektmk1d
    name = rektmk1n
}

Cheers,

Share this post


Link to post
Share on other sites
On 1/11/2017 at 0:49 AM, Stratickus said:

I used an identical patch and ran into a problem. In MM, % = create/edit. So what ended up happening in my case was that every pod on my rescue missions was the last edited pod. In the above example I only ever had Kerbals generate in rektmk1n pods.

Again, using the above example, removing the % is what worked for me:

  Hide contents

@RESCUE_POD_TYPES:NEEDS[KSPPodRescueFix]
{
    name = rektkm1a
    name = rektmk1d
    name = rektmk1n
}

Cheers,

Thanks for testing this, I have now implemented a modified version (two extra pods to add) of your patch into the Github directory. It will be rolled out proper in the next version of the REKT mod.

Edited by steedcrugeon
clarification

Share this post


Link to post
Share on other sites
On 9/4/2016 at 11:01 PM, Shadowmage said:

Yes, it does work in 1.1.3.

No, I don't do CKAN, sorry.  Especially for this mod; its a single .dll and config file that can be placed anywhere in GameData... about as simple as an install can get.

@Shadowmage I'll understand if you say no, but having an automated process such as CKAN is very useful for people who don't want to or can't deal with dlls and folders.

I'd be happy to take care of getting it in CKAN if you like.

Let me know.

Also, I'm going to be writing patches for all the parts mods I maintain for this.  I wasn't really aware of this until now because it wasn't in CKAN (yes, i use it all the time, to maintain my 200+ modded career install)

 

On 6/10/2016 at 2:33 PM, Deimos Rast said:

So this could be the savior Take Command needs. Currently that mod adds crew capacity to external command seats, and that causes them to be used for rescue missions. It's apparently considered game breaking, but it's a case of either break the mod or break the game. However, with this mod...you could add external command seats to the filter list.

Just curious, why is it considered game breaking?

Share this post


Link to post
Share on other sites
39 minutes ago, linuxgurugamer said:

Just curious, why is it considered game breaking?

Because if the game picks a command chair as a rescue pod,

A) the kerbal spawns invisible most times, and can't be removed from the chair.

B) A above usually doesn't matter, as in most cases I've seen of this, when Kerbals spawn in rescue missions strapped into chairs, it's a Kraken summoning, physics destroying, and save file corrupting kind of good time.

Share this post


Link to post
Share on other sites
1 hour ago, vardicd said:

Because if the game picks a command chair as a rescue pod,

A) the kerbal spawns invisible most times, and can't be removed from the chair.

B) A above usually doesn't matter, as in most cases I've seen of this, when Kerbals spawn in rescue missions strapped into chairs, it's a Kraken summoning, physics destroying, and save file corrupting kind of good time.

Hmm.  I would consider that game breaking :D

Although, there is a (small) chance I may be looking into this issue sometime in the future, I ran into it in another area

 

Edited by linuxgurugamer

Share this post


Link to post
Share on other sites
7 hours ago, linuxgurugamer said:

@Shadowmage I'll understand if you say no, but having an automated process such as CKAN is very useful for people who don't want to or can't deal with dlls and folders.

I'd be happy to take care of getting it in CKAN if you like.

Let me know.

Also, I'm going to be writing patches for all the parts mods I maintain for this.  I wasn't really aware of this until now because it wasn't in CKAN (yes, i use it all the time, to maintain my 200+ modded career install)

 

With this mod being in a mostly finished and stable state, I wouldn't mind if you wanted to take care of the CKAN indexing/setup.  Is there anything that would need to be done on my part? 

Share this post


Link to post
Share on other sites
3 minutes ago, Shadowmage said:

 

With this mod being in a mostly finished and stable state, I wouldn't mind if you wanted to take care of the CKAN indexing/setup.  Is there anything that would need to be done on my part? 

As long as the .version file is kept up-to-date, it should be fine.

I'll get to it later this evening.

And thank you

Edited by linuxgurugamer

Share this post


Link to post
Share on other sites

Netkan is all done, as soon as it gets accepted, it will be finished.  Within a day, probably

Share this post


Link to post
Share on other sites

@steedcrugeon

Since you seem to be adding these changes to the mod, the following is a list of parts from the mods that I maintain that could be eligible for rescue contracts.  If you think I should write a patch instead, let me know

OnionNewScience
j_4m_lab_short
BSLcrewCabinScience
BSLmk12SciencePod
BSLmk2ScienceFuselage
BSLmk2ScienceLC
K2Pod

quizTechMk1K10Cockpit
quizTechMk1EagleCockpit
quizTechMk2ThunderboltCockpit

625mBonny
SXTClyde
SXTBuzzard
SXTke111
25mKossak
SXTEntenteCordiale
SXTGoose
SXTmk3Cockpit52
SXTOsaulNoseCockpitAn225
SXTOsualRadCockpit
MEMLander
STXCANIOT
SXTDLK83EHabitat
SXTISSHabISK30
SXTLander
SXTCrewCabSSP10
SXTCrewCabSSP20
SXTSPKTRCabin
SXTRotatingMk2Ring
sxtairlockAnimated

 

Share this post


Link to post
Share on other sites
5 hours ago, linuxgurugamer said:

@steedcrugeon

Since you seem to be adding these changes to the mod, the following is a list of parts from the mods that I maintain that could be eligible for rescue contracts.  If you think I should write a patch instead, let me know

Sorry for the confusion @linuxgurugamer the comments I wrote about the next version were for adding them as a patch file to the next release of the REKT mod via MM. I'm not directly involved with the good work that @Shadowmage has done on this Mod.

Share this post


Link to post
Share on other sites
Just now, steedcrugeon said:

Sorry for the confusion @linuxgurugamer the comments I wrote about the next version were for adding them as a patch file to the next release of the REKT mod via MM. I'm not directly involved with the good work that @Shadowmage has done on this Mod.

Oh.

So I should just write them as patches and include them in each mod, right?

6 hours ago, linuxgurugamer said:

@steedcrugeon

Since you seem to be adding these changes to the mod, the following is a list of parts from the mods that I maintain that could be eligible for rescue contracts.  If you think I should write a patch instead, let me know


OnionNewScience
j_4m_lab_short
BSLcrewCabinScience
BSLmk12SciencePod
BSLmk2ScienceFuselage
BSLmk2ScienceLC
K2Pod

quizTechMk1K10Cockpit
quizTechMk1EagleCockpit
quizTechMk2ThunderboltCockpit

625mBonny
SXTClyde
SXTBuzzard
SXTke111
25mKossak
SXTEntenteCordiale
SXTGoose
SXTmk3Cockpit52
SXTOsaulNoseCockpitAn225
SXTOsualRadCockpit
MEMLander
STXCANIOT
SXTDLK83EHabitat
SXTISSHabISK30
SXTLander
SXTCrewCabSSP10
SXTCrewCabSSP20
SXTSPKTRCabin
SXTRotatingMk2Ring
sxtairlockAnimated

 

@Shadowmage I guess this should have been directed at you.

Share this post


Link to post
Share on other sites
1 hour ago, linuxgurugamer said:

Oh.

So I should just write them as patches and include them in each mod, right?

@Shadowmage I guess this should have been directed at you.

I've always been a bit undecided about where patches for mod-interp belong; in the base mod, or in the interacting mod.

I have no problem including other mod-specific interoperability patches in the distribution for this mod, but they would have to be maintained and submitted by others (other mod author/maintainer/volunteers).  I simply lack the time to keep patches for other mods (that I may not use or be at all familiar with) up to date.

In the end, for this particular situation, I don't think it really matters where the patches reside as long as they are structured correctly and kept up to date.  Might be easier in this case to ship the patches with the individual mods as the per-mod maintenance would be the same, but would remove the PR/submission/approval/merging overhead, and would ensure that the patches are up-to-date for the version of the mod in use.

(Let me know if you would rather submit PRs and keep the patches here, I can add a 'patches' folder/etc to the repo and distribution so as to keep things organized)

Share this post


Link to post
Share on other sites

No problem for me to add the to the mods.  I was just confused by some of the posts in the thread.

Thanks

Share this post


Link to post
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.