Skip to content

Instantly share code, notes, and snippets.

View david-wm-sanders's full-sized avatar
🖋️
up late

David Sanders david-wm-sanders

🖋️
up late
View GitHub Profile
from dataclasses import dataclass
from pathlib import Path
import xml.etree.ElementTree as XmlET
import bpy
STEAMLIB_DIR = """C:\Program Files (x86)\Steam"""
PACKAGE_NAME = "vanilla"
@david-wm-sanders
david-wm-sanders / model.py
Last active October 17, 2022 04:24
Load a RWR voxel model into Blender
from dataclasses import dataclass
from pathlib import Path
import xml.etree.ElementTree as XmlET
import bpy
STEAMLIB_DIR = """C:\Program Files (x86)\Steam"""
PACKAGE_NAME = "vanilla"
@david-wm-sanders
david-wm-sanders / voxel-recolourer.py
Created October 15, 2022 14:50
Recolour a RWR voxel model
import sys
import xml.etree.ElementTree as XmlET
from pathlib import Path
from statistics import fmean
if __name__ == '__main__':
if (l := len(sys.argv)) != 2:
print(f"Error: incorrect number of parameters provided: expected 1, got {l-1}")
sys.exit(1)
@david-wm-sanders
david-wm-sanders / rwrcsm.md
Last active June 24, 2025 19:40
Client-side mod examples for RWR

Examples of existing client-side mods:

  • Replacing a map's map.png to mark potential special crate locations
  • Increasing a weapon's sight_range_modifier to see further away
  • Removing screen shake for better shooting control during artillery strikes (and other blasts)
  • Scaling loot meshes and/or modifying loot textures for improved visibility
  • Renaming special crates so that they show their contents in their hover-over text
  • Adding additional ladders to maps
  • Tweaking animation frames to add more push "commands"
  • Modifying weapon sounds so that rare weapons are easier to hear on the battlefield
  • Adding/modifying item_containers
@david-wm-sanders
david-wm-sanders / sanitise.py
Created July 17, 2022 14:34
Sanitises a folder of RWR profiles
import sys, time, hashlib, zipfile
from collections import Counter
from pathlib import Path
import xml.etree.ElementTree as XmlET
script_dir = Path(__file__).parent
salt_file = script_dir / "salt.txt"
salt_info = "A salt is required for the hash function used to protect the player SIDs.\n" \
"This salt must remain constant once set in order for alts to be coalesced " \
@david-wm-sanders
david-wm-sanders / genpyi_example.txt
Created June 15, 2022 00:42
PySide6 command to regen .pyi stubs for snake_case and/or true_property features
pyside6-genpyi all --feature snake_case true_property
@david-wm-sanders
david-wm-sanders / rwr_settings_snippet.xml
Last active June 16, 2022 17:38
RWR settings.xml controls explained
<keyboard_controls>
<!-- UP: W (0x11) -->
<control0 value="17" />
<!-- DOWN: S (0x1F) -->
<control1 value="31" />
<!-- LEFT: A (0x1E) -->
<control2 value="30" />
<!-- RIGHT: D (0x20) -->
<control3 value="32" />
<!-- RELOAD: R (0x13) -->
import sys
import xml.etree.ElementTree as XmlET
from pathlib import Path
if __name__ == '__main__':
if (l := len(sys.argv)) != 3:
print(f"Error: incorrect number of parameters provided: expected 2, got {l-1}")
sys.exit(1)
# Deprecated - see https://github.com/david-wm-sanders/twitchget
"""twitchget
Usage: twitchget.py <target> <download_dir>
"""
import shutil
import sqlite3
import subprocess
from pathlib import Path