DefCreator

Forum rules
SCS as a company do not wish to have paid mods on this forum. While we understand that not all paid mods use the Intellectual Property of other companies/people, it is very hard to moderate what is and isn't acceptable when money is involved. There are also concerns that it could look unfavorable to potential work partners going forward if SCS allow mods that may potentially use unlicensed branding.
Posting in the Mods forum (ATS and ETS2) is restricted to sharing free-to-the-public mods and providing support for mods. For more details, please check the Forum Rules.
Post Reply
Sineptorro
Posts: 10
Joined: 06 May 2019 20:20

DefCreator

#1 Post by Sineptorro » 16 Aug 2022 15:44

DefCreatorV1 (16_08_22)

This tool can be used to create definition files for all trucks at once. It can also generate the tobj and mat file for your ui-icon.

Motivation
As a creator of interior accessories i found it quite annoying to copy paste all the definition files for each truck and just change one line each time. This tool does it all for you and will save you lots of time in the process.

Funktionality
It creates the .sii definition files for each truck. It also creates the needed folders for you, if they dont already exist. If the .sii file already exists it will just overwrite it.

How to use
  • Preperation:
    Download the tool here https://github.com/Sineptorro/DefCreator . To find the .exe you have to extract the DefCreatorV1.zip and scroll down a bit, in there you also find the files ModTrucksATS.txt and ModTrucksETS.txt with those files you can add the ModTrucks you want to support. I´ve already added 2ModTrucks to the ModTrucksETS.txt file, use this as a guidline since the program wont work if you mess those files up. Each unit name has to be in a seperate line, empty lines are not allowed. It can happen that windows antivirus doesnt like the .exe, in this case you can just go to the source folder and open DefCreator.py with python. When you start the program it will ask you the game and the mode the modes are explained in the following:
  • Accessory Mode:
    In this mode you find multiple selections that you can do, they are mostly self explanatory. The file ending .pmd etc. doesnt matter since my program ignores it and puts .pmd at the end automatically. It also doesnt matter if you use the entire path for the models or just the relative path to the base folder. The advanced mode is needed when creating objects that have more complex definition files for example when they use animations. To generate the .mat and .tobj file you should already have the corresponding .tga file in the materials/ui/accessory folder.
    pilloweasy.PNG
    pillowadvanced.PNG
    in both pictures, the generated file will be named pillow_ilg_01.sii and look like this

    Code: Select all

    SiiNunit
    {
    accessory_addon_data : pillow_ilg01.daf.xf.l_pillow
    {
    	name: "@@pillow_ilg_01@@"
    	price: 10
    	unlock: 0
    	icon: "pillow_ilg_01"
    	part_type: aftermarket
    
    	interior_model: "/vehicle/truck/upgrade/interior_decors/toybed/pillow_ilg_01.pmd"
    	interior_model_uk: "/vehicle/truck/upgrade/interior_decors/toybed/pillow_ilg_01_uk.pmd"
    }
    }
    
    
    it also generates the following pillow_ilg_01.mat and the pillow_ilg_01.tobj files which look like this:

    Code: Select all

    map 2d	pillow_ilg_01.tga
    addr	clamp_to_edge clamp_to_edge
    usage ui
    
    
    and

    Code: Select all

    material : "ui"
    {
    	texture : "pillow_ilg_01.tobj"
    	texture_name : "texture"
    }
    
    
    in the materials/ui/accessory folder.
  • Other Mode:
    This mode is more general and can be used when creating stuff that isnt an accessory but can also be used for accessories, however you wont be able to generate the .mat and .tobj file for the icon. You have to copy the text from your normal .sii file into content and need to replace the unit name for the truck with VEHICLE_UNIT_NAME. The following would give you the same result as above.
    pillowother.PNG
I never created an .exe file out of python files before so I dont know if python is needed or not but i hope it isnt needed, I also havent tested it for Linux/MacOS. Feel free to comment if you find some issues with the program.
Last edited by Sineptorro on 16 Aug 2022 17:20, edited 1 time in total.
User avatar
xeviax
Posts: 566
Joined: 22 Jun 2018 17:33

Re: DefCreator

#2 Post by xeviax » 16 Aug 2022 16:13

I would really like to use this tool but it is flagged by windows defender & also by virustotal. I hope this issue will be fixed.
Screenshot for reference.
[ external image ]
Sineptorro
Posts: 10
Joined: 06 May 2019 20:20

Re: DefCreator

#3 Post by Sineptorro » 16 Aug 2022 17:26

I removed the --onefile command when packing it now . This removed most of the false positives, its only Jiangmin crying now and windows defender cries since its an unknown source, but i dont think i can do anything against that.
User avatar
xeviax
Posts: 566
Joined: 22 Jun 2018 17:33

Re: DefCreator

#4 Post by xeviax » 16 Aug 2022 19:35

As you said, only 1 remains when analyzed by virus total but windows defender is no longer flagging it. Also, nice tool. I hope you have plans to add similar functionality for owned trailers in the future.
User avatar
ItzHonzula
Posts: 185
Joined: 19 Jan 2019 19:22
Location: Reichenberg, Czech Republic
Contact:

Re: DefCreator

#5 Post by ItzHonzula » 16 Aug 2022 19:46

sounds cool!

any plans for doing this for map mods too? :)
EuRoadNet and Projekt Česko developer.

silly nonbinary existence :3
Sineptorro
Posts: 10
Joined: 06 May 2019 20:20

Re: DefCreator

#6 Post by Sineptorro » 16 Aug 2022 23:17

So far i personally have only created accessories, but i probably gonna take a look at creating other stuff and will add new features for it then.
xeviax wrote: 16 Aug 2022 19:35 As you said, only 1 remains when analyzed by virus total but windows defender is no longer flagging it. Also, nice tool. I hope you have plans to add similar functionality for owned trailers in the future.
With Trailers its probably gonna be very similar to trucks, just another list. So i will take a look into it in the next weeks.
ItzHonzula wrote: 16 Aug 2022 19:46 sounds cool!

any plans for doing this for map mods too? :)
Since one of my goals is to create a little map mod for ATS its highly possible that i add a feature for it, when i think its useful, but for now i have absolutely no idea how the def files of a map mod work. So it will take some time until i can look at it.
User avatar
xeviax
Posts: 566
Joined: 22 Jun 2018 17:33

Re: DefCreator

#7 Post by xeviax » 17 Aug 2022 05:13

Sineptorro wrote: 16 Aug 2022 23:17
xeviax wrote: 16 Aug 2022 19:35 As you said, only 1 remains when analyzed by virus total but windows defender is no longer flagging it. Also, nice tool. I hope you have plans to add similar functionality for owned trailers in the future.
With Trailers its probably gonna be very similar to trucks, just another list. So i will take a look into it in the next weeks.
Sounds nice. :)
User avatar
xeviax
Posts: 566
Joined: 22 Jun 2018 17:33

Re: DefCreator

#8 Post by xeviax » 04 Sep 2022 06:13

Just curious if there is any progress. :)
Post Reply

Return to “Others”

Who is online

Users browsing this forum: No registered users and 14 guests