-
Notifications
You must be signed in to change notification settings - Fork 4
Rewrite mod to use custom bundles instead of json saves #25
base: master
Are you sure you want to change the base?
Conversation
Removed http as new lua tables now only contain the guids of the modified vanilla objects' ReferenceObjectDatas, making the file small. Those vanilla objects are cloned and included in the custom bundle.
| ---@field CLIENT_TIMEOUT number | ||
| Config = require "__shared/Config" | ||
|
|
||
| BUNDLE_PREFIX = 'CustomLevels' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add this to the config. And you can make the config local now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldnt be configurable, its just a static variable
| Hooks:Install('ResourceManager:LoadBundles', 100, function(p_Hook, p_Bundles, p_Compartment) | ||
| print(p_Compartment) | ||
| print(p_Bundles[1]) | ||
| end) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be removed. Was just for debug prints.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but left it for the same purpose. The print is disabled so its fine,
| s_SWROD.streamRealm = StreamRealm.StreamRealm_Both | ||
| s_SWROD.castSunShadowEnable = true | ||
| s_SWROD.excluded = false | ||
| s_SWROD.inclusionSettings = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an inclusionsetting that will check for the current gamemode.
Todo: think about -skipChecksum. Modifiying this in one gamemode, then switch to another gamemode. Player joins and won’t have the changes of the first gamemode. So maybe use the existing one and just modify it again instead of creating a new swrod.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I follow, what is InclussionSettings for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To only load the custom bundle if the gamemode gets loaded. So you can have different custom bundles for different gamemodes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And you define the gamemode in the inclusionsetting
ext/Shared/__init__.lua
Outdated
|
|
||
| local s_SWROD = SubWorldReferenceObjectData(Guid('6a724d44-4efd-4f7e-9249-2230121d7ecc')) | ||
|
|
||
| s_SWROD.bundleName = BUNDLE_PREFIX .. '/' .. p_LevelName:gsub(".*/", "") .. '/' .. SharedUtils:GetCurrentGameMode() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice if this could be a config.
Like: BundleName = string.format("%s/%s/%s", BUNDLE_PREFIX, LEVELNAME, GAMEMODE)
So I would still be able to build the bundlename but change the order for example. Or just use the levelname and not the gamemode name.
Same for the superbundle name.
Removed http too, as new lua tables now only contain the guids of the modified vanilla objects' ReferenceObjectDatas, making the file small. Those vanilla objects are cloned and included in the custom bundle.