Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
9770ecb
New Meta.ini
Hampo Jul 25, 2019
2f33744
Break down HandleMission
Hampo Jul 25, 2019
269859c
Updated CustomFiles.ini
Hampo Jul 25, 2019
fc534f8
Fixed CustomFiles.ini
Hampo Jul 25, 2019
7f1c064
Initial Modular
Hampo Jul 25, 2019
7ee76c8
Updated Modular System
Hampo Jul 30, 2019
74fd5bf
Fully modular
Hampo Jul 30, 2019
cc33a2f
Modular improvements
Hampo Aug 2, 2019
70706cd
Modular Updates
Hampo Aug 25, 2019
0c297b9
Bug fixes
Hampo Aug 25, 2019
6086c2a
Modular update
Hampo Sep 10, 2019
297eb45
I missed a comma
Hampo Sep 11, 2019
4a9d2c6
Bug fix
Hampo Oct 3, 2019
4768125
Bug fixes - Module sort order - Cars in Random Items
Hampo Oct 5, 2019
03b9515
Update RandomItems.lua
Hampo Oct 5, 2019
a3b74fe
Bug Fixes - Start Of New Feature - Settings Migration
Hampo Oct 6, 2019
e5c15a4
Update CustomFiles.lua
Hampo Oct 6, 2019
848c450
Features and Bug Fixes
Hampo Oct 8, 2019
ece460b
Bug fixes
Hampo Oct 10, 2019
f99b80c
DebugSettings and RandomStaticCar improvements
Hampo Oct 10, 2019
e1354cb
Bug fixes
Hampo Oct 10, 2019
5c7c592
Bug Fixes and Features
Hampo Oct 15, 2019
ead7a22
Bug Fixes
Hampo Oct 16, 2019
c618c94
Give AI massive tire grip
EnAppelsin Oct 22, 2019
4bc2007
Fix Random Car Scale
EnAppelsin Oct 28, 2019
5a4e193
Additions and bug fixes
Hampo Oct 29, 2019
afbd005
Fixed RandomLevelMissions
Hampo Oct 29, 2019
36fef82
Bug fixes
Hampo Oct 29, 2019
37dac91
Update RandomLevelMissions.lua
Hampo Oct 29, 2019
98ad3a2
Decompress compressed P3D files
EnAppelsin Nov 7, 2019
36f6a39
Random text support
EnAppelsin Nov 7, 2019
6c755fb
Merge branch 'Modular-Scripts' of https://github.com/EnAppelsin/SHARC…
EnAppelsin Nov 7, 2019
8e3c8d8
Update P3D.lua
EnAppelsin Nov 7, 2019
8837b60
Add mistakenly deleted P3D functions
EnAppelsin Nov 7, 2019
f41e870
Minor adjustments
Hampo Nov 7, 2019
42a8097
SpeedrunMode
Hampo Nov 7, 2019
b13c34b
Fix Speedrun Mode
EnAppelsin Nov 9, 2019
b82a919
Update Meta.ini
EnAppelsin Nov 9, 2019
cc8057e
Update chair.con
EnAppelsin Nov 15, 2019
0aaebd5
Dev build defaults to high debugging output
EnAppelsin Nov 24, 2019
7b2595c
Add warnings for static car modification due to p3d issues
EnAppelsin Nov 24, 2019
9069058
Fix speedrun mode settings
EnAppelsin Nov 24, 2019
7552ab0
Fixed Speedrun Mode
Hampo Nov 24, 2019
7f64d37
Update HandleCar for mission vehicles properly
EnAppelsin Feb 2, 2020
1ff6d87
CustomChars
Hampo Feb 8, 2020
99f9482
Custom Chars Bug Fixes
Hampo Feb 8, 2020
badf0cb
Bug Fixes - Start of P3DChunk Class
Hampo Feb 18, 2020
9fab690
Update P3DChunk.lua
Hampo Feb 18, 2020
1772a80
P3D Class System Improvements
Hampo Feb 19, 2020
23b84a0
Update P3D.lua
Hampo Feb 19, 2020
f4fb1a3
Update P3DChunk.lua
Hampo Feb 19, 2020
dc9f75f
Update P3DChunk.lua
Hampo Feb 19, 2020
c9253e4
P3D stuff
Hampo Feb 19, 2020
134f149
P3D
Hampo Feb 19, 2020
94288f2
Update P3DChunk.lua
Hampo Feb 19, 2020
2e14e42
ColourList Improvements
Hampo Feb 19, 2020
d3111db
P3D
Hampo Feb 19, 2020
b4d4afb
Migration to P3D Lib
Hampo Mar 10, 2020
3ff4752
Frontend automation
Hampo Mar 10, 2020
1026259
P3D improvements
Hampo Mar 11, 2020
623c74c
Update to RandomDialogue
Hampo May 21, 2020
c723c5c
RandomDialogue improvements
Hampo May 22, 2020
0e1fe01
Bug fixes
Hampo May 22, 2020
a38960b
Merge pull request #58 from EnAppelsin/P3DLib
Hampo May 22, 2020
a633bfc
Update README.md
Hampo May 22, 2020
88965ca
v2.1 final (hopefully)
Hampo Jun 21, 2020
95609aa
v2.1 actually final (hopefully)
Hampo Jun 21, 2020
8a0cbf8
Update README.md
Hampo Jun 21, 2020
0128bc2
Pedestrian Swatches Fix
Hampo Jun 22, 2020
75b9bba
Bug fixes | RandomLapCount | RandomWaypoints
Hampo Jun 25, 2020
0413405
Update RandomWaypoints.lua
Hampo Jun 27, 2020
afa2744
Bug fixes and RandomUFOs
Hampo Jun 30, 2020
bb27402
Feature Improvements
Hampo Jul 2, 2020
096300f
Waypoint and UFO improvements
Hampo Jul 3, 2020
697f9d7
Early progress on seeding
EnAppelsin Aug 15, 2020
5b60b8c
Fix wraparound of attempts
EnAppelsin Aug 16, 2020
3bd21fd
Only show seed if seeded mode
EnAppelsin Aug 16, 2020
a3eac7d
handle bonus missions and gambling races
EnAppelsin Aug 16, 2020
89833c6
bring .github things over (workflow mainly)
EnAppelsin Aug 16, 2020
137451d
Update build.yml
EnAppelsin Aug 16, 2020
c5d112d
Update build.yml
EnAppelsin Aug 16, 2020
b24cb89
Update build.yml
EnAppelsin Aug 16, 2020
af8140a
Update build.yml
EnAppelsin Aug 16, 2020
491120b
Update build.yml
EnAppelsin Aug 16, 2020
62b3ae6
Some seeding fixes
EnAppelsin Aug 20, 2020
84e47df
Random chase amount seeded
EnAppelsin Aug 20, 2020
892a4d8
RandomTrafficParked
EnAppelsin Aug 20, 2020
3339546
More makechoice flexibility
EnAppelsin Aug 20, 2020
a9c3a28
typo fix
EnAppelsin Aug 20, 2020
fb9ded0
Clearer parameter name
EnAppelsin Aug 21, 2020
914f64e
Magic number elimination service
EnAppelsin Aug 21, 2020
d28a94a
Full random chase seeding
EnAppelsin Aug 21, 2020
bca75b4
Fix random chase and seed random traffic
EnAppelsin Aug 21, 2020
f4350ad
Better debugging if Modules have syntax errors
EnAppelsin Aug 21, 2020
eb2d6b2
Add a warning if chaos mods are enabled
EnAppelsin Aug 21, 2020
5e9de53
Seed random mission vehicles using insane method
EnAppelsin Aug 21, 2020
44bcbaa
Random pedestrians too
EnAppelsin Aug 21, 2020
3b8c1f6
Don't change level results on revisit
EnAppelsin Aug 24, 2020
426475b
Seed random missions
EnAppelsin Aug 24, 2020
db59e24
Quick and dirty fix for cached scripts not working properly
EnAppelsin Aug 27, 2020
2781bbf
New method of seeding by generating ALL missions at the start
EnAppelsin Nov 23, 2020
c1df86d
Note the globals for the code to save them
EnAppelsin Nov 23, 2020
2c854e6
Reorder seeding to do level then its missions (ensures global consite…
EnAppelsin Nov 23, 2020
2230772
Update build.yml
EnAppelsin Nov 23, 2020
eb21c86
Typo in build.yml
EnAppelsin Nov 23, 2020
3b606d8
Fix seeding to work and be deterministic
EnAppelsin Nov 24, 2020
7b8122a
Seeding fixes
EnAppelsin Nov 30, 2020
2d3a5a2
Update HandleLevelLoad.lua
EnAppelsin Nov 30, 2020
adc8792
Update HandleCharModel.lua
Hampo Aug 15, 2023
20b4b50
Merge branch 'main' into seeding
EnAppelsin Apr 15, 2025
3a080af
Fix Meta.ini
EnAppelsin Apr 16, 2025
99875ae
Do a better job at fixing Meta.ini
EnAppelsin Apr 16, 2025
92cf7d5
Move pool checks to after custom framework loading
EnAppelsin Oct 19, 2025
c696b87
Add checkword and debugging
EnAppelsin Oct 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,23 @@ jobs:
with:
path: randomiser

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.7

- uses: actions/cache@v4
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-a
restore-keys: |
${{ runner.os }}-pip-

- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install pygit2

- name: Check mod launcher version
id: mod-launcher-version
run: |
Expand Down Expand Up @@ -49,6 +66,12 @@ jobs:
run: |
Expand-Archive -LiteralPath '.\launcher.zip' -DestinationPath '.\mod-launcher'

- name: Upgrade Meta.ini
run: |
cd randomiser\Randomiser
python meta.py
del meta.py

- name: Compile mod
run: |
& '.\mod-launcher\Lucas Simpsons Hit & Run Mod Launcher.exe' -ignoreloaderrors -mods ".\randomiser" -compile "Randomiser" -outputpath ".\" | Out-String
Expand Down
1 change: 1 addition & 0 deletions Randomiser/CustomFiles.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ art/missions/*_doors.p3d=Resources/HandleLevelDoors.lua
*.rms=Resources/HandleRMS.lua
art/cars/*.p3d=Resources/HandleCarModel.lua
art/frontend/scrooby/frontend.p3d=Resources/HandleFrontend.lua
art/frontend/scrooby/ingame.p3d=Resources/HandleIngame.lua
art/frontend/dynaload/images/license/licensePC.p3d=Resources/RandomLicense.lua
scripts/cars/*.con=Resources/HandleCar.lua
art/l*i*.p3d=Resources/HandleLevelInterior.lua
Expand Down
46 changes: 28 additions & 18 deletions Randomiser/CustomFiles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dofile(Paths.Resources .. "GlobalVariables.lua")
dofile(Paths.Resources .. "GlobalFunctions.lua")
dofile(Paths.Resources .. "lib/P3D.lua")
dofile(Paths.Resources .. "lib/P3DFunctions.lua")
dofile(Paths.Resources .. "lib/Seed.lua")

GetFiles(RandomCharP3DPool, "/GameData/art/chars/", {".p3d"})
local ExcludedChars = {["npd_m"]=true,["ndr_m"]=true,["nps_m"]=true}
Expand Down Expand Up @@ -50,9 +51,9 @@ if Settings.SpeedrunMode then
DebugPrint("Speedrun mode enabled, settings have been overridden")
end

dofile(Paths.Resources .. "MissionScripts/LoadModules.lua")

Cache = {}
if Settings.IsSeeded then
Seed.Init()
end

if Settings.UseDebugSettings then
if not Confirm("You have Use Debug Settings enabled. This allows a secondary mod to force certain randomisations and sometimes run code.\nAre you sure you want this enabled?") then
Expand All @@ -64,20 +65,6 @@ end

DebugPrint("Debug settings enabled: " .. (Settings.UseDebugSettings and "true" or "false"))

if #RandomCarPoolPlayer < 5 and Settings.RandomPlayerVehicles then
Alert("You have chosen less than 5 cars for the random player pool. You must choose at least 5 cars.")
os.exit()
elseif #RandomCarPoolTraffic < 5 and Settings.RandomTraffic then
Alert("You have chosen less than 5 cars for the random traffic pool. You must choose at least 5 cars.")
os.exit()
elseif #RandomCarPoolMission < 5 and Settings.RandomMissionVehicles then
Alert("You have chosen less than 5 cars for the random mission pool. You must choose at least 5 cars.")
os.exit()
elseif #RandomCarPoolChase < 5 and Settings.RandomChase then
Alert("You have chosen less than 5 cars for the random chase pool. You must choose at least 5 cars.")
os.exit()
end

if Settings.VerboseDebug then
local OldOutput = Output
local OldRedirect = Redirect
Expand Down Expand Up @@ -112,9 +99,32 @@ if Settings.RandomDialogue then
dofile(Paths.Resources .. "RandomDialogue.lua")
end

if #RandomCarPoolPlayer < 5 and Settings.RandomPlayerVehicles then
Alert("You have chosen less than 5 cars for the random player pool. You must choose at least 5 cars.")
os.exit()
elseif #RandomCarPoolTraffic < 5 and Settings.RandomTraffic then
Alert("You have chosen less than 5 cars for the random traffic pool. You must choose at least 5 cars.")
os.exit()
elseif #RandomCarPoolMission < 5 and Settings.RandomMissionVehicles then
Alert("You have chosen less than 5 cars for the random mission pool. You must choose at least 5 cars.")
os.exit()
elseif #RandomCarPoolChase < 5 and Settings.RandomChase then
Alert("You have chosen less than 5 cars for the random chase pool. You must choose at least 5 cars.")
os.exit()
end

DebugPrint("Loaded " .. #RandomCarPoolPlayer .. " cars for the random Player pool")
DebugPrint("Loaded " .. #RandomCarPoolTraffic .. " cars for the random Traffic pool")
DebugPrint("Loaded " .. #RandomCarPoolMission .. " cars for the random Mission pool")
DebugPrint("Loaded " .. #RandomCarPoolChase .. " cars for the random Chase pool")
DebugPrint("Using " .. RandomPedPoolN .. " pedestrians")
DebugPrint("Using " .. #RandomCharP3DPool .. " characters")
DebugPrint("Using " .. #RandomCharP3DPool .. " characters")

dofile(Paths.Resources .. "MissionScripts/LoadModules.lua")

-- Seed.NonModuleSeed
if Settings.IsSeeded then
Seed.PrintSpoiler()
end
Cache = {}

167 changes: 110 additions & 57 deletions Randomiser/Meta.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RequiredHack=FileSystemRCFs
OptionalFramework=RandomiserDialogue
OptionalFramework=RandomiserCars
OptionalFramework=RandomiserChars
Version=2.1-git
Version=3.0-git
SettingsHeight=601
SettingsWidth=550
RequiredLauncher=1.24
Expand Down Expand Up @@ -84,6 +84,90 @@ Name=Steve
Credits=1
Group=Testing

[Setting]
Name=SpeedrunMode
Title=Speedrun Mode
Type=TickBox
Default=0
Tooltip=Enables the speedrun settings viable for the leaderboards
Page=General
Group=Rulesets

[Setting]
Name=IsSeeded
Title=Seeded Mode
Type=TickBox
Default=0
Tooltip=Enables seeded mode for predictable randomness
Page=General
Group=Seedng

[Setting]
Name=Seed
Title=Seed
Type=Text
Default=
Tooltip=Seed to use for RNG, technically a base64 encoded 64-bit integer but short words work too. If blank a new seed is generated
Page=General
Group=Seedng

[Setting]
Name=SkipLocks
Title=Remove car/costume requirements
Type=TickBox
Default=0
Tooltip=Remove specific car/costume requirements from certain missions
Page=General
Group=Gameplay

[Setting]
Name=SkipFMVs
Title=Skip cutscenes (except intro cutscene)
Type=TickBox
Default=0
Tooltip=Remove all in-game cutscenes, including the ones at the end of levels. The intro cutscene can be skipped by enabling "No Introduction Movies"
Page=General
Group=Gameplay

[Setting]
Name=BoostHP
Title=Increase HP for weak cars
Type=TickBox
Default=0
Tooltip=Slightly increases HP for weak vehicles like the rocket car
Page=General
Group=Gameplay

[Setting]
Name=DebugLevel
Title=Debug level
Type=Number
Integer=1
Min=0
Max=5
Default=0
Tooltip=Sets the debug level for console printing - 0 will print only the basics whilst 5 will print everything
Page=General
Group=Debugging

[Setting]
Name=VerboseDebug
Title=Verbose debug
Type=TickBox
Default=0
Tooltip=If enabled, outputs all modified files to the console. Not recommended unless bug testing specifically.
Page=General
Group=Debugging

[Setting]
Name=UseDebugSettings
Title=Use debug settings
Type=TickBox
Default=0
Tooltip=If enabled, allows a secondary mod to force certain parts of the randomiser.
Page=General
Group=Debugging

[Setting]
Name=RandomCouch
Title=Random couch character
Expand Down Expand Up @@ -3945,64 +4029,26 @@ Tooltip=Attempts to randomise the UFO locations in levels.
Page=Chaos Randomisations
Testing=1

[Setting]
Name=SkipLocks
Title=Remove car/costume requirements
Type=TickBox
Default=0
Tooltip=Remove specific car/costume requirements from certain missions
Page=Misc

[Setting]
Name=SkipFMVs
Title=Skip cutscenes (except intro cutscene)
Type=TickBox
Default=0
Tooltip=Remove all in-game cutscenes, including the ones at the end of levels. The intro cutscene can be skipped by enabling "No Introduction Movies"
Page=Misc

[Setting]
Name=BoostHP
Title=Increase HP for weak cars
Type=TickBox
Default=0
Tooltip=Slightly increases HP for weak vehicles like the rocket car
Page=Misc

[Setting]
Name=DebugLevel
Title=Debug level
Type=Number
Integer=1
Min=0
Max=5
Default=0
Tooltip=Sets the debug level for console printing - 0 will print only the basics whilst 5 will print everything
Page=Misc

[Setting]
Name=SpeedrunMode
Title=Speedrun Mode
Type=TickBox
Default=0
Tooltip=Enables the speedrun settings viable for the leaderboards
Page=Misc
[SettingCondition]
Type=Setting
Setting=RandomItemsIncludeChars
Value=1
ConditionSetting=RandomItems
Operator=EqualTo

[Setting]
Name=VerboseDebug
Title=Verbose debug
Type=TickBox
Default=0
Tooltip=If enabled, outputs all modified files to the console. Not recommended unless bug testing specifically.
Page=Misc
[SettingCondition]
Type=Setting
Setting=RandomItemsIncludeCars
Value=1
ConditionSetting=RandomItems
Operator=EqualTo

[Setting]
Name=UseDebugSettings
Title=Use debug settings
Type=TickBox
Default=0
Tooltip=If enabled, allows a secondary mod to force certain parts of the randomiser.
Page=Misc
[SettingCondition]
Type=Setting
Setting=RemoveOutOfCar
Value=1
ConditionSetting=RandomPlayerVehicles
Operator=EqualTo

[SettingCondition]
Type=Setting
Expand Down Expand Up @@ -4564,6 +4610,13 @@ Value=1
ConditionSetting=SuperRandomDialogue
Operator=EqualTo

[SettingCondition]
Type=Setting
Setting=Seed
Value=1
ConditionSetting=IsSeeded
Operator=EqualTo

;[SettingWarning]
;Setting=RandomCarSounds
;Operator=EqualTo
Expand Down
2 changes: 1 addition & 1 deletion Randomiser/Resources/CustomCars.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if IsModEnabled("RandomiserCars") then
end
end
else
DebugPrint("No carsound.spt found for Custom Car " .. customCarName .. ".")
DebugPrint("No carsound.spt found for Custom Car " .. customCarName .. ".", 3)
end
end
end
Expand Down
6 changes: 6 additions & 0 deletions Randomiser/Resources/CustomText.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ for k, v in pairs(ChaosSettings) do
end

local Values = os.date("[%Y-%m-%d]") .. "\n" .. ModName .. " v" .. ModVersion .. (Settings.SpeedrunMode and " (speedrun)" or "").. (Settings.UseDebugSettings and " (debug)" or "") .. "\n" .. string.format("Settings: Gameplay: %X, Graphics: %X, Chaos: %X", GameplayN, GraphicalN, ChaosN)
if Settings.IsSeeded then
Values = Values .. string.format("\nSeed: %s, Check: %s", Settings.Seed, Seed.CheckWord())
if ChaosN > 0 then
Alert("Chaos randomisations are not seeded and should be disabled for consistent races")
end
end

local Chunk = P3D.P3DChunk:new{Raw = ReadFile(Path)}
local BibleIdx = Chunk:GetChunkIndex(P3D.Identifiers.Frontend_Text_Bible)
Expand Down
Loading
Loading