Author Topic: [PROBLEM] S3C Error: "Invalid argument to date encode"  (Read 603 times)

mauser1951

  • Guest
OK, so I've made the rendezvous with U-117 in the campaign. I captured my log showing 70,000 tons of sunken allied shipping. The game exited out to SH3 Commander as expected. What wasn't expected is that when I clicked to Update your Personnel File, I get an Error dialog box which reads, "Invalid argument to date encode" WTFO!? Patrol logs displays, and I can manage my crew. But the html page that opens up for Personnel Files does not generate and all I have is the error message. Can somebody help me to get this to work again? Thanks.

Mauser sends.

Offline REV_Grey Eminence

  • REViSi0N
  • one of the leaders
  • Posts: 448
  • ELiTE Skill Level:
    0%
  • |REViSi0N| - what else?
Re: [PROBLEM] S3C Error: "Invalid argument to date encode"
« Reply #1 on: 20190709, 20:46:21 »
Jscones explained this in the early years:

This is an SH3 bug that sometimes gets through SH3Cmdr's error handling. The error is usually caused by a common SH3 bug which sees it write 0s to some key fields. Basically, your career StartMonth, StartDay and StartYear has gone missing from your Career.cfg file (you'll see they are all 0s when they should be values). It also occurs when, well, careers are not established (ie because saves have been deleted rolling the career back to the first patrol).

The error message is caused because SH3 Commander can't find a valid career start date in Careers.cfg. The career start date is *only* grabbed once in SH3 Commander. It's the seed for determining all the pre-career dates (DOB, DOI, promotions etc) used in the Career Summary. Easily rectified, simply edit/replace StartMonth=0, StartDay=0 and StartYear=0 with StartMonth=9, StartDay=1 and StartYear=1940 respectively.

However, as I mentioned above, the Summary will still fail because other key dates are missing in the Careers.cfg and Careers_0.cfg. Most importantly, the Flotilla0*, NbPatrolsInFlotilla0*, StartYearInFlotilla0, StartMonthInFlotilla0 and StartDayInFlotilla0 values tend to also be 0 if the career start dates are 0 (seems that any "start" type value is affected). The Career Summary needs these values to build the "U-Bootwaffe Postings" block of the Summary. What this means is, unless you're happy to do some surgery, you can write off ever getting a summary from this career.

Problem is, when these dates are missing, other details also appear to be missing - Flotilla start dates for example. These are required by SH3 Commander for the Career Summary.

Essentially, these careers are still playable, but you won't be able to utilise the Career Summary component of SH3 Commander.

The usual way to fix is to reload your last in-game save before docking and redock. This usually forces SH3 to write the correct details. The other side effect of this game bug is that you lose tonnage sunk values. Unfortunately, while SH3Cmdr intercepts a LOT of random SH3 behaviour, it doesn't get them all.

Another possibility is that you are reusing a Kaleun's name that you used a long time ago. SH3Cmdr stores history associated with each Kaleun. In this case, open SH3Cmdr.ini (in SH3Cmdr folder) and find the Kaleun's name under the "CAREER DETAILS" block. Delete the Kaleun and save and exit and try again.

The easiest solution is to, after you have deleted the saves, reopen the career and go to the barracks screen. I *think* that then corrects the data integrity problem. You should be able to then exit SH3 and resume using SH3Cmdr.

If this still fails, then the solution that *will* work will be to play the next patrol sans SH3Cmdr. After you've finished the patrol, you'll be able to resume again using SH3Cmdr.

The barracks solution works!

So the best thing I can recommend to SH3Cmdr users is that if you delete save games from a career, then after doing so just load the career in SH3 (only needs to be to the barracks screen) and exit again. This then forces SH3 to correct a potential number sequencing problem plus write/update correct next patrol details, which SH3Cmdr looks for when loading up the career.


Or if you doing the "Wolves at War" gameplay, and the U-Boot has to be configured a certain way before taking it out to sea: To get around the problem, go on a shakedown patrol before you embark on a mission patrol. You can then fix your boat any way you want without incurring the dreaded "Invalid argument to date encode," and loosing your renown for any action.
« Last Edit: 20200105, 10:08:52 by REV_Grey Eminence »