Jump to content

Lowering kerbal's experience


Recommended Posts

I need  to decrease XP (and, perhaps, level) of a kerbal, but nothing I tried works.

Changing related ProtoCrewMember fields and properties (experienceLevel, experienceLevelDelta, experience, ExtraExperience) seem to have no effect.

I tried adding an entry to the flightlog like this:

KerbalRoster.AddExperienceType("foobar", "foobar", -2, -2);
...
PCM.flightLog.AddEntry("foobar", Planetarium.fetch.Home.bodyName);
PCM.ArchiveFlightLog();
PCM.UpdateExperience();

The experience entry is added to the flight log, but it doesn't affect experience. Perhaps, negative values are not supported?

Anybody has an idea what can be done?

Link to comment
Share on other sites

I don't know a way to do it but I do have some information that may or may not help. A Kerbal's XP is calculated on the fly based on what they've done, which is probably why what you're doing doesn't work.

In the persistent file you can add or delete achievements to change their XP. Maybe you can do similar in the code?

Link to comment
Share on other sites

8 hours ago, 5thHorseman said:

I don't know a way to do it but I do have some information that may or may not help. A Kerbal's XP is calculated on the fly based on what they've done, which is probably why what you're doing doesn't work.

In the persistent file you can add or delete achievements to change their XP. Maybe you can do similar in the code?

Yes, this is what I do with the piece of code I put in the post. But it doesn't have any effect. Either it's because the game doesn't accept negative values for experience or I'm doing something wrong.

Link to comment
Share on other sites

1 hour ago, garwel said:

Yes, this is what I do with the piece of code I put in the post. But it doesn't have any effect. Either it's because the game doesn't accept negative values for experience or I'm doing something wrong.

It's a sandbox game?

Link to comment
Share on other sites

56 minutes ago, garwel said:

I'm testing it in Career, naturally. All the other modes don't support experience.

Just to be sure. I'd tried the same thing too, but I was on sandbox and just realized it after wasting a lot of time.

What I did managed to do on career (after I finally realized I could do it only in Carrer - manuals? Who read manuals?) is to copy & paste the experience from another Kerbal into the one I want to mangle.

Essentially, once a Kerbal gets a experience, I create one,.rename it to reflect the experience and paste it there. So I have a reference when I need another one with that experience. 

I found trying to Forge a experience from scratch too tricky. 

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