Cossacks 3 (text)Mod Manager BATCH file 1.3.11

Discussion in 'Modding' started by Gambler71, Oct 5, 2016.

  1. Gambler71

    Gambler71 New Member

    As I am too lazy to remember things, I have created a little batch file to go along with Lieutenant-Général's Mod Manager. It allows you to run the mod script without any thought (hopefully), thus making install/uninstall/list much easier. I chose a batch file as the code is open for all to see.

    NOTE: when I installed python 3.5.x I ticked the box adding python to PATH <-- important
    NOTE: requires WINDOWS XP or later


    Update 1.3.11
    Following is the code for anyone to view:
    Drag and Drop file "_drag n drop json mods here.bat":
    Code:
    @echo off
    REM created by Gambler71
    REM v1.3.11
    set which="main"
    IF "%~1"=="" GOTO NoParam
    :MainQ
    echo.
    echo.
    echo Do you wish to INSTALL/UNINSTALL this mod "%~n1"
    echo.
    choice /C iunlc /N /M "press  i [INSTALL] or  u [UNINSTALL] or  n [MOD INFO] or  l [LIST INSTALLED] or  c [CANCEL]:"
    if ERRORLEVEL 5 GOTO EndOfFile
    if ERRORLEVEL 4 GOTO ListMods
    if ERRORLEVEL 3 GOTO ModInfo
    if ERRORLEVEL 2 GOTO UninstallMod
    cd..
    echo.
    echo python "%cd%\c3mm.py" install "%~n1"
    echo.
    python "%cd%\c3mm.py" install "%~n1"
    GOTO ShowUser
    :NoParam
    set which="noparams"
    echo.
    echo PLEASE drag a JSON file here to install / uninstall
    echo.
    echo.
    GOTO ShowUser
    :ListMods
    cd..
    echo.
    echo python "%cd%\c3mm.py" giveall
    echo.
    python "%cd%\c3mm.py" giveall
    GOTO MainQ
    :ModInfo
    cd..
    echo.
    echo python "%cd%\c3mm.py" info "%~n1"
    echo.
    python "%cd%\c3mm.py" info "%~n1"
    GOTO MainQ
    :UninstallMod
    choice /N /M "Really uninstall '%~n1' mod? Y/N:"
    if ERRORLEVEL 2 GOTO EndOfFile
    cd..
    echo.
    echo python "%cd%\c3mm.py" uninstall "%~n1"
    echo.
    python "%cd%\c3mm.py" uninstall "%~n1"
    GOTO ShowUser
    :ShowUser
    pause
    :EndOfFile
    Clickable file "_install-uninstall-list all.bat":
    Code:
    @echo off
    REM created by Gambler71
    REM v1.3.11
    echo.
    echo.
    echo Install (I) All mods in mod directory?  or
    echo Uninstall (U) All mods in mod directory?  or
    echo See the list (L) of installed mods?  or
    echo cancel (C)?
    echo.
    choice /C iulc /N /M "Enter your choice:"
    if ERRORLEVEL 4 GOTO EndOfFile
    if ERRORLEVEL 3 GOTO ListMods
    if ERRORLEVEL 2 GOTO UninstallAll
    GOTO InstallAll
    :ListMods
    cd..
    echo.
    echo python "%cd%\c3mm.py" giveall
    echo.
    python "%cd%\c3mm.py" giveall
    GOTO ShowUser
    :UninstallAll
    echo.
    choice /N /M "Really uninstall all mods? Y/N:"
    if ERRORLEVEL 2 GOTO EndOfFile
    cd..
    echo.
    echo python "%cd%\c3mm.py" uninstall_all
    echo.
    python "%cd%\c3mm.py" uninstall_all
    GOTO ShowUser
    :InstallAll
    echo.
    choice /N /M "Really install all mods? Y/N:"
    if ERRORLEVEL 2 GOTO EndOfFile
    cd..
    echo.
    echo python "%cd%\c3mm.py" install_all
    echo.
    python "%cd%\c3mm.py" install_all
    GOTO ShowUser
    :ShowUser
    pause
    :EndOfFile

    How to use:
    1. Download the file below (or copy the code from the above spoiler and create your own "_drag n drop json mods here.bat" file.)

    2. Unzip it into the mod directory (see the mod manager link above)
    possibly: "C:\Program Files (x86)\Steam\steamapps\common\Cossacks 3\mod"

    3. Drag and Drop ".JSON" files onto the "_drag n drop json mods here.BAT" file and follow the onscreen instructions ... or double click the "_install-uninstall-list all.BAT" file if you wish to Install/Uninstall All.

    MODDERS: you can use/edit this batch file as you see fit, including editing into other languages, inclusion in mod packs, whatever, DOS is for everyone. Please just reference me.

    Final Note: I am not a programmer but I have tested the BAT files and it appears they work as intended. Use at your own risk.

    Thanks to:
    * Lieutenant-Général
    * StriKe jk
    * all the hardworking mod contributers
    * everyone who worked on creating this wonderful game :)

    - updated compatability to MM 1.3.11 script
    - split the functions into 2 files
    - added INSTALL ALL

    - updated compatability to MM 1.3.7 script
    - added view MOD INFO
    - added UNINSTALL ALL

    - make sure the script is in the games main directory (pay attention to the correct name of the script):
    "C:\Program Files (x86)\Steam\steamapps\common\Cossacks 3\c3mm.py"​
    - make sure the mod directory is correct:
    "C:\Program Files (x86)\Steam\steamapps\common\Cossacks 3\mod"​
    - make sure the BATCH file and JSON (mod) file is in the MOD directory
    - make sure PATH was ticked when installing python (see the picture 5 posts below)
     

    Attached Files:

    Last edited: Oct 9, 2016
    BombaRuLz likes this.
  2. StriKe jk

    StriKe jk Member

    That is indeed very important. Maybe we should make an FAQ how to install python correctly.

    I giggled reading this :p I doubt there are any below-XP users on the internet. (Does that old internet explorer even work?o_O)

    Hopefully we will get steam workshop anytime soon and then we won't need any of these third party things anymore.
    Anyway, nice work :cool:
     
  3. Gambler71

    Gambler71 New Member

    Thanks

    I hope so 2.
     
  4. Lieutenant-Général

    Lieutenant-Général Active Member

    Very great. I add a link to your post in my thread.
    You have just a box to check, no?
     
  5. StriKe jk

    StriKe jk Member

    Dunno, had it installed prior to this :D
     
  6. Gambler71

    Gambler71 New Member

    Yes, it said "Add Python 3.5 to PATH".

    As per this image (you can use it if it looks good enough): install-python-on-windows.jpg
     
  7. Gambler71

    Gambler71 New Member

    Updated to 1.3.7 ... I decided to use the same version number as the MM python script so that it would be less confusing to users.
     
  8. Gambler71

    Gambler71 New Member

    Updated to 1.3.11
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice