[REL] Selecting subsets of content for single-player

Discussion in 'Other' started by Seven Smiles, Sep 8, 2019.

  1. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,113
    Likes Received:
    1,160
    Your wish is my command :D

    If I've broken anything adding two lines to the program it's your fault.
     
    Dave^ and Filip like this.
  2. Dave^

    Dave^ Registered

    Joined:
    Oct 14, 2019
    Messages:
    263
    Likes Received:
    121
    I've been blamed for much worse! ;)
     
  3. Dave^

    Dave^ Registered

    Joined:
    Oct 14, 2019
    Messages:
    263
    Likes Received:
    121
    I wonder.... (hehe)

    Could you make it a 1-click script and have it do the uploading to Uwe's site?

    You might have to sort something out with him to be able to do it.

    Pre-complete the login details (not the most secure way to do things, but it's not like you use the same password elsewhere, do you?!) Upload the create file to the correct URL as given by Uwe and jobsagudden...

    Might be easier said than done, but if it's possible, it can be added to the startup folder so would be totally automated.
     
  4. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,113
    Likes Received:
    1,160
    And now (back on topic).... a gooey version: https://github.com/TonyWhitley/rFactory/releases/tag/V0.1.130
    ______________________________________________
    WARNING: Needs updating to latest pyinstaller to overcome its vulnerability GHSA-7fcj-pq9j-wh2r (if you want details: https://pyinstaller.readthedocs.io/en/v3.6/CHANGES.html) but at the moment there are errors in the build process so I haven't been able to make a new exe file. I don't think this is a particularly serious vulnerability in this case but it's up to you.
    ________________________________________________________________________________

    rFactoryModMaker.JPG
    It reads the folders in your rFactor and lists them in the windows. Select the ones you want then press => to move them to the selection window. Then click Create ModMaker.bat data file to save the file and finally Run rFactor 2 to load rFactor in single-player mode with only the mods you have selected. It's running the same batch file as earlier so that means they can share data files.

    If you want to remove mods from the selection windows select them and then press <= to remove them.

    If your rFactor and Steam are not in c:\programs.... then edit the entries rF2root and SteamExe in Datafiles\favourites\rFactoryConfig.JSON found wherever you put rFactoryModManager.exe
     
    Last edited: Jan 17, 2020
    philmcqueen, dylbie, Emery and 3 others like this.
  5. Hazi

    Hazi Registered

    Joined:
    Jan 15, 2012
    Messages:
    917
    Likes Received:
    146
    Genius!
     
  6. Emery

    Emery Registered

    Joined:
    Oct 24, 2010
    Messages:
    3,090
    Likes Received:
    1,796
    Yay! At last, something good enough to get me off my duff on getting myself more organized.
     
  7. Dave^

    Dave^ Registered

    Joined:
    Oct 14, 2019
    Messages:
    263
    Likes Received:
    121
    Not sure if I did something wrong, but it killed SimHub for me. :(
     
  8. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,113
    Likes Received:
    1,160
    I've never used SimHub so it's not something I've tested but I can't immediately think of anything ModMaker does that should upset it. (The new GUI just creates the data files, it then runs ModMaker.bat which is the same as when you were using it before).
     
  9. Dave^

    Dave^ Registered

    Joined:
    Oct 14, 2019
    Messages:
    263
    Likes Received:
    121
    No, I can't either. I'll do some more testing if nobody else is having an issue.

    I have a dash which just shows FFB values I use when trying settings, spent a hour or two trying to get it working, even rebooting a few times. Then I realised none of my other dashes worked either.

    Ran the game with the Steam launcher and it came back to life.
     
  10. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,113
    Likes Received:
    1,160
    ModMaker does bypass the Steam launcher - it makes sure Steam is running but then runs rFactor with
    Code:
    Bin64\rFactor2.exe  +singleplayer +path=<path to the mod set>
     
  11. Dave^

    Dave^ Registered

    Joined:
    Oct 14, 2019
    Messages:
    263
    Likes Received:
    121
    SimHub works fine if I drag n drop, doesn't work if I use the green "Run rFactor 2" button in your launcher, how odd!

    Other than this though, it's great.

    There's nothing worse than going into the game then trying to work out which car/track you need to use, much easier with your launcher open and whatever else to cross reference.

    ;)
     
    Seven Smiles likes this.
  12. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,113
    Likes Received:
    1,160
    Yeah. No idea. The green button code boils down to
    Code:
        _cmd = bundleFolder('ModMaker.bat') + ' ' + self.modmaker_file
        run(_cmd)
    It has its own copy of ModMaker.bat but it’s the same content.
     
  13. Dave^

    Dave^ Registered

    Joined:
    Oct 14, 2019
    Messages:
    263
    Likes Received:
    121
    As I spend more time scrolling though the list of cars & tracks, I've made myself a little batch file which creates a random.modfile.txt file, I've not tested it as yet, but it "should" work.

    @echo off
    echo Name=Random>random.modfile.txt
    set /a rand=%random% %% 213
    for /f "tokens=1* delims=:" %%i in ('findstr /n .* "c:\path\to\carlist.txt"') do (
    if "%%i"=="%rand%" echo %%j
    )>>random.modfile.txt
    set /a rand=%random% %% 337
    for /f "tokens=1* delims=:" %%i in ('findstr /n .* "c:\path\to\tracklist.txt"') do (
    if "%%i"=="%rand%" echo %%j
    )>>random.modfile.txt


    Just create a text file with a list of cars (start each line with "Vehicle=") & the same for tracks ("Location=").

    Maybe something you could add to your ModManager, SS.
     
  14. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,113
    Likes Received:
    1,160
    Clever but it doesn't quite work, you need something like
    Code:
    set /a rand=((%random% %% 213) ^& 7) + 1
    
    to get a rand in the range 1-8 (and then 8 cars and tracks to choose from). Definitely something that would be a lot better in Python!

    Not really sure of the point though - why would you want to pick a random car and track?
     
  15. Dave^

    Dave^ Registered

    Joined:
    Oct 14, 2019
    Messages:
    263
    Likes Received:
    121
    Hotlapping, I only need one car and one track... ;)
     
  16. biancazzurro

    biancazzurro Registered

    Joined:
    Dec 24, 2011
    Messages:
    32
    Likes Received:
    11
    Sorry Dave what do you mean "drag and drop", I have tried to launch simhub and then rfactor2 from rf2 launcher without success simhub does not work
     
  17. Dave^

    Dave^ Registered

    Joined:
    Oct 14, 2019
    Messages:
    263
    Likes Received:
    121
    Drag your *.modfile.txt and drop it on the modmaker.bat file.
     
    biancazzurro likes this.
  18. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,113
    Likes Received:
    1,160
    biancazzurro likes this.
  19. Vanisch

    Vanisch Registered

    Joined:
    Oct 21, 2018
    Messages:
    130
    Likes Received:
    80
    what am I doing wrong? I just can not get it ...
    thank you for your help

    d:\Zusatz\Steam\steamapps\common\rFactor 2>rfactorymodmanager.exe
    Traceback (most recent call last):
    File "rFactoryModManager.py", line 290, in <module>
    File "rFactory.py", line 140, in __init__
    File "tabModSelection.py", line 36, in __init__
    ValueError: max() arg is an empty sequence
    [10524] Failed to execute script rFactoryModManager
    d:\Zusatz\Steam\steamapps\common\rFactor 2>

    here is the changed .json file:
    "# %ProgramFiles(x86)% will be expanded to your Windows setting but you can write it explicitly if you want": "",
    "# Same for %LOCALAPPDATA%": "",
    "# Use / not backslash": "",
    "#MyPostCommand: use this call a program or batch file after rF2 runs": "",
    "#MyPreCommand: use this call a program or batch file before rF2 runs": "",
    "#SteamDelaySeconds: How long it takes Steam to start up before we can start rF2": "",
    "CrewChiefArgs": "RF2_64BIT",
    "CrewChiefExe": "\"%ProgramFiles(x86)%/Britton IT Ltd/CrewChiefV4/CrewChiefV4.exe\"",
    "DiscordArgs": "--processStart Discord.exe",
    "DiscordExe": "%LOCALAPPDATA%/Discord/Update.exe",
    "MyPostCommand": "",
    "MyPostCommandArgs": "",
    "MyPreCommand": "",
    "MyPreCommandArgs": "",
    "SteamDelaySeconds": 10,
    "SteamExe": "d:/Zusatz/Steam/steam.exe",
    "TeamSpeakExe": "\"%ProgramFiles(x86)%/TeamSpeak 3 Client/ts3client_win64.exe\"",
    "UserData player": "player",
    "VolumeControlExe": "\"%ProgramFiles(x86)%/VolumeControl/VolumeControl.exe\"",
    "rF2root": "d:/Zusatz/Steam/steamapps/common/rFactor 2"
    }
     
  20. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,113
    Likes Received:
    1,160
    You would get that if d:/Zusatz/Steam/steamapps/common/rFactor 2/Installed/Vehicles is empty. At that point the program is listing all the vehicles to find out which has the longest name. The list (sequence) it has got has nothing in it.

    Or...
    What you've posted is missing the { at the beginning. I assume that's just a typo but if there is an error in the JSON file the program will write a new one with the default
    "rF2root": "%ProgramFiles(x86)%/Steam/steamapps/common/rFactor 2"


    One day I'll add a sanity check to validate rF2root.
     
    Last edited: Dec 5, 2019

Share This Page