[MET] Contract Expiry Mass Editor v2.0

Utilities and roster editors for Eastside Hockey Manager 2007. These will be useful for Eastside Hockey Manager: Early Access because EHM 2007 rosters can be edited and then imported into EHM:EA.
Forum rules
NOTE: Although all of these tools are designed for Eastside Hockey Manger 2007, they can be used indirectly with Eastside Hockey Manager: Early Access. This is because EHM 2007 databases can be converted and imported into EHM:EA. CLICK HERE for more details.
Post Reply
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

[MET] Contract Expiry Mass Editor v2.0

Post by archibalduk »

The Contract Expiry Mass Editor allows you to make adjustments to all of the player and staff contract expiry years in the EHM 2007 database. This tool may be particularly useful for those wanting to make a database compatible with the Custom Start Date Patch (such as a year-adjusted database - e.g. Lidas/Manimal Rosters v1.0 through to v3.2 - or a set of retro rosters) or those making a fantasy database.

This tool allows you to do the following to all, or just a range of, contracts within the database:

1) Increase/decrease the expiries by any number of years.
2) Randomise each contract expiry (by setting it to 1900 which makes EHM generate a random date each time you start a new game).
3) Set contracts to a particular year.

NOTE: The changes will be saved to a new file named new_staff.dat. You should place this file in your database folder and rename it to staff.dat.


Download: [LINK CURRENTLY UNAVAILABLE]

SYSTEM REQUIREMENTS

You must have the following installed:

1) Microsoft Visual C++ 2010 Redistributable Package - http://www.microsoft.com/download/en/de ... px?id=5555
2) EHM version 3.0.4 final patch - http://www.ehmtheblueline.com/forums/vi ... =82&t=6627

If the tool does not function correctly or you get a Windows error then you may also need to install:

3) Microsoft .NET Framework 4 (or higher) - http://www.microsoft.com/net


IMPORTANT NOTES

This tool only modifies you staff.dat file; it does not modify any other files. Before using this tool, it is STRONGLY recommended that you make a BACKUP of your staff.dat file.

If you are using Windows Vista or 7, then you MUST run the tool as administrator: Right-click on the 'MET Contract Exp.exe' file -> Properties -> Compatibility -> Tick the box titled 'Run this program as an adminstrator'. Click on OK.

You should place this tool in the same folder as the staff.dat file which you wish to edit.


OPTIONS

Upon loading the tool, you will be presented with a list of options. Below is a brief description of each option.

Please note that when using options 1, 2, 5 and 6, the tool will also adjust the Date Joined year for all players contracted to an NCAA team. If a player contracted to an NCAA team has a Date Joined year more than three years before his contract expiry then EHM sets his contract as a one year contract. The tool therefore sets the Date Joined year to three years before the new contract expiry date so that it works correctly in EHM.


(1) Increase/decrease expiry years: All contracts

> This will adjust all contracts other than those set to 1900.
> Enter a negative number in order to decrease the expiry year.
> No contract will be reduced below 1901. E.g. if you try to decrease a contract set as 2006 by 1500 years, it will be set to 1901.


(2) Increase/decrease expiry years: A range of contracts

> This behaves in the same way as number (1) above.
> Additionally, it allows you to specify what range of contracts expiries to alter. E.g. if you enter 2006 - 2008, it will adjust only those years that are currently set as 2006, 2007 and 2008.
> If you want to adjust just contracts of a single year then enter that same year as both the minimum and maximum of the range. E.g. 2006 - 2006 will adjust only contracts set to expire in 2006.


(3) Randomise expiry years: All contracts

> This will set all contract expiry years to 1900. When starting a new game, EHM will randomly generate an expiry year.


(4) Randomise expiry years: A range of contracts

> This behaves in the same way as number (3) above.
> Additionally, you can specify just a range of contracts to alter in the same way as number (2) above.


(5) Set expiry years to a specified year: All contracts

> This will set all contract in the game as a specified year INCLUDING those set to 1900.


(6) Set expiry years to a specified year: A range of contracts

> This behaves in the same way as number (5) above.
> Additionally, you can specify just a range of contracts to alter in the same way as number (2) above.
> By using this method, you can, for example, adjust just those years that are not set to 1900 by entering a range such as 1901-9999.
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

Re: [MET] Contract Expiry Mass Editor v1.00

Post by archibalduk »

AdamOates has pointed out that there is an issue with the Contract Editor in that most NCAA players appear in game with just a one year contract. Adam has found that this is caused when the Date Joined Club info for a player is more than four years prior to the contract expiry date. I'm going to work on a new version of this editor that will amend the Date Joined Club info for all players contracted to an NCAA team.
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

Re: [MET] Contract Expiry Mass Editor v1.1

Post by archibalduk »

Version 1.1 has been uploaded. This resolves the aforementioned issue with players contracted to NCAA teams.

The readme.txt file sums up the new change:
Please note that when using options 1, 2, 5 and 6, the tool will also adjust the Date Joined year for all players contracted to an NCAA team. If a player contracted to an NCAA team has a Date Joined year more than three years before his contract expiry then EHM sets his contract as a one year contract. The tool therefore sets the Date Joined year to three years before the new contract expiry date so that it works correctly in EHM.
AdamOates
Prospect
Posts: 83
Joined: Fri Nov 27, 2009 12:54 am
Location: St. Louis, MO / Los Angeles, CA

Re: [MET] Contract Expiry Mass Editor v1.1

Post by AdamOates »

I see a couple of problems. First it should be a four year difference, not three. Also, the Contract End Dates for NCAA somehow all got changed to 1/1/Year. It should be 5/1/Year. You're almost there!
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

Re: [MET] Contract Expiry Mass Editor v1.1

Post by archibalduk »

AdamOates wrote:I see a couple of problems. First it should be a four year difference, not three. Also, the Contract End Dates for NCAA somehow all got changed to 1/1/Year. It should be 5/1/Year. You're almost there!
I tried a four year difference initially but it didn't resolve the issue. Therefore I changed it to three years.

I'll check out the 1/1/Year issue. Perhaps this is related to the three/four year issue. I'll take a look this weekend. :thup:
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

Re: [MET] Contract Expiry Mass Editor v1.1

Post by archibalduk »

I see what you mean about the month shifting from May to January. I'll see if I can make a quick fix. If not, I'll rewrite the whole code using the database structure (which in some ways would make things more straightforward).
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

Re: [MET] Contract Expiry Mass Editor v1.1

Post by archibalduk »

Problem solved! It was getting too messy using the old code (because it was written before the database structure was available and I had to navigate through the tangle of hex) so I'm rewriting it using the database structure (which makes things much easier).

I've just done some quick testing and now the day and month are okay when the contracts are altered. I've also fixed an issue where the day would be decreased/increased by one day if the expiry year changes to/from a leap year. Also, it works fine with the NCAA Date Joined set as four years before the expiry year.

I need to finish off coding the other options and then I'll upload the new version.
AdamOates
Prospect
Posts: 83
Joined: Fri Nov 27, 2009 12:54 am
Location: St. Louis, MO / Los Angeles, CA

Re: [MET] Contract Expiry Mass Editor v1.1

Post by AdamOates »

Good job! That will save me a lot of time.
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

Re: [MET] Contract Expiry Mass Editor v2.0

Post by archibalduk »

Version 2.0 has been uploaded (it can be downloaded from the first post in this thread). Here are the changes:

1) The dates are correctly preserved for NCAA players when their expiry years are adjusted.
2) The dates are correctly preserved for all players when the expiry year is adjusted to/from a leap year.
3) The date joined for NCAA players is adjusted to four years less than the expiry year when the player's expiry year is adjusted.

NOTE: The changes will be saved to a new file named new_staff.dat. You should place this file in your database folder and rename it to staff.dat.
AdamOates
Prospect
Posts: 83
Joined: Fri Nov 27, 2009 12:54 am
Location: St. Louis, MO / Los Angeles, CA

Re: [MET] Contract Expiry Mass Editor v2.0

Post by AdamOates »

This seems to be all good now as far as I can tell. Thanks!

I'm not sure how the rosters will be released, but people may need to remember to update the Future Transfer Dates if that's not included. Otherwise all of the future college players will have already moved to their next team.
User avatar
Manimal
TBL Admin Team
Posts: 6344
Joined: Thu Apr 24, 2008 4:01 am
Custom Rank: EHM Rosters Man
Favourite Team: Djurgårdens IF
Location: Karlstad, Sweden

Re: [MET] Contract Expiry Mass Editor v2.0

Post by Manimal »

AdamOates wrote: I'm not sure how the rosters will be released, but people may need to remember to update the Future Transfer Dates if that's not included. Otherwise all of the future college players will have already moved to their next team.
Thanks for the heads-up! I will update the entire extra_config file before releasing the rosters
souamort
Junior League
Posts: 39
Joined: Fri Apr 04, 2008 11:28 pm

Re: [MET] Contract Expiry Mass Editor v2.0

Post by souamort »

Maybe this has been addressed, but I tried searching and can't find it. I've used both the draft year editor and contract editor and can't seem to prevent restricted free agents from becoming UFA's at the start of the game. Stamkos, Doughty to name a few. I've set draft years to the option of Manimals rosters, and I've changed all contracts to end 2013, starting the game with 2011 start date.

Did I miss something, is there any way to do it or is it a mute point until roster 4.0 is released. Thanks guys, and sorry if the problem has been resolved, I really did try a search and found nothing.
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

Re: [MET] Contract Expiry Mass Editor v2.0

Post by archibalduk »

I'm not completely sure (I think somebody like Manimal or Lazion may be of more help than me) but I don't think the draft/contract status is the cause of that problem. I think it may be the Player Info section in the Pre Game Editor: http://www.ehmtheblueline.com/forums/vi ... 23#p131423

I'm writing an editor to update the Player Info without us having to go through each player manually.

However, as I said, I might be wrong with regards to the cause of the issue. Hopefully somebody with better knowledge can either confirm this or correct me.
User avatar
Lazion
Second Line
Posts: 661
Joined: Tue Oct 23, 2007 5:34 pm
Favourite Team: Flyers

Re: [MET] Contract Expiry Mass Editor v2.0

Post by Lazion »

Game consideres them as a unsigned prospects and therefore their right is lost two (?) years after the draft.
You can try to edit player info or history.. that should do it.
If that doesn't work you can try to change their draft years to be with in 2 yrs of starting year.
User avatar
Sterbe
Junior League
Posts: 27
Joined: Sun Jul 11, 2010 6:06 pm
Favourite Team: Tampereen Tappara
Location: Tampere Finland

Re: [MET] Contract Expiry Mass Editor v2.0

Post by Sterbe »

File is corrupted
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

Re: [MET] Contract Expiry Mass Editor v2.0

Post by archibalduk »

Annoyingly I do not seem to have kept a copy of this. I might have to dig out an old backup of my hard drive to see if I have a copy there... :doh:

IIRC the EHM Updater may do some or all of the functions this tool could do anyhow.
Post Reply