# [REL] Selecting subsets of content for single-player

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

1. ### Seven SmilesRegistered

Joined:
Oct 5, 2010
Messages:
740
799

If I've broken anything adding two lines to the program it's your fault.

Dave^ and Filip like this.
2. ### Dave^Registered

Joined:
Oct 14, 2019
Messages:
124
49
I've been blamed for much worse!

3. ### Dave^Registered

Joined:
Oct 14, 2019
Messages:
124
49
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 SmilesRegistered

Joined:
Oct 5, 2010
Messages:
740
799
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.
________________________________________________________________________________

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.

Joined:
Jan 15, 2012
Messages:
756
74
Genius!

6. ### EmeryRegistered

Joined:
Oct 24, 2010
Messages:
2,604
1,253
Yay! At last, something good enough to get me off my duff on getting myself more organized.

7. ### Dave^Registered

Joined:
Oct 14, 2019
Messages:
124
49
Not sure if I did something wrong, but it killed SimHub for me.

8. ### Seven SmilesRegistered

Joined:
Oct 5, 2010
Messages:
740
799
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^Registered

Joined:
Oct 14, 2019
Messages:
124
49
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 SmilesRegistered

Joined:
Oct 5, 2010
Messages:
740
799
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^Registered

Joined:
Oct 14, 2019
Messages:
124
49
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 SmilesRegistered

Joined:
Oct 5, 2010
Messages:
740
799
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^Registered

Joined:
Oct 14, 2019
Messages:
124
49
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=").

14. ### Seven SmilesRegistered

Joined:
Oct 5, 2010
Messages:
740
799
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^Registered

Joined:
Oct 14, 2019
Messages:
124
49
Hotlapping, I only need one car and one track...

16. ### biancazzurroRegistered

Joined:
Dec 24, 2011
Messages:
32
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^Registered

Joined:
Oct 14, 2019
Messages:
124
49
Drag your *.modfile.txt and drop it on the modmaker.bat file.

biancazzurro likes this.
18. ### Seven SmilesRegistered

Joined:
Oct 5, 2010
Messages:
740
799
biancazzurro likes this.
19. ### VanischRegistered

Joined:
Oct 21, 2018
Messages:
48
40
what am I doing wrong? I just can not get it ...

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"
}

Joined:
Oct 5, 2010
Messages:
740