Page 1 of 2
Date confusion
Posted: Sun Dec 04, 2011 11:15 pm
by airbornemongo101
Ok,,,I've been working on the "Mod that shall not be named" and the Expanded SE Unit Mod and I've hit a very perplexing issue that has me ready to scream (at the very least

)
Here's the problem:
I'm making a new unit and tweaking existing entries of the Heer/SE Panzer IIIG (using the editor provided my Mr. Garnett of course)
I make the new/copy entry,,add new attributes,name,etc.. and save. All is good,,,so far
I go and check to make sure everything is ok ,and the availiblity dates have changed

(they don't match) . I'm thinking,"ok i screwed up" (not the 1st time this has happened of course

)"I'll do it again",,so I do it again (ensuring that the dates match) .THE DATES STILL DON'T MATCH

. Repeat above process far to many times and I keep on getting the same results (I know about the saying,,but I was already insane before this

)
IE:the date of avail. for the vanilla PZ IIIG is 7 March ,1940,however the avail date for the new unit (I don't want to mention the unit's indentifier in case someone takes offence,suffice to say it's a Pz. IIIG

) is 3 July,1940. So I make sure they both read 7,March,but one will still read 3 July,,they keep on flip/flopping. The SE date will jump also. Every once in a while I'll get a real odd-ball date (I don;t exactly remember one of them att)
I've tried deleting units and adding units/entries in every variation anybody could possible think of in the last two days,but I still not get the units availibility dates to match. This has happened w/ other units as well (1st one that comes to mind is the PIIIJ/1). I've even tried new dates,but then I ran into the issue of getting the IIIG at the same time as the IIIF or the IIIH.
Anybody know what's happening?
Why can I not get at least two of the units dates to match???
Is there a fix,,or is something hardcoded? to prevent adding/copying work
Any help is appreciated
Thanks in advance
Posted: Mon Dec 05, 2011 12:13 am
by El_Condoro
(You did say 'any help')
Are you clicking the 'Commit' button after you make changes? I ran a test:
1. Open the files as normal.
2. Click on Pz IIIE (there is no SS, er SE PzIIIE yet) and Copy
3. Scroll down to the bottom of the list and click on the new copy (something like 3033 is the number in my efile)
4. Change the available date and unit name to SE Panzer IIIIE
5. Click 'Commit Unit'
6. Click 'Save' and overwrite the equipment.eqeqp file
Voila! New SS Panzer IIIE with a new available from date.
Posted: Mon Dec 05, 2011 12:35 am
by airbornemongo101
El_Condoro wrote:(You did say 'any help')
Are you clicking the 'Commit' button after you make changes? I ran a test:
1. Open the files as normal.
2. Click on Pz IIIE (there is no SS, er SE PzIIIE yet) and Copy
3. Scroll down to the bottom of the list and click on the new copy (something like 3033 is the number in my efile)
4. Change the available date and unit name to SE Panzer IIIIE
5. Click 'Commit Unit'
6. Click 'Save' and overwrite the equipment.eqeqp file
Voila! New SS Panzer IIIE with a new available from date.
El Condoro,,good to see you have the same sense of humor I do

.
I made the PzIIIE (and
ALOT of others) w/ no problems at all. I've got the use of editor down pat. Thanks to all of the help I got earlier.
The dates are changing on the PzIIIG and PIIIJ/1 additions and a couple of others (didn't write the others down

),,all other entries/units are good to go and working. I'm thinking it's got to be something in the game itself.
P.S. Sorry my above example had the PzIIIE,,I'll change it,,sorry for the confusion
BTW,,thanks for the reply

Posted: Mon Dec 05, 2011 12:53 am
by El_Condoro
Sorry, I can't get the problem you're describing to occur. I played around with a PzIIIG and changed its available date to 7 March, 1940; copied it to a new SE Pz IIIG with the same date. Commit unit for each and save. Close and re-open and the dates are all OK. Unless I'm missing something in what you are saying?
Posted: Mon Dec 05, 2011 1:22 am
by airbornemongo101
El_Condoro wrote:Sorry, I can't get the problem you're describing to occur. I played around with a PzIIIG and changed its available date to 7 March, 1940; copied it to a new SE Pz IIIG with the same date. Commit unit for each and save. Close and re-open and the dates are all OK. Unless I'm missing something in what you are saying?
Ok,,let me try again,,I've got to be scrweing something up
If it happens again,,I'll post something.
Maybe I need to re-intsall or something
Thanks for the again help

.
Posted: Mon Dec 05, 2011 3:53 am
by airbornemongo101
Well after a very,very,very frustrating weekend I figured it out
El Condoro you helped
I decided to copy my steps presicely in your post and I was documenting the whole procedure in my notes,,and you're right it worked

.
I then screwed around a little and realized what was wrong,,for some reason there are a evidently some units that you must save the work after each individual unit (at least that's the only reason I could come up with

),,the PzIIIG and the PzIIIJ/1 being among them.
I had been doing an entire class,commiting after each unit of course, and then saving.
Thanks for the hope El Condoro.
Did I mention that this weekend was very frustrating?

Posted: Mon Dec 05, 2011 4:05 am
by El_Condoro
Glad you got it sorted. That 'Commit Unit' button is critical and, yes, I think it has to be used after every unit has its details changed.
Posted: Mon Dec 05, 2011 6:55 am
by rezaf
Sounds like a bug anyways.
I mean - March 7th and July 3rd ... that's 7/3/40 and 3/7/40.
The DateTime locale is possibly casted the wrong way at some point.
Happened to my entire file once when I edited with OpenOffice.
_____
rezaf
Posted: Mon Dec 05, 2011 7:43 am
by El_Condoro
Quite possible - Australian date format is dd/mm whereas PzC might be mm/dd?
Posted: Mon Dec 05, 2011 9:03 am
by mgarnett
Hi Guys,
I've had a go at trying to replicate this issue and I have tried regional settings set to UK, AU and US (via the control panel applet) and swapped between the date formats dd/MM/YY and MM/dd/YY and I have not been able to replicate any date "day/month" swapping. Internally, the game stores dates as strings in the format dd/mm/yyyy. I interpret these dates and display the results in the "Available From" and "Available To" fields. These fields display the correct date values so there does not appear to be an issues reading the dates from the equipment file and displaying them.
When you press the "Commit" button, the application reads the dates from these fields, parses them into the correct format and then writes them back to your equipment file. I have pasted a section of the function that does this below just in case anybody else can see a mistake in my logic (I have added in some comments to explain what each line does for those who aren't familiar with coding):
// Reads the date from the DateTime control for the "Available From" date control into the string variable "fromDate"
// After completeing, an example value for the fromDate string is "Saturday, 27 May 1939" for the Gebirgsjäger unit
string fromDate = coAvailFromDateTime.Text;
// Converts the string value obtained above into a DateTime value whose format is based on your computers regional settings as set via the
// "Regional Settings" applet in your control panel. For AU/UK machines that is dd/mm/yyyy for US it is mm/dd/yyyy
// This intermediate step is required so that I can use the Windows date manipluation functions to change your regional date into the
// format required by the game which is dd/mm/yyyy regardless of the settings on your machine and so I can also use the nicely presented
// Windows DateTime picker controls that handle all of the formatting and validating
DateTime fromDateTime = DateTime.Parse(fromDate);
// Writes the DateTime value obtained in the previous line back to the equipment list at the correct index and formats it to dd/mm/yyyy
// so that the game will understand the date correctly
lEquipmentList[iCurIndex].sAvailFromDate = (fromDateTime.ToString("dd.MM.yyyy"));
// Same as above but for the "Available To" date
string toDate = coAvailToDateTime.Text;
DateTime mtoDateTime = DateTime.Parse(toDate);
lEquipmentList[iCurIndex].sAvailToDate = (toDateTime.ToString("dd.MM.yyyy"));
I also tried replicating the bug by editing and commiting multiple units (including the IIIG and IIIJ/1) and just single units but the dates still worked fine for me and I wasn't able to replicate the issue. If you can provide some detailed steps on how to replicate the issue I'll give it another go.
Cheers
Mark
Posted: Mon Dec 05, 2011 11:15 am
by bebro
mgarnett wrote:When you press the "Commit" button, the application reads the dates from these fields, parses them into the correct format and then writes them back to your equipment file.
Just curious - does that mean I don't have to save the equipment file extra everytime after I edited units? So far I always did "commit", then finally "save" for saving the file. I didn't kow "commit" already writes into the file.
Posted: Mon Dec 05, 2011 11:21 am
by VPaulus
bebro wrote:mgarnett wrote:When you press the "Commit" button, the application reads the dates from these fields, parses them into the correct format and then writes them back to your equipment file.
Just curious - does that mean I don't have to save the equipment file extra everytime after I edited units? So far I always did "commit", then finally "save" for saving the file. I didn't kow "commit" already writes into the file.
As far as I understand it writes to equipment file in memory, but you still have to use save for saving in disk.
Posted: Mon Dec 05, 2011 11:21 am
by bebro
VPaulus wrote:bebro wrote:mgarnett wrote:When you press the "Commit" button, the application reads the dates from these fields, parses them into the correct format and then writes them back to your equipment file.
Just curious - does that mean I don't have to save the equipment file extra everytime after I edited units? So far I always did "commit", then finally "save" for saving the file. I didn't kow "commit" already writes into the file.
As far as I understand it writes to equipment file in memory, but you still have to use save for saving in disk.
Ahh, I see, thanks

Posted: Mon Dec 05, 2011 11:35 am
by airbornemongo101
OK,,,after reading Mr. Garnett's point I did some more tests and here is what I foumd out.This is done on a "fresh re-install" and after opening the nesscary files ,btw the way,is at C:\Program(x86)\Slitherine\Panzer Corps\Data. Operating system is Win7 w/ latest service pack.
I can make a copy of the SE Pz.IIIG commit/save and the date originally shows 3/july/1940 after hitting commit,but when saved the date reverts to correct date of 7/March/1940. I've tested the entry by running the game and all is well. Both show up in the Sealion 40 scn.
If I use the Heer PzIIIG on line 20 of the Pzeqp. file is when this screw up occurs the date of avail for the new unit is 3/July/1940,w/ the "SS PzIIG" becoming avial. in Norway and the Heer unit becoming avail. in Sealion in tesing the game.
The same also applies to the PzIIIJ/1. The dates jump from 2/july/1942 to 7/Feb/1942.
I tried numerous times w/ different twist,but the above holds. The SE file has to be used,at least on my machine ,or I get the date screw up.
Thanks to everyone for taking an interest and helping w/ this issue.
Posted: Mon Dec 05, 2011 12:12 pm
by El_Condoro
The dates jump from 2/july/1942 to 7/Feb/1942.
Again reversing the date format - 2/7 becomes 7/2.
Posted: Tue Dec 06, 2011 2:16 am
by flakfernrohr
I had a similar experience with some units, but I never figured out what to attribute it to. I always make double sure that the date is changed and "clicked" properly. THEN, I "commit" and save, making certain the "save" is to the right "equipment" file in the Data folder. I also go back and check the units after I have made a few to "audit" them and make certain they are as I want them to be. And now you know why recommended only doing this sort of thing when uninterrupted concentration can take place. It's too easy to lose track of the thought train doing everything that needs to be done to make or change a unit. Best not to rush either.
But in any case, I am very glad that ABmongo has become a "Master" of the Equipment Editor. He will find much happiness now.
Posted: Tue Dec 06, 2011 3:06 am
by airbornemongo101
flakfernrohr wrote:
But in any case, I am very glad that ABmongo has become a "Master" of the Equipment Editor. He will find much happiness now.
Maybe just a journeyman ,so far,not a master
yet
I'm a journeyman only because of the excellent and speedy help of the true masters

Posted: Tue Dec 06, 2011 9:15 am
by mgarnett
airbornemongo101 wrote:OK,,,after reading Mr. Garnett's point I did some more tests and here is what I foumd out.This is done on a "fresh re-install" and after opening the nesscary files ,btw the way,is at C:\Program(x86)\Slitherine\Panzer Corps\Data. Operating system is Win7 w/ latest service pack.
I can make a copy of the SE Pz.IIIG commit/save and the date originally shows 3/july/1940 after hitting commit,but when saved the date reverts to correct date of 7/March/1940. I've tested the entry by running the game and all is well. Both show up in the Sealion 40 scn.
If I use the Heer PzIIIG on line 20 of the Pzeqp. file is when this screw up occurs the date of avail for the new unit is 3/July/1940,w/ the "SS PzIIG" becoming avial. in Norway and the Heer unit becoming avail. in Sealion in tesing the game.
The same also applies to the PzIIIJ/1. The dates jump from 2/july/1942 to 7/Feb/1942.
I tried numerous times w/ different twist,but the above holds. The SE file has to be used,at least on my machine ,or I get the date screw up.
Thanks to everyone for taking an interest and helping w/ this issue.
Hi airbornemongo101,
I hope you don't mind me asking a couple of additional questions, I just want to make sure I understanding everything correctly when I try and replicate. When you say "I can make a copy of the SE Pz.IIIG commit/save" do you mean
1. You are clicking on unit no. 20, the PzIIIG unit click "Add", making some changes and then clicking "commit"; or
2. You are clicking on unit no. 20, the PzIIIG unit, making some changes and then click "commit".
I only ask this because you have used the word "copy" so I just wanted to make sure I understood correctly. Now, after this, you save the file and the date in the saved equipment file is reversed. So, just before you click "Save" the date displayed in the date control is 2 July 1942 but when saved, the date that is saved is 7 February 1942. Also, this error only occurs when editing the PzIIIG and PzIIIJ/1 but NOT the the SE Pz.IIIG. It's pretty strange that it is only happening on selected units so there must be something different in the data for those two units.
If you could let me know the answers to my queries above and I'll keep on looking in the meantime.
Cheers
Mark
Posted: Tue Dec 06, 2011 9:21 am
by mgarnett
bebro wrote:mgarnett wrote:When you press the "Commit" button, the application reads the dates from these fields, parses them into the correct format and then writes them back to your equipment file.
Just curious - does that mean I don't have to save the equipment file extra everytime after I edited units? So far I always did "commit", then finally "save" for saving the file. I didn't kow "commit" already writes into the file.
Hi bebro,
All of the editing takes place on a copy of the database retained in memory. This why there is a commit button as without it, it's too easy to make unwanted changes to your equipment database.
The editor reads the entire database file into memory, then when you change a unit and press commit, the change is made to entry in memory only. You only need to press "Save" when you want to write/save the entire equipment database back to disk. So you can start saving yourself a few clicks!
Cheers
Mark
Posted: Tue Dec 06, 2011 9:31 am
by mgarnett
airbornemongo101 wrote:flakfernrohr wrote:
But in any case, I am very glad that ABmongo has become a "Master" of the Equipment Editor. He will find much happiness now.
Maybe just a journeyman ,so far,not a master
yet
I'm a journeyman only because of the excellent and speedy help of the true masters

Hi airbornemongo101,
I've compiled a new executable in which I explicitly tell Windows to format the long date in the display as dddd, d MMMM yyyy rather than relying on Windows formatting the long date. Can you let me know if you are happy for me to email it through to you and I will do so. You can reach me at "m.garnett(at)optusnet.com.au".
Cheers
Mark