TEM2 - Modding SDK

Everything about this tennis manager game

TEM2 - Modding SDK

Postby manutoo » 08 Jun 2019, 10:37

Hello,

here you can download the Modding SDK for TEM2 : https://www.managames.com/download.php? ... SDK_b1.zip .

It will let you see where the files have moved to compared from the TE2013 structure (which was also used in the TEM2 Legacy version).

After you just use the Mods folder like in TE2013 & TEM2 Legacy.

1 warning : I just moved the Player & Tour bases, as well as all other Tour .ini's, from the "Data" folder to the "Ini" folder. This change is for the SubBuild 2019.6.8 and onward.

To use & mod the files :

- Launch the game, click on the "Show Data Folder" icon in Settings -> Profiles
- Locate the "Mods" subfolder and create in it a folder and name it to whatever you want
- Copy the files you want, and make sure to re-create all the folders of their path ; eg: copy "TEM2-ModdingSDK.zip/Specifics/Ini/Music.ini" to "Mods\MySuperMod\Specifics\Ini\Music.ini" ; eg for the players: copy "TEM2-ModdingSDK.zip/Ini/Players.ATP.ini" to "Mods\MySuperMod\Ini\Players.ATP.ini"
- Warning : avoid to copy the whole SDK into your Mod folder ; instead your final Mod should contain only the files you have actually modified ; this will lower the chance to have bugs with new versions of the game
- Outfit folder changed from "Data\Models\Textures" to "Players\Textures" ; TE2013 Outfit Mod should still work correctly in there ; however, you can use the file-based method from TE4 => topic60-33539.php
- Modding bases are still very close to TE2013 as explained here https://www.managames.com/tennis/doc/HowToMod.html & there topic29-4059.php
- A lot of things are compatible with TE4, but not all (mostly the outfit), and the images for the TE4 menus are missing

Ini Files :

All files within the "Ini" & "Specifics/Ini" Folders, and any other .ini file, can be modded in 2 ways :

1) As explained above, simply copy the whole file in your Mod folder, and then edit it ; this method completely replaces the built-in file, which means if the game is updated, your Mod won't see the changes and new stuff brought by the official update (for GameSys.ini & Model.ini and likely other .ini's, this will lead to crashes !)

2) Create an empty file named after an existing file, but with "_Mod" at the end of the name ; for example, "GameSys_Mod.ini" for "GameSys.ini" ; in it, you'll add only the Sections and the Entries you want to create or change. Using this method, your Mod won't prevent the built-in .ini file to be loaded, and it will only bring changes and additions to it. Moreover, if several Mods are loaded at once, each Mod can bring its own additions and changes (in the order specified in Mods.ini)
If you want to remove an existing entry, just write its name with nothing else after. eg: in GameSys.ini, there's the line "BallShadowReal = 0" ; so if you want to remove that, then in your "GameSys_Mod.ini", you just write "BallShadowReal".

You can edit the Ini files with the Windows Notepad or any other text editor, but not Word.

Language Files :

the Language files are in the "Text" sub-folder.

Like the Ini files, they can be modded in 2 ways : by completely replacing the built-in file, or by creating a new file with its name having "_Mod" at its end and then writing in this file only the new and changed Text Codes.

When possible, it is recommended to make all your Text Codes starting with a special character sequence, so your Mod Text Codes won't have any conflict with other Mods or game updates.

Different Tournaments each year :

To do so you have to use the following entries in your Tour.ini : YearPeriod, YearModulo & YearModulo+ .

Check Tour.ATP.ini for examples.

eg:
YearPeriod = -1978 1980 1982 1984-1990 2022-
=> starts with "-1978" means all years till 1978
=> ends with "2022-" means all years from 2022

YearModulo = X
=> Tournament happens every X years, starting at 0

YearModulo = -X
=> Happens the years which are not every X years

YearModulo+ = Y
=> Starts at -Y instead of 0

2D Court :

The Courts are in the "Courts" folder.
To preserve the Physics and other parameters, you have to create a "Court_Mod.ini" instead of a "Court.ini" (eg: "Mods\MySuperMod\Courts\Court01\Court_Mod.ini" for a 2D court replacing the clay court), and put this inside for a 2D court created for TE2013 :

Code: Select all
[Data]
Boards      =   // This turns off the Match Time & Speed boards

[Camera]
Angle      =   -7.49429
Focal      =   // This turns off the default Focal
CustomFocal     =       3.38351   // This entry is for legacy TE2013's Focals
Dist            =       2722
Height          =       429
AspectRatio   =   16:10

Replace Angle, CustomFocal, Dist & Height with the values from the 2D court's court.ini .

AspectRatio can be "1.6" or "16:10", it's same. For a 16:9 court, put this instead :
Code: Select all
AspectRatio   =   16:9


/!\ Note for TE2013 2D Courts : if the court didn't have the entry 2dCourt16:9 set to 1, then it was seen as a 16:10 for the camera setting even if it was really a 16:9 court. In this case, you'll have to redo the camera setting within TEM2 (see Automatic line positioning for 2D courts just below, or Moving the camera for the 2D Courts here https://www.managames.com/tennis/doc/HowToMod.html , but use the Shortcuts as seen at the end of Settings -> Controls)

For a new court, you can copy over its Court.ini, no need to use a Court_Mod.ini , but if there's a Focal line in it, you should replace it by :
Code: Select all
Focal      =   // This turns off the default Focal


For a 2D court whose camera has been set within TEM2/TE4, use the "Focal" entry, not "CustomFocal". ie: once you have saved the camera and closed the game, take Tennis.ini -> [Camera] -> CustomFocal, and copy it to the Court.ini (or Court_Mod.ini) -> [Camera] -> Focal.

Automatic line positioning for 2D courts :
You can now define the custom camera for 2D courts like this :
Code: Select all
[Camera]
AspectRatio    =    16:9
AutoU1        =    0.3323
AutoV1        =    0.2106
AutoU2        =    0.8297
AutoV2        =    0.7810

ie: no more manual positioning of the camera, you just note down where are the top left & bottom right corners of the lines ! To get these coordinates, divide the pixel's X by the width, and the pixel's Y by the height (so the coordinates will be normalized and thus will still work in case you resize the image afterwards). U1/V1 is the top left line corner, and U2/V2 is the bottom right line corner. For courts without a corridor, add this line :
Code: Select all
AutoNoCorridor        =    1


To see the 2D Court in-game, turn on Settings -> Video -> Advanced -> 2D Background.

How to create a new 2D Background from the existing 3D stadium :

You can change the camera angle of the existing 2D Backgrounds very easily :
  • Turn off the 2D Background (in Settings -> Video -> Advanced)
  • Start a warm-up and set the camera to your liking
  • Press the "Save to 2d Court" key (Right Shift + Print by default) (it can take 10 seconds or more to render & save the file)
  • Exit the warm-up and click on Settings -> Profile -> Show Data Folder & Show Engine Log
  • In the Data folder, copy TEM2_2dCourt001.png to Mods/MySuperMod/Courts/Court01/Court.png (for the Clay court)
  • Locate "Put this in your Court.ini:" in the Engine Log, and copy everything under to Mods/MySuperMod/Courts/Court01/Court_Mod.ini
  • Now you should be able to see your new 2D Background with your custom camera angle by starting a warm-up on the corresponding court :yes:

Editing .menu files :

The game can reload automatically the .menu files without restarting it if you activate the DevMode (HowTo => topic19-32161.php ), then when you focus back on the game (ie: after have changed a file), the game will reload the .menu files for the active menu.
Warnings:
- the game cannot detect a change to the .def files, so resave the corresponding .menu files if you want to see your changes
- sometimes the reloading doesn't work, especially if the file size didn't change, so add some characters in a comment and resave it to fix the issue
- dynamic variables defined in the .menu file will be set back their initial value, so the menu won't be correctly displayed if these dynamic variables had some different values before the reloading

Changing tournament backgrounds in the menus & text match :

add this to any tournament in Tour.ini :
Code: Select all
Background   =   MySuperBackground

and put this image like this : Mods/MySuperMod/Menu/Art//CustomCourtBackground/MySuperBackground.jpg
Note: use power-of-2 dimensions so the images will be faster to load (eg: change from 1920x1080 to 2048x1024, or smaller size to save on loading time & memory)

If the image aspect ratio is not 16:9, you can add, for example if the ratio is 4:3 :
Code: Select all
BackgroundAR   =   1.333


How to add pictures for the players :

Add a line like this in the Players.ini for each player :
Code: Select all
Photos         =   Federer_HS, 64, 64; Federer, 98, 158, 1.6

And then put the photos in "Mods\MySuperMod\Menu\Art\PlayerPhotos\ATP" (or WTA for women). The pictures can be in .png (favorite format), .tga, or .jpg.
For your coached players, you can put text files in "PlayerPhotos\ATP", named "Player1.txt" for your 1st Coached player, and "Player2.txt" for the 2nd one and so on. Content of the file is only, for example :
Code: Select all
Player1_HS, 64, 64; Player1, 120, 160, 1.6

The format for the photo list is : <Headshot picture details> ; <Body picture details>
The headshot is a small picture visible in the Rankings & Draws ; the body is a big picture visible in the Charsheet, the Activity screen and the Travel screen.
The body photo is visible in the Charsheet only if you add the following line under [Menu], in your Tennis.ini : (HowTo => topic19-32161.php )
CharsheetPhoto = 1
The format for each photo description is : <Filename without extension>, <Width>, <Height> [, <SizeScale>]
Width & Height are the size of your original photo. SizeScale is the coefficient to bring that scale to the correct size for the game ; the default height for the body is 256 and for the headshot is 64.
Ideally, you should scale your photos to power-of-2 size ; eg; if your body photo is 350x600, then you resize it to 256x512, so it'll be faster to load, then you describe it like this :
Code: Select all
MyBodyPhoto, 350, 600, 0.42

600 * 0.42 = 252 => about default height. If you put a bigger scale, the photo will be bigger on the screen.
So it's equivalent to write this :
Code: Select all
MyBodyPhoto, 147, 252


Coaching Strategy :

In CPU vs CPU matches in the Training Club, you can define the Coaching strategy of a player and then click on "Save Strategy -> Copy the current Coaching Strategy code to the clipboard" (on the bottom right).
This will put a code like this in the clipboard (and the Player.log) :
Code: Select all
Strategy      =   F 100 100 -90 -90 98 -80 99 0 0 0 0 0 0 -85 97 -90 0 P 100 100 -90 -90 98 -80 99 0 0 0 0 0 0 -85 97 -90 0

You can then paste this line (with CTRL+V) in a section of a player in your Players.ini so this strategy will be applied when he plays (without any penalty).
You can also define the default strategy of a Training Club player with "Save Strategy -> Enter Strategy code" & "Save the current strategy as the base strategy for this player".


Existing Mods :
- cjs Modcorner - Database Mods (for 2019) : topic11-31544.php
- 2018 Calendar : topic11-30570.php
Warning October 2020 : these Mods might not be fully compatible with the latest version of the game and might make it crash.

EDIT:
Modding SDK last update : April 2022
ManuTOO
== Mana Games ==

>> I don't answer Private Message, except if it's really a _Private_ topic <<
User avatar
manutoo
Game Author
 
Messages: 17407
Gaming Since: 24 Jan 2004, 15:38
Location: France

Re: TEM2 - Modding SDK

Postby manutoo » 14 Jun 2019, 07:56

Male Player Base updated, as there were 2 bugged players.
ManuTOO
== Mana Games ==

>> I don't answer Private Message, except if it's really a _Private_ topic <<
User avatar
manutoo
Game Author
 
Messages: 17407
Gaming Since: 24 Jan 2004, 15:38
Location: France

Re: TEM2 - Modding SDK

Postby Elie » 30 Jun 2019, 13:22

Hello.

First of all thank you for the great work you made :)
Does this Mod include the real players names?
Can you please explain me where I have to put this file? I really can't find any folder in Steam.

Thank you again,
Elie
Elie
Guest
 

Re: TEM2 - Modding SDK

Postby manutoo » 30 Jun 2019, 13:27

Elie,
yes, and read the instructions above, except you want to do that with Players.ini instead of GameSys.ini .
ManuTOO
== Mana Games ==

>> I don't answer Private Message, except if it's really a _Private_ topic <<
User avatar
manutoo
Game Author
 
Messages: 17407
Gaming Since: 24 Jan 2004, 15:38
Location: France

Re: TEM2 - Modding SDK

Postby bigu30 » 04 Jul 2019, 14:01

I remember you talk about the possibility to play differents tournaments each year. How I mod to make the real tournaments year by year?
Best 2015 results:
Title: Shanghai (s), Halle (s), Stuttgart (s), São Paulo (s)
Final: Sofia (s), Rio de Janeiro (s), Washington (s)
bigu30
court stakhanovite
court stakhanovite
 
Messages: 48
Gaming Since: 24 May 2016, 04:22

Re: TEM2 - Modding SDK

Postby denborre » 04 Jul 2019, 23:34

Hi Manutoo,

For a couple of years ago, I already made a mod for TEM1, I just changed the 'Players-WTA'.ini file.
Now I have TEM2 as well, I wanted to try to change this old file with the new one of the new version of TEM2.
I didn't change the original file, just put mine in the mods-section.
Now comes the question: how can I load a particular mod?
I have start the game a few times after my update, but my modded files don't appear in the game.
Can you help? :)

Thanks :)
denborre
tennis fan
tennis fan
 
Messages: 14
Gaming Since: 14 May 2010, 14:08

Re: TEM2 - Modding SDK

Postby manutoo » 05 Jul 2019, 07:55

bigu30,
I just added the Different Tournaments each year section in the 1st post.

denborre,
I guess it may apply to your issue :
1 warning : I just moved the Player & Tour bases, as well as all other Tour .ini's, from the "Data" folder to the "Ini" folder.

Also name of the file should be : "'Players.WTA.ini" .

How to activate one Mods amongst several : topic29-11960.php
ManuTOO
== Mana Games ==

>> I don't answer Private Message, except if it's really a _Private_ topic <<
User avatar
manutoo
Game Author
 
Messages: 17407
Gaming Since: 24 Jan 2004, 15:38
Location: France

Re: TEM2 - Modding SDK

Postby bigu30 » 08 Jul 2019, 21:04

Thanks for answer, but now I have another question: some tournaments change the week of the event. As it happens in different weeks, it will be a new tournament? For example, the Marseille ATP 250 was in week 6 until 2003, after it change to week 8. So, to me create the tournament in week 6 and week 8, each one will be a new tournament? or is it possible to do that Marseille is just one tournament?
My question is about the winners of this tournament, like Federer, that won Halle 10 times, but in both ATP 250 and ATP 500 format.
Best 2015 results:
Title: Shanghai (s), Halle (s), Stuttgart (s), São Paulo (s)
Final: Sofia (s), Rio de Janeiro (s), Washington (s)
bigu30
court stakhanovite
court stakhanovite
 
Messages: 48
Gaming Since: 24 May 2016, 04:22

Re: TEM2 - Modding SDK

Postby manutoo » 09 Jul 2019, 06:04

bigu30,
yes, you have to create different tournaments when changing of week or of category. Give them the same Family name and they should be joined for the Past Champions screen (check Montreal/Toronto). Be sure to give a unique Family name for each series of tournaments to join together.
ManuTOO
== Mana Games ==

>> I don't answer Private Message, except if it's really a _Private_ topic <<
User avatar
manutoo
Game Author
 
Messages: 17407
Gaming Since: 24 Jan 2004, 15:38
Location: France

Re: TEM2 - Modding SDK

Postby bigu30 » 10 Jul 2019, 21:17

I tried to mod the tournaments year by year, but I found a problem: tournaments with broken calendary, the system didn't read the second part of calendary. For example, Estoril in week 18 happens in 2005 until 2007 and after 2011. I write "2005-2007 2011-", but it didn't read the 2011 and so on tournament. This form, some years there are few tournaments available. Aus Open and US Open are the exceptions, because they happens always in same week.

Some tournaments even appear in game, and I don't know why this happens. I think may be some unrecognized character.
Best 2015 results:
Title: Shanghai (s), Halle (s), Stuttgart (s), São Paulo (s)
Final: Sofia (s), Rio de Janeiro (s), Washington (s)
bigu30
court stakhanovite
court stakhanovite
 
Messages: 48
Gaming Since: 24 May 2016, 04:22

Re: TEM2 - Modding SDK

Postby manutoo » 11 Jul 2019, 09:14

The parsing was ok, but not how it was used later on... :sweat:
It's fixed in today's build, thanks to your report ! :yes:
ManuTOO
== Mana Games ==

>> I don't answer Private Message, except if it's really a _Private_ topic <<
User avatar
manutoo
Game Author
 
Messages: 17407
Gaming Since: 24 Jan 2004, 15:38
Location: France

Re: TEM2 - Modding SDK

Postby bigu30 » 16 Jul 2019, 20:23

How I change the name of tournament category? I changed the name of Country Cup in Tour.ATP.ini and TourCategory.ATP.ini and it don't change the name. Is there another archive where we have this name category of tournament?
Best 2015 results:
Title: Shanghai (s), Halle (s), Stuttgart (s), São Paulo (s)
Final: Sofia (s), Rio de Janeiro (s), Washington (s)
bigu30
court stakhanovite
court stakhanovite
 
Messages: 48
Gaming Since: 24 May 2016, 04:22

Re: TEM2 - Modding SDK

Postby manutoo » 17 Jul 2019, 05:41

You have to change it in "Text\Lang_English.txt" (or your own language) ; the best is to create a file named "Text\Lang_English_Mod.txt" and put only this in it :
Code: Select all
DavisName   TheNameYouWant

I didn't test so I'm not 100% sure it works... :fear:

For other category names, check under :
Code: Select all
//=== Category
ManuTOO
== Mana Games ==

>> I don't answer Private Message, except if it's really a _Private_ topic <<
User avatar
manutoo
Game Author
 
Messages: 17407
Gaming Since: 24 Jan 2004, 15:38
Location: France

Re: TEM2 - Modding SDK

Postby Lazaros » 19 Jul 2019, 20:16

Hey Manutoo,

I want to play both singles and doubles at every tournament I enter but it is impossible to win both in singles and doubles at the same week since my energy lowers a lot. For example, I play my first match in singles and then i play my doubles match with the remaining amount of energy from my previous match and after that i play my second match in singles and my energy is like 30%. It is like i play 3 matches at the same day and i can recover my energy even though I am resting. Can I change the days of singles and doubles matches so that i don't have to play 2 matches at the same day unless it is finals or increase the number of hours that i can use before the matches?
Lazaros
Guest
 

Re: TEM2 - Modding SDK

Postby manutoo » 20 Jul 2019, 06:28

Lazaros,
you can change the play day, but you'll still have several days with both singles & doubles matches. Doubles matches are twice less tiring than singles match, so you should mostly feel the hit because it removes 2 hours of training that you can use as resting time.

You can't increase the number of training hours. You can increaste RestRate in your Tennis.ini, though.
ManuTOO
== Mana Games ==

>> I don't answer Private Message, except if it's really a _Private_ topic <<
User avatar
manutoo
Game Author
 
Messages: 17407
Gaming Since: 24 Jan 2004, 15:38
Location: France

Next

Return to Tennis Elbow Manager 2

Who is online

Users browsing this forum: CCBot [Bot], spinoliver and 0 guests