Skip to content

Commit

Permalink
Support custom limits to possibly fix chase car amount crash
Browse files Browse the repository at this point in the history
  • Loading branch information
EnAppelsin committed Mar 9, 2019
1 parent 3eeeefb commit 3aa1467
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 7 deletions.
49 changes: 49 additions & 0 deletions Randomiser/CustomLimits.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
; CustomLimits.ini
; Define custom limits to change what the game is capable of handling.

; [Miscellaneous] Section
; DeletedEntityLimit: Change the amount of entities that can be deleted at one time. Defaults to 5000.
; PathLimit: Change the maximum amount of pedstrian paths that can exist. Defaults to 125.
; CarLimit: Change the maximum amount of cars. Defaults to 30 and can only be set up to 127.
; ActionButtonLimit: Change the maximum amount of action buttons. Must be divisible by 8.

; [Roads] Section
; CubeShapeLimit: The maximum amount of Cube Shapes that can exist. Defaults to 1200.
; RoadLimit: The maximum amount of Roads that can exist. Defaults to 150.
; IntersectionLimit: The maximum amount of Intersections that can exist. Defaults to 60.
; RoadSegmentLimit: The maximum amount of Road Segments that can exist. Defaults to 1200.

; [Regions] Section
; Limit: The maximum amount of Regions that can be loaded at once (including the Terra file). Defaults to 7.
; EntityLimit: The maximum amount of entities any one zone can contain. Defaults to 2000.
; RoadSegmentLimit: The maximum amount of Road Segments any one zone can contain. Defaults to 1250.
; Given that Road Segments should only ever be in the Terra file, this should just match the other RoadSegmentLimit in the [Roads] section.

; [TreeNodes] Section
; DrawDistance: The maximum distance any part of an object can be from the camera before it stops rendering. Defaults to 200.
; BoundsMinimumY: The minimum position on the Y axis in any tree node. Defaults to -200. Leave blank to use the value in the k-d Tree.
; BoundsMaximumY: The maximum position on the Y axis in any tree node. Defaults to 100. Leave blank to use the value in the k-d Tree.

; [Billboards] Section
; QuadGroupLimit: The maximum amount of billboard quad groups that can exist. Defaults to 25.
; QuadLimit: The maximum amount of billboard quads that can exist. Defaults to 100.

; [CollisionIndices] Section
; VehicleLimit: The maximum amount of vehicle collision indices. Defaults to 15.
; CharacterLimit: The maximum amount of character collision indices. Defaults to 18.
; StaticPhysLimit: The maximum amount of static phys collision indices. Defaults to 30.
; AnimCollLimit: The maximum amount of anim coll collision indices. Defaults to 20.
; FenceLimit: The maximum amount of fence collision indices. Defaults to 8.
; DynaPhysLimit: The maximum amount of dyna phys collision indices. Defaults to 20.

; [Sound] Section
; PlayingClipPlayerLimit: The maximum amount of simultaneously playing clip players. Defaults to 25.
; PlayingStreamPlayerLimit: The maximum amount of simultaneously playing stream players. Defaults to 8.

; Notes
; When building custom maps, the Model Builder totals up many of these limits for you.
; You should just make sure these limits are at least greater than the totals of any of your mod's custom maps.
; If your mod still uses Radical's maps, then also keep these limits to at least what they are by default.

[CollisionIndices]
VehicleLimit=30
13 changes: 7 additions & 6 deletions Randomiser/Meta.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ Main=1
Description=This mod allows for randomising various things throughout the game.
RequiredHack=CustomFiles
RequiredHack=CustomLicenseScreenTime
RequiredHack=CustomLimits
OptionalFramework=RandomiserDialogue
OptionalFramework=RandomiserCars
Version=2.0-b8-git
SettingsHeight=509
SettingsWidth=550
RequiredLauncher=1.19
RequiredLauncher=1.22

[Author]
Name=En Appelsin
Expand Down Expand Up @@ -3943,11 +3944,11 @@ Operator=EqualTo
Value=1
Message=Random dialogue requires some extra setup. If this isn't done, this will do nothing.
[SettingWarning]
Setting=RandomChaseAmount
Operator=EqualTo
Value=1
Message=Random chase car amount may spawn too many vehicles and cause the game to crash. Use at your own risk.
;[SettingWarning]
;Setting=RandomChaseAmount
;Operator=EqualTo
;Value=1
;Message=Random chase car amount may spawn too many vehicles and cause the game to crash. Use at your own risk.
[SettingWarning]
Setting=RandomInteriors
Expand Down
4 changes: 3 additions & 1 deletion Randomiser/Resources/HandleMission.lua
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,9 @@ elseif LevelInit ~= nil then
NewFile = NewFile:gsub("CreateChaseManager%s*%(%s*\".-\"", "CreateChaseManager(\"" .. RandomChase .."\"", 1)
end
if SettingRandomChaseAmount then
NewFile = NewFile:gsub("SetNumChaseCars%s*%(%s*\".-\"", "SetNumChaseCars(\"" .. math.random(1, 4) .."\"", 1)
local chaseAmount = math.random(1, 5)
NewFile = NewFile:gsub("SetNumChaseCars%s*%(%s*\".-\"", "SetNumChaseCars(\"" .. chaseAmount .."\"", 1)
DebugPrint("Random chase amount -> " .. chaseAmount)
end
end
Output(NewFile)
Expand Down

0 comments on commit 3aa1467

Please sign in to comment.