ConverterPIX - Game formats to middle formats

Post any tutorial and tools you might find it useful for other creators.
User avatar
abasstreppas
Posts: 7499
Joined: 06 Feb 2013 20:32
Location: Back on Öland again
Contact:

Re: ConverterPIX - Game formats to middle formats

#131 Post by abasstreppas » 30 Jul 2017 19:30

Great work mwl4, will you update the first page with that post too. It is easier to find all new parameters then ;)
User avatar
50keda
SCS Software
Posts: 1699
Joined: 07 Dec 2012 11:59

Re: ConverterPIX - Game formats to middle formats

#132 Post by 50keda » 30 Jul 2017 19:37

Well this simply calls for a importer wrapper :) Now as we have listings user could be able to select file and even navigate to desired model and as last import it ... hmm....
User avatar
50keda
SCS Software
Posts: 1699
Joined: 07 Dec 2012 11:59

Re: ConverterPIX - Game formats to middle formats

#134 Post by 50keda » 31 Jul 2017 10:10

@abass: but there is a problem... What happens when someone does that on a mod and mod is not "standalone" with some missing resources? Fallback to base I guess... that wrapper addon should have same input as B2SCS had: 2 paths, where second is just for a fallback...
User avatar
SiSL
SCS Software
Posts: 8665
Joined: 27 Oct 2013 06:23
Contact:

Re: ConverterPIX - Game formats to middle formats

#135 Post by SiSL » 31 Jul 2017 10:17

well, it does not list some of SCS# I had so I assume not all SCS# can be extracted or listed
User avatar
mwl4
Posts: 88
Joined: 25 Dec 2012 16:06
Location: Poland
Contact:

Re: ConverterPIX - Game formats to middle formats

#136 Post by mwl4 » 31 Jul 2017 11:29

@SiSL, it is not depended on implementation, but rather on available information in SCS# format. Idea of the HashFS is storing the hashes, not paths.
Basically you can only get real paths by reading directory file (this is some trick, directory content is stored in file named as directory path). So for example in base.scs "/" file looks like:

Code: Select all

*automat
*contentbrowser
*dlc
*effect
*font
*map
*material
*model
*model2
*prefab
*prefab2
*road_template
*sound
*system
*ui
*unit
*vehicle
*video
autoexec.cfg
version.txt
* on the beginning means directory.

"/vehicle" file looks as follows:

Code: Select all

*ai
*driver
*share
*trailer_eu
*truck
*wheel
Of course directory files are flagged as directory. There is no other way to list files from HashFS. You can extract all files from HashFS, however you will not have paths, what is not desired I think.

Additionally, some .scs files do not have "/" file inside (like locale.scs), but they have "/locale" directory for instance:
locale.scs/locale:

Code: Select all

*bg_bg
*ca_es
*cs_cz
*cy_gb
*da_dk
*de_de
*el_gr
*en_gb
*en_us
*es_es
*es_la
*et_ee
*eu_es
*fi_fi
*fr_fr
*gl_es
*hr_hr
*hu_hu
*it_it
*ja_jp
*ka_ge
*ko_kr
*lt_lt
*lv_lv
*mk_mk
*nl_nl
*no_no
*pl_pl
*pl_si
*pt_br
*pt_pt
*ro_ro
*ru_ru
*sk_sk
*sl_sl
*sr_sp
*sr_sr
*sv_se
*tr_tr
*uk_uk
*vi_vn
*zh_cn
*zh_tw
autodetect.conf
locale.rev
locale.scs/locale/pl_pl:

Code: Select all

local.override.sii
local.sii
mails.sii
@50keda, ConverterPIX supports multiple base paths.
User avatar
SiSL
SCS Software
Posts: 8665
Joined: 27 Oct 2013 06:23
Contact:

Re: ConverterPIX - Game formats to middle formats

#137 Post by SiSL » 31 Jul 2017 11:32

Ah makes sense now. I guess "/" didn't work that way, thanks for the update mate , btw, small request, if I accidently type wrong name of folder to extract or forgot quotes for base folder, application crashes, may be it would just be best to file folder exists check and exit on error.
User avatar
mwl4
Posts: 88
Joined: 25 Dec 2012 16:06
Location: Poland
Contact:

Re: ConverterPIX - Game formats to middle formats

#138 Post by mwl4 » 31 Jul 2017 11:56

Well, this might be fixed, however better solution will be just providing GUI to the application :-)
User avatar
SiSL
SCS Software
Posts: 8665
Joined: 27 Oct 2013 06:23
Contact:

Re: ConverterPIX - Game formats to middle formats

#139 Post by SiSL » 02 Aug 2017 01:46

Not GUI but I made a small Batch file for Windows.

Copy following code to a Notepad file, edit path variables in for your directories (game files, extraction path, convertion path) save it in same folder with scs_extractor.exe and converter_pix.exe and run it. It automatically select 1st choice in 90 seconds.

[ external image ]

Code: Select all

@echo off

setlocal

set GAMEPATH=D:\Oyunlar\Steam\SteamApps\common\Euro Truck Simulator 2
set EXTPATH=E:\ETS2\ETS2Base
set CNVPATH=E:\ETS2\ETS2Base_exp


cls
echo.
echo     SiSL's EXTRACT HELPER
echo ------------------------------------------------------------
echo.
echo    [1] CLEAN FULL EXTRACT ^& CONVERT (DEFAULT)
echo. 
echo        Cleans Base folder, extracts all files and DLC
echo        and converts them to PIM
echo. 
echo    [2] EXTRACT ALL FILES ^& CONVERT
echo.
echo        Does not clean base folder, extracts all files and DLC
echo        and converts
echo. 
echo    [3] CLEAN CONVERT
echo.
echo        Converts from SCS files directly from game folder. 
echo        Does not extract any files seperately.
echo. 
echo    [4] CONVERT EXISTING BASE FOLDER
echo. 
echo    [5] EXIT
echo.
echo    Please press key of your choice. [1] 

C:\Windows\System32\choice.exe /c:12345 /n /t:90 /D:1

IF ERRORLEVEL 5 ( 
 goto:eof
)
IF ERRORLEVEL 4 (
  call :convertpix
  echo SiSL's EXTRACT HELPER Finished
  goto:eof
)
IF ERRORLEVEL 3 (
  call :cleancnv
  call :convbase
  echo SiSL's EXTRACT HELPER Finished
  goto:eof
)
IF ERRORLEVEL 2 (
  call :extractscs
  call :convertpix
  echo SiSL's EXTRACT HELPER Finished
  goto:eof
)
IF ERRORLEVEL 1 (
  call :cleanfolders 
  call :extractscs
  call :convertpix
  echo SiSL's EXTRACT HELPER Finished
  goto:eof
) 



GOTO:eof

:cleanfolders
  cls
  echo Cleaning Folders...
  RD "%EXTPATH%" /S /Q
  RD "%CNVPATH%" /S /Q
  MD "%EXTPATH%"
  goto:eof
  
:extractscs
  echo.
  echo Extracting SCS files...
  scs_extractor.exe "%GAMEPATH%\def.scs" "%EXTPATH%"
  scs_extractor.exe "%GAMEPATH%\effect.scs" "%EXTPATH%"
  scs_extractor.exe "%GAMEPATH%\base.scs" "%EXTPATH%"
  for %%f in ("%GAMEPATH%\dlc_*.scs") do (
  	FOR %%i IN ("%%f") DO (
			 echo. 
			 echo Extracting %%~ni
		)	
  	scs_extractor.exe "%%f" "%EXTPATH%"
  
  )
  goto:eof

:convertpix
  echo.
  echo Converting entire Base folder...
  converter_pix "%EXTPATH%" -e "%CNVPATH%"
  goto:eof

:cleancnv 
 RD "%CNVPATH%" /S /Q

:convbase
  cls
  echo. 
  echo Extracting def.scs
  converter_pix -b "%GAMEPATH%\def.scs" -e "%CNVPATH%" -extract_d /
  echo. 
  echo Extracting base.scs
  converter_pix -b "%GAMEPATH%\base.scs" -e "%CNVPATH%" -extract_d /
  
  for %%f in ("%GAMEPATH%\dlc_*.scs") do (
			FOR %%i IN ("%%f") DO (
			 echo. 
			 echo Extracting %%~ni
			
			)	

      converter_pix -b "%%f" -e "%CNVPATH%" -extract_d /
 )
 goto:eof
 
Don't forget to change these lines:

Code: Select all

set GAMEPATH=D:\Oyunlar\Steam\SteamApps\common\Euro Truck Simulator 2
set EXTPATH=E:\ETS2\ETS2Base
set CNVPATH=E:\ETS2\ETS2Base_exp
User avatar
50keda
SCS Software
Posts: 1699
Joined: 07 Dec 2012 11:59

Re: ConverterPIX - Game formats to middle formats

#140 Post by 50keda » 02 Aug 2017 06:12

@mwl: Yesteday I tried new version however had problems because I tried to convert sth directly from ZIP, do you plan to add zip support soon? Now as you have HashFS it would be also nice to have zip support otherwise my idea of importing models will have to wait.
Post Reply

Return to “User Tutorials & Tools”

Who is online

Users browsing this forum: No registered users and 1 guest