by Troler
python.exe .\notgitwindows.py update, which is an adapted version of notgit.py for Windows. First, it changes / to \, because Windows separates directories differently. It copies the settings.py file from a special folder called billgates to the main directory, because Linux writes stuff to the /home directory, which doesn't exist on Windows. Instead I saves it to an ad-hoc directory on Windows. This hack and some minor adjustments, make so settings.py doesn't have to be modified every update.
β© Reply
UPBGE, but it didn't get past the load screen. That's to be expected, there were changes to the settings.py file. As such, I went to https://blenderdumbass.org/danisrace/download//Scripts/Settings.py and downloaded the settings.py file supplied by the game. Then I do a diff -B to see what are the changes, without whitespace.
β© Reply
$ diff -B Settings.py Settingsnew.py 5a6,7 > import time > import getpass 18a21 > from Scripts import Online 31c34 < data_dir = os.path.expanduser("C:\\Superfluous\\DanisRace\\config") --- > data_dir = os.path.expanduser("~/.local/share/"+game) 165c168 < "veh_shoot" :"shoot", --- > "veh_shoot" :"shoot", 193a197,198 > settings = bge.logic.globalDict.get("settings") > 196a202,207 > if bge.logic.globalDict.get("save-game-name"): > data["name"] = bge.logic.globalDict["save-game-name"] > > data["online"] = bge.logic.globalDict.get("send-stats-online", False) > data["username"] = settings.get("username", getpass.getuser()) > 209a221,229 > > # Recording total time spent by the player in the game. > data["time-played"] = bge.logic.globalDict.get("time-played", 0) + bge.logic.getRealTime() > data["lastsession"] = { > "time-played":bge.logic.getRealTime(), > "timestamp":float(time.time()) > } > > data["cheats-used"] = bge.logic.globalDict.get("cheats-used", 0) 220a241,243 > if bge.logic.globalDict.get("send-stats-online"): > Online.SendAccount(f) > 227c250 < --- > 237a261,263 > bge.logic.globalDict["save-game-name"] = data.get("name") > bge.logic.globalDict["send-stats-online"] = data.get("online") > 254c280,286 < --- > > # To keep track of players time spent in the game > bge.logic.globalDict["time-played"] = data.get("time-played", 0) > > # Keeping track of used cheats > bge.logic.globalDict["cheats-used"] = data.get("cheats-used", 0)c:1
Scripts/Online.py, there's a direct use of curl. But my version of Windows has curl.exe, meaning I had to put Online.py to billgates folder and change notgitwindows.py file. The issue is that Online.py import notgit.py, which has GetGameId() function, that's not present in notgitwindows.py file. So I had to manually add it.
β© Reply
return open(GETCWD()+"/.notgit/gameid").read()
SaveGameID() function, which also had to be converted. And on top of that, the function GetSimple() got updated as well. Which means I had to convert it to a Windows friendly language. At this point I'm considering that the 90s monopoly of Windows wasn't such a bad thing. You had a single OS you had to deal with, Linux and MacOS were for weirdos. Those were the days. Everything just werked. But now I have to patch Python code. Python! A cross-platform language. What is this C++ hell?!
β© Reply
.notgit/gameid file to have my username in it. FreeSoftware, you can do whatever you want!
β© Reply
name and online. Online value must be set to true, to have a leaderboard. As such, I added these values to my config/save.json file, because that's where I set it in Settings.py file.
β© Reply
config/config.json I added the value username with my username. This way the game would know how I'm called.
β© Reply
P. It worked!
β© Reply
Scripts.Settings.py file and changed the function that finds the save-folder ( a folder where the save data is stored ).
Scripts.Settings.py the function looks like this:
def get_settings_folder(game="danisrace"): try: data_dir = os.environ["XDG_DATA_HOME"] + "/" + game except: data_dir = os.path.expanduser("~/.local/share/"+game) try: os.makedirs(data_dir) except: pass return data_dir
~/.local/share/danisrace. If you play the game on GNU / Linux this is where your save-file and config file and stuff will end up being. But this folder cannot exist on Windows.
~ sign itself is something that I believe makes no sense on Windows. This is a short way to refer to the users home directory. For me it is /home/vcs for you it could be something else. This is why the game code uses specifically ~ and is not trying to hardcode anything.
/ is inherently up-side-down in Windows. Every other operating system uses / but Windows uses fucking \ instead. Just to be different I guess. What the fuck, Microslop!?!
\ in python represents an escape symbol. Say you want to write a string Hello World in python and assign it to x.
x = "Hello World"
Hello "World"? Do you do?:
x = "Hello "World""
Hello is the string. And then you just put a World variable, without any operation. And then just an empty string "" in the end. So how can you do that.
x = "Hello \"World\""
\ before the " is the trick to let python understand you. But what if you want to actually use \ itself? Well fuck that. You must do \\ then.
/home/vcs/.local/share/danisrace in Windows will look like this C:\\home\\vcs\\.local\\share\\danisrace. WHAT THE FUCK?!!?!
notgit.py ) you must save them into the \\ Windows way, but fetch them in the / standard way, because guess what, internet urls aren't windows-stupid.
Scripts.Settings.py file and changed the function that finds the save-folder ( a folder where the save data is stored ).
Scripts.Settings.py the function looks like this:
def get_settings_folder(game="danisrace"): try: data_dir = os.environ["XDG_DATA_HOME"] + "/" + game except: data_dir = os.path.expanduser("~/.local/share/"+game) try: os.makedirs(data_dir) except: pass return data_dir
~/.local/share/danisrace. If you play the game on GNU / Linux this is where your save-file and config file and stuff will end up being. But this folder cannot exist on Windows.
~ sign itself is something that I believe makes no sense on Windows. This is a short way to refer to the users home directory. For me it is /home/vcs for you it could be something else. This is why the game code uses specifically ~ and is not trying to hardcode anything.
/ is inherently up-side-down in Windows. Every other operating system uses / but Windows uses fucking \ instead. Just to be different I guess. What the fuck, Microslop!?!
\ in python represents an escape symbol. Say you want to write a string Hello World in python and assign it to x.
x = "Hello World"
Hello "World"? Do you do?:
x = "Hello "World""
Hello is the string. And then you just put a World variable, without any operation. And then just an empty string "" in the end. So how can you do that.
x = "Hello \"World\""
\ before the " is the trick to let python understand you. But what if you want to actually use \ itself? Well fuck that. You must do \\ then.
/home/vcs/.local/share/danisrace in Windows will look like this C:\\home\\vcs\\.local\\share\\danisrace. WHAT THE FUCK?!!?!
notgit.py ) you must save them into the \\ Windows way, but fetch them in the / standard way, because guess what, internet urls aren't windows-stupid.

git for this game. Instead, most changes will be recorded via the notgit.py program I wrote for fun the other day.
![[thumbnail]](/pictures/user_upload/Troler/NGWJ6K0NF96N3RYQ.png)
Troler