Skip to content

EnAppelsin/SHARCarRandomiser

master
Switch branches/tags
Code

Latest commit

* New Meta.ini

* Break down HandleMission

Breaks down HandleMission into separate scripts - Start of the modular system
-Also changed regex to fix some issues

* Updated CustomFiles.ini

Updated to redirect to the new mission scripts.

* Fixed CustomFiles.ini

Noticed I was dumb and missed bonus missions and races

* Initial Modular

The start of the modular system. Only for Level files at the moment.

* Updated Modular System

• Added Sunday Drives to modular system
• Improved existing modular system file structure

* Fully modular

All MFK-related randomisation is now modular.
TODO:
• Improve efficiency now that the load and init files are processed in the same code (see lines 79 and 80 in RandomItems.lua)
• Handle multiple instances of the same object now that we handle both in the same code (IE 10 bonestorm drops, 4 cellout cars)

* Modular improvements

• Updated GlobalArrays to have less global tables in there - moved to relevant modular file.
• Added 2 new global functions. One to count KV tables, the other to clone KV tables.
• Updated RandomMissionItems to randomise multiple instances of the same drop. Probably not the final version, but a good proof of concept.
• Fixed a bug with RandomMissionCharacters - Type of "RandomMissionsCharacters" made it stop working

* Modular Updates

• Changed Random Mission Vehicles to be based on the Init file - Improves randomisation, as well as randomising races
• Fixed a bug that arose with Random Player Vehicles because of this
• Fixed a bug that arose in HandleCar because of this
• Fixed a bug in HandleMissionLoad that didn't assign the mission variable if it was a race
• Added a new setting to remove the forced car limits
• Edited CustomText to use the new settings table - and to add the new setting
• Removed old (and now unneeded) method of random cellouts
• Removed old setting for random cellouts

* Bug fixes

• Added warning on RandomCarSounds until fixed
• Fixed a bug with RandomChase and RandomMissionVehicles
• Added basic file outputting - temporary until Appel's version

* Modular update

- Updated RandomItems to randomise more things
- Updated RandomItems and added setting to include characters in random item pool
- Fixed bug in logging files to console

* I missed a comma

I'm dumb

* Bug fix

Fixes an issue where missions/races with the same identifier were being detected as the same mission for remembering random cars
Added a handler just in case a similar issue happens again

* Bug fixes - Module sort order - Cars in Random Items

- Fixed a bug when saving randomised mission cars
- Added a handler in case of failure on random mission cars so it defaults to original instead of crashing
- Fixed a bug on a print trying to concatenate a boolean
- Added module sorting, to make sure modules load in required order
- Added the ability to include cars in random items

* Update RandomItems.lua

- Fixed a debug testing line
- Added traffic cars

* Bug Fixes - Start Of New Feature - Settings Migration

- Increase sound limits - could fix random crash with car sounds
- Migrated all Settings checks from old static values to Settings table
- Added the start of Random Static Cars - Ability to randomise phone booths and bonus cars
- Fixed gags in interiors - Doesn't fix interior doorbells
- Fixed a bug with finish_line and race objectives

* Update CustomFiles.lua

Fixed CustomFiles to use new Settings

* Features and Bug Fixes

- Added Verbose Debug - logs _all_ changed files to console using base64 - used for specific debugging
- Doubled Sound limits again because I got the crash again
- Completed Random Static Cars feature

* Bug fixes

- Added option to save static car choice per level
- Added botched fix for RandomStaticCar crash - TODO: Ask Appel to have a look
- Added ability to force randomisations with secondary mod

* DebugSettings and RandomStaticCar improvements

- Changed Debug Settings to use a setting to enable/disable
- Added ability to execute code in CustomFiles.lua with Debug Settings
- Improved ReplaceCar function - Thanks Appel
- Moved base64 to GlobalFunctions

* Bug fixes

- Fixed a bug in Custom Limits for sound
- Added randomising the item above races/bonus mission
- Added the start of randomising races/bonus missions
- Re-added printing files to log in DebugLevel 5

* Bug Fixes and Features

- Massively increased sound clip limits due to continued crashing
- Set the mod to SupportsInternaional=0 because different languages currently break it
- Set CustomCars to default to 0 because errors if the external framework is not configured
- Added option to randomise bonus missions
- Added warning to Random Bonus Missions stating that users may need to restart the bonus mission to load the level
- Commented Random Car Sounds warning
- Removed old comment for Random Chase Amount warning
- Fixed a bug with Random Static Cars and Custom Cars
- Removed old comments from Random Missions

* Bug Fixes

- Fixed an issue where GetFiles would add a double slash
- Fixed a duplicated end statement in HandleCarModel

* Give AI massive tire grip

* Fix Random Car Scale

* Additions and bug fixes

- Added RandomLevelMissions - CURRENTLY BROKEN
- Fixed AI tire grip
- Fixed Mission Modules to use local tables

* Fixed RandomLevelMissions

Fixed :D

* Bug fixes

- Changed our old ModVersion code to the new official method
- Renamed HandleLevelModel to HandelLevelInterior to better represent what it does
- Fixed RandomInteriors to work with RandomLevelMissions

* Update RandomLevelMissions.lua

- Fixed an issue where restarting the mission would swap back to the original level.

* Decompress compressed P3D files

* Random text support

* Update P3D.lua

* Add mistakenly deleted P3D functions

* Minor adjustments

- Removed warning about random interiors - feature stable
- Changed method for L4CustomT to create file from scratch

* SpeedrunMode

- Added the start of SpeedrunMode to Gibstack's requirements

* Fix Speedrun Mode

* Update Meta.ini

* Update chair.con

* Dev build defaults to high debugging output

* Add warnings for static car modification due to p3d issues

* Fix speedrun mode settings

* Fixed Speedrun Mode

- Fixed a bug where settings were forced after loading the modules.

* Update HandleCar for mission vehicles properly

* CustomChars

- Added custom chars
- Made the mod auto-populate the RandomCharP3DPool
- Improved GetFiles function slightly
- Updated everything that used RandomCharP3DPool to use the new table format
- Implemented Lucas' P3D function improvements
- Updated ReplaceCharacterSkinSkel to use slightly faster method, but more importantly support everything a custom character can use (I hope)
- Replaced BrightenModel with a more complete function from my DynamicLighting mod
- Added RandomiserChars framework
- Added h_burn_m as example P3D. Credit to Loren for the model
- Added a basic README - TODO: Write full help document similar to RandomiserDialog and RandomiserCars

* Custom Chars Bug Fixes

- Fixed an issue where I forgot to clear the old RandomCharP3DPool
- Fixed an issue with HandleCharModel where in a scenario that there was a CustomChar with the same name as a Player/Mission character, the CustomChar would be loaded with no randomisation
- Fixed an issue with CustomChars and Mission Drivers

* Bug Fixes - Start of P3DChunk Class

- Make RandomCouch handle holiday menu characters like christmas.
- Aded Testing to RandomLevelMissions setting due to consistent crash
- Added the start of P3DChunk Class

* Update P3DChunk.lua

Fixed typoes in P3DChunk

* P3D Class System Improvements

- Improved some of the core P3D functions to use string.pack and string.unpack
- Improved the class system
- Updated BrightenModel to use class system
- Added SetModelRGB

* Update P3D.lua

Forgot to remove old function

* Update P3DChunk.lua

- Fixed typo in ShaderP3DChunk:SetColourParameter
- Made WorldSphere, Mesh, LensFlare and OldBillboardQuadGroup chunks auto calculate their child count values

* Update P3DChunk.lua

Made GetChunkIndexes loop in reverse so deletions don't break things

* P3D stuff

Added MakeModelInvisible and new chunks

* P3D

- Added MakeCharacterInvisible
- Added Composite Drawable chunk

* Update P3DChunk.lua

Changing to use the function

* ColourList Improvements

- Improved usability if ColourListP3DChunk

* P3D

- Fixed AddChunk function
- Fixed StaticPhysP3DChunk
- Added StaticEntityP3DChunk
- Added MakeModelSolid function

* Migration to P3D Lib

Most of the changes to P3D Lib

* Frontend automation

Added code to dynamically modify the frontend to reduce file size by 4MB

* P3D improvements

- Made Make and Clean P3D String return nil if input is nil
- Made MultiController Track Count be accurate
- Made RandomCouch correctly close character's eyes

* Update to RandomDialogue

1.24 update to take advantage of FileSystemRCFs and ReadFileOffset

* RandomDialogue improvements

Set Random Dialogue enabled by default
Slightly optimised reading the header of RCF files
Commented the sanity check of RSD files. All known files processed contain valid RSD files so probably not necessary or worth the slowdown.

* Bug fixes

- Changed required launcher to 1.24 to take full advantage of FileSystemRCFs
- Fixed milhouse lines not being randomised
- Fixed an issue with international support not loading the right SPT file
- Removed SPT files from Resources due to FileSystemRCFs

* Update README.md

* v2.1 final (hopefully)

- Improved CustomFiles.ini matches for dialogue
- Added Super Random Dialogue
  - Added Settings and updated README/Custom Text
- Changed RandomCase easter egg

* v2.1 actually final (hopefully)

- Added a setting to include RandomiserFramework in random dialogue
- Fixed a bug with car animations in RandomStaticCar
- Updated README

* Update README.md

Fixing some punctuation

* Pedestrian Swatches Fix

- Added extra Debug Settings for characters
- Fixed Pedestrian Swatches being randomised and breaking looks on some peds

* Bug fixes | RandomLapCount | RandomWaypoints

- Fixed SettingsHeight
- Fixed some colour issues on chars such as Dr Nick when they're used as pedestrians
- Fixed a potential Lua crash if user puts Max < Min with block length
- Added RandomLapCount
- Added IsRace parameter to mission functions
- Added GetRoads function to P3DFunctions
- Added Testing setting RandomWaypoints

* Update RandomWaypoints.lua

- Fixed a potential bug with too greedy of a pattern
- Fixed a bug where you could run out of time

* Bug fixes and RandomUFOs

- Fixed a dumb bug regarding fixing char swatches on peds
- Fixed a bug in RandomWaypoints where bombbarrel was missed in L7 and destinations were not marked on map.
- Added RandomUFOs to randomise the UFO location. Currently also locked behind -testing

* Feature Improvements

- Removed redundant P3D CustomFile - added modification to Lua
- Improved GetRoads code shared by RandomWaypoints and RandomUFOs
- Fixed Random Lap Count not setting time on Time Trials
- Added Max values to Min and Max Lap Counts
- Added Random UFOs to other levels
- Fixed a bug with Random UFOs using the Mission table

* Waypoint and UFO improvements

- Added additional tester credits
- Renamed `RandomWaypoints` and `RandomUFOs` to the more apt `HandleMissionP3D` and `HandleLevelP3D`
- Made RandomWaypoints randomise sunday drive locators

* bring .github things over (workflow mainly)

* Update build.yml

Co-authored-by: Proddy <tehmcterrorist@gmail.com>
3841a1e

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

Simpsons Hit & Run Randomiser

The Randomiser

This mod allows for randomising vehicles, characters and more throughout the game.
Each randomisation has its own option, detailed below.

Installation

Download the mod from the releases page.
Don't download the repository by clicking Clone or download.

Copy the mod file (.lmlm) to your Mods folder (usually Documents\My Games\Lucas' Simpsons Hit & Run Mod Launcher\Mods).
Run the Mod Launcher and change the settings to match your needs, then play the game.
All possible randomisations are available in separate settings.

Discord

Questions about the mod or development can be asked on our Discord Server.

Settings

Randomisations

Random couch character

On by default.
If this is checked, you will get a random character sitting on the couch in the main menu.

Random music

On by default.
If this is checked, the music played will be randomised to any track in the game.
If enabled with random music cues, both cues and music will be randomised.

Random music cues

Off by default.
If this is checked, the cues that trigger different music tracks are randomised.
If enabled with random music, both cues and music will be randomised.

Random dialogue

On by default.
If this is checked, all in game dialogue will be randomised.
As of v2.1 the extra setup isn't required, but is still supported. More info in this documentation.

Super random dialogue

Off by default.
If this is checked, all in game dialogue will be dynamically generated by mashing up random lines.
Options to configure this are on the Variables page.

Random player character

Off by default.
If this is checked, you will get a random player character every time you load a level, from any character model in the game.

Random mission characters

Off by default.
If this is checked, mission specific characters will be randomised every time you load a mission.
Note: This excludes ambient characters (such as Apu in the Kwik-E Mart). These are randomised through Random pedestrians.

Enable custom chars

Off by default.
If this is checked, it will attempt to load custom characters from the RandomiserChars framework.
Adding custom chars requires extra work, detailed in this documentation.

Random player vehicles

On by default.
If this is checked, you will get a random vehicle per level/mission.

Remove Out Of Car Conditions

Off by default.
If this is checked, out of car fail conditions will be removed from the game.

Same car if restarting/failing mission

On by default.
If this is checked and you restart the mission (or retry after failing) you will get the same car again.
You can change the car by cancelling the mission first and starting it again.
If this is disabled you'll get a random car each time you restart.

Random car scale

Off by default.
If this is checked, the model scale for any character in a car will be randomised.

Random car sounds

Off by default.
If this is checked, car sounds (horns, engine, etc) will be randomised.
If the car has an overlay (phone ringing, ice cream, etc) these are randomised too.

Enable custom cars

Off by default.
If this is checked, it will attempt to load custom cars from the RandomiserCars framework.
Adding additional cars requires extra work, detailed in this documentation.

Random pedestrians

On by default.
If this is checked, pedestrians, drivers and ambient characters will be randomised per level load.
You will get the same pedestrians for each mission of a level.

Random traffic

On by default.
If this is checked, traffic cars will be randomised per level load.
You will get the same traffic cars for each mission of a level.

Random chase car

On by default.
If this is checked, chase cars will be randomised per level load.
You will get the same chase cars for each mission of a level.

Random chase car amount

Off by default.
If this is checked, the number of chase cars will be randomised per level load.
You will get the same number for each mission of a level.

Random chase car - stats

On by default.
If this is checked, random chase cars will have the stats of the chosen car.
Otherwise, random chase cars will have the stats of the level's default chase cars.

Random mission vehicles

On by default.
If this is checked, most mission vehicles will be randomised (including races).
You will get the same traffic cars for each mission of a level.

Random mission vehicles - stats

On by default.
If this is checked, random mission vehicles will have the stats of the chosen vehicle.
Otherwise, random mission vehicles will have the stats of the level's default vehicles.

Same mission vehicle if restarting/failing mission

On by default.
If this is checked and you restart the mission (or retry after failing) you will get the same mission vehicles again.
You can change the vehicles by cancelling the mission first and starting it again.
If this is disabled you'll get random mission vehicles each time you restart.

Random static cars

Off by default.
If this is checked, static cars such as phone booth cars and bonus cars will be randomised.

Same static cars for level load

Off by default.
If this is checked, static cars will be randomised to the same car throughout the level.

Random stats

Off by default.
If this is checked, all randomised vehicles will have random stats. To customise, use the Variables page.

Variables

Include RandomiserDialogue Framework

Off by default.
If enabled, loads the legacy framework dialogue into the random dialogue pool.

Include English Dialogue

On by default.
If enabled, attempts to load the English dialogue lines into the random dialogue pool.
Note: This requires dialog.rcf in your game's install directory.

Include French Dialogue

On by default.
If enabled, attempts to load the French dialogue lines into the random dialogue pool.
Note: This requires dialogf.rcf in your game's install directory.

Include German Dialogue

On by default.
If enabled, attempts to load the German dialogue lines into the random dialogue pool.
Note: This requires dialogg.rcf in your game's install directory.

Include Spanish Dialogue

On by default.
If enabled, attempts to load the Spanish dialogue lines into the random dialogue pool.
Note: This requires dialogs.rcf in your game's install directory.

Minimum/Maximum dialogue length

Sets the rough minimum and maximum length that a super random dialogue line can be in seconds.
Note: These are rough limits, not hard limits.

Minimum/Maximum block length

Sets the number of blocks per segment in a super random dialogue line. Each block averages 1.2ms.

Min/Max Scale

These two options define the lower and upper bounds for the random vehicle scale option.

Vehicle Mass

The mass of the vehicle can effect how it interacts with the ground, the lower the mass value of the vehicle is; the less friction will act upon it making the world an ice rink.
Notice: It is believed that mass affects the toughness of a vehicle.

Gas Scale

The Gas scale is the acceleration of the vehicle if you were to just hold the acceleration button.

Slip Gas Scale

The Slip Gas Scale is the acceleration of a vehicle while it is sliding from speed or through the e-break.

Break Gas Scale

The Break Gas Scale is the breaking speed of a vehicle when it is not sliding or e-breaking.

Vehicle Speed

Provides a value for the top speed of the vehicle.

Wheel Turn Angle

The turn angle of the wheel effects how the vehicle steers, too high of a value being used can cause uncontrollability with a vehicle.

Wheel Grip

The wheel grip controls how the car will drift when it is driving - primarily on acceleration and steering - the higher the grip the more likely the car is to drift.

Steering

This controls the steering of the vehicle.

Slip Steering

This controls the steering of the vehicle while in a drift.

HP

This controls the amount of health that a vehicle has - The Armoured truck in 5-6 has 15 HP.

Car Pools

Random Car Pool - Player

This controls which vehicles are in the random pool for the player's random vehicles.

Random Car Pool - Mission

This controls which vehicles are in the random pool for the mission random vehicles.

Random Car Pool - Traffic

This controls which vehicles are in the random pool for the traffic random vehicles.

Random Car Pool - Chase

This controls which vehicles are in the random pool for the chase car random vehicles.

Chaos Randomisations

The randomisations in this tab involve substantial changes in gameplay, and can completely affect strategies used in speedruns. In additon they are currently a work in progress and may cause crashes or the game to become unbeatable!

Random interiors

Off by default.
Randomise which interior you enter when entering a building.

Random directives

Off by default.
All mission directive texts are changed to a completely random directive text.

Random missions

Off by default.
The order in which the missions in the level are played is randomised.

Random bonus missions

Off by default.
The order of the bonus mission and street races in the level are randomised.
Can cause region loading issues. If this happens, restart the mission/race.

Random items

Off by default.
The type of item dropped by vehicles in mission is randomised.

Random items - include characters

Off by default.
Random item drops will include character drawables.

Random items - include cars

Off by default.
Random item drops will include car drawables.

Random text

Off by default.
If this is checked, all text entries in the text bible will be randomly pointed to another entry.

Misc

Remove car/costume requirements

Off by default.
If this is checked, you won't need to be wearing a specific costume/be driving a specific car to start a mission.
Removes the need for a coin route.

Skip cutscenes (except intro cutscene)

Off by default.
If this is checked, all cutscenes bar the introduction cutscene won't be played.

Increase HP for weak cars

Off by default.
If this is checked weak cars like the rocket car will have their HP slightly boosted so they're not quite as fragile.
It raises the minimum HP to 0.8 for all cars.

Debug level

0 by default.
This controls the verbosity of the console output. 0 will print basic information whereas 5 will print pretty much everything.

Speedrun Mode

Off by default.
If this is checked, certain settings will be forced to the values required for the speedrunning leaderboard.

Verbose debug

Off by default.
If this is checked, debug logs will be verbose. Please use this if you want to assist with bug detecting.

Potential Limitations/Issues

  • Missions will spawn you where you start if you restart the mission once, this is because adding a forced car teleports you.

  • The list of cars to chose from is built into the script and so if you use mods which add extra cars they won't be chosen, and if a mod removes cars the game will crash if the randomiser picks it.

  • Your car will vanish at the end of the mission, even if you are in it. Again this is because of how forced cars work.

  • There is a spot where random characters will be sat in mid air. This is due to how passengers/drivers work.

Acknowledgements

Mod authors are EnAppelsin, Proddy, Sparrow and Gadie

Thanks to the following people for helping with the development and testing of this mod:

Gibstack, Kuinn, Jake, LiquidWiFi, Loren, Nytheris, Pepperdork