Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Wizard — Yesterday at 11:22 PM
- Could you confirm this is correct behavior when you get a chance?
- I could ask around if you aren’t sure
- ```
- search_order = [
- SearchLocation.OVERRIDE,
- SearchLocation.CUSTOM_MODULES,
- SearchLocation.CUSTOM_FOLDERS,
- ]
- if gff_patch.replace_file:
- search_order = [
- SearchLocation.CUSTOM_FOLDERS,
- SearchLocation.OVERRIDE,
- SearchLocation.CUSTOM_MODULES,
- ]
- search = installation.resource(
- resname,
- restype,
- search_order,
- folders=[self.mod_path],
- capsules=[] if capsule is None else [capsule],
- )
- ```
- Cortisol — Today at 12:03 AM
- Looks about right
- Wizard — Today at 12:04 AM
- if gff_patch.replace_file:
- search_order = [
- SearchLocation.CUSTOM_FOLDERS,
- SearchLocation.OVERRIDE,
- SearchLocation.CUSTOM_MODULES,
- ]
- I wasn't sure if this should be Modules first then override
- Cortisol — Today at 12:05 AM
- Custom folder = tslpatchdata
- Wizard — Today at 12:05 AM
- right
- Cortisol — Today at 12:05 AM
- Custom module = the .mod in kotor/modules
- Override=self explanatory
- Wizard — Today at 12:05 AM
- if replace file, tslpatchdata first, then override, then modules. But wasn't sure if modules should be before override or not
- that's what i was asking my mistake
- Cortisol — Today at 12:06 AM
- Ah I see
- Do modules then override
- Wizard — Today at 12:06 AM
- what's your reasoning there?
- if replace_file == False, the order you established was Override --> Modules --> Custom folder
- (that was your fix on saturday)
- Cortisol — Today at 12:08 AM
- Yeah change it to modules override folder
- Wizard — Today at 12:08 AM
- Alright. Why though?
- Cortisol — Today at 12:08 AM
- Hmm hard to explain
- But if it's targeting a module
- [Some.utc]
- Target=modules/abc.mod
- And some.utc is in the override
- Wizard — Today at 12:09 AM
- So you think if !ReplaceFile is used, the order should essentially be reversed lol?
- Cortisol — Today at 12:09 AM
- It's going to take the wrong file
- Where as
- Wizard — Today at 12:09 AM
- search_order = [
- SearchLocation.CUSTOM_MODULES,
- SearchLocation.OVERRIDE,
- SearchLocation.CUSTOM_FOLDERS,
- ]
- if gff_patch.replace_file:
- search_order = [
- SearchLocation.CUSTOM_FOLDERS,
- SearchLocation.OVERRIDE,
- SearchLocation.CUSTOM_MODULES,
- ]
- search = installation.resource(
- resname,
- restype,
- search_order,
- folders=[self.mod_path],
- capsules=[] if capsule is None else [capsule],
- )
- Cortisol — Today at 12:10 AM
- [Some.utc]
- Target=override
- If Custom modules is first
- There is no Custom module
- And it skips to override
- Wizard — Today at 12:11 AM
- In that block I just posted, instead of hardcoding the priority order for override and modules, should we instead just parse the !Destination key-value pair to determine where to load the resource from first?
- Because it seems that it's dependent on the !Destination key
- From your explanation
- Wizard — Today at 12:12 AM
- I need to reread this a few times to make sure i understand
- Nah I'm still pretty confused
- Cortisol — Today at 12:16 AM
- If replace: folder, modules, override
- Else: modules, override, folder
- Wizard — Today at 12:16 AM
- Alright so breaking it down:
- !Destination=modules/somemodule.mod
- !ReplaceFile=0
- Priority should be modules --> override --> tslpatchdata
- In your solution, it would be [modules, override, tslpatchdata]
- !Destination=override
- !ReplaceFile=0
- Priority should be override --> modules --> tslpatchdata
- In your solution, it would be [modules, override, tslpatchdata]
- I'm beyond confused
- Cortisol — Today at 12:18 AM
- If !Destination is override it doesn't matter if custom modules precedes custom folders
- Because the custom modules array you pass through is empty
- Wizard — Today at 12:18 AM
- How do you know the modules is empty though?
- It could very well have a resource in there
- Cortisol — Today at 12:18 AM
- No
- Look at the code. I think the list is named capsules
- That list is what CUSTOM_MODULES searches through
- If gff.destination does not end with mod that list is empty
- Or something along those lines. Don't have the code in front of me
- Wizard — Today at 12:20 AM
- search = installation.resource(
- resname,
- restype,
- search_order,
- folders=[self.mod_path],
- capsules=[] if capsule is None else [capsule],
- )
- according to your docs
- The default search order is (descending priority): 1. Folders in the folders parameter, 2. Override folders,
- 3. Capsules in the capsules parameter, 4. Game modules, 5. Chitin.
- Hmm I think we're overthinking. If !ReplaceFile=1, the assumption is that tslpatchdata 100% has the definition for the resource no?
- So the correct code should be:
- search_order = [
- SearchLocation.OVERRIDE,
- SearchLocation.CUSTOM_MODULES,
- SearchLocation.CUSTOM_FOLDERS,
- ]
- if gff_patch.replace_file:
- search_order = [
- SearchLocation.CUSTOM_FOLDERS,
- # remove CUSTOM_MODULES and CUSTOM_FOLDERS
- ]
- Wizard — Today at 12:28 AM
- Wait my apologies. Are you saying CUSTOM_MODULES refers to .mod files within tslpatchdata?
- Ahhhh everything you've said makes sense if that's the case.
- It seems I'm just slow sometimes
- I was thinking CUSTOM_MODULES refers to custom modules in the Modules folder of the installation, since .mod files are not provided with a vanilla installation
- Wait, no.......
- CUSTOM_MODULES = 12
- """Encapsulated resources stored in the capsules specified in method parameters."""
- In order for that to make sense, we'd need to also change the definition of capsule as right now it's pointing to the Modules folder within the installation
- Cortisol — Today at 12:34 AM
- As it should...
- Wizard — Today at 12:35 AM
- But if I'm understanding, the order should be:
- if !ReplaceFile=0
- Then order should be Override, Modules, tslpatchdata
- if !ReplaceFile=1
- Then order should be tslpatchdata raw files, tslpatchdata .mod/.erf's, error
- Cortisol — Today at 12:35 AM
- That's why custom modules and override are paired together and are always in that order
- Wizard — Today at 12:35 AM
- Currently capsule is defined as the location of self.game_path / gff_patch.destination which could be the override or modules folder of the game installation
- Cortisol — Today at 12:36 AM
- Well technically replace file=true should be exclusively CUSTOM FOLDER then
- Since custom module and override are game files
- Wizard — Today at 12:37 AM
- Yeah that's what I'm getting at. But if CUSTOM_FOLDER is the only definition, will it know how to search .mod files within tslpatchdata?
- Cortisol — Today at 12:37 AM
- Idk
- Wizard — Today at 12:37 AM
- And if so, should the priority order be tslpatchdata .erf/.mod and THEN raw files within tslpatchdata?
- Cortisol — Today at 12:37 AM
- Can tslpatcher take files out of mod files in tslpatchdata
- I thought it only copies mod files, not resources inside
- Wizard — Today at 12:38 AM
- ahh i'm guessing it doesn't search .mod files within tslpatchdata, but i'll ask in some modding discords and deadlystream to be certain
- may i copy this conversation as a reference?
- Cortisol — Today at 12:39 AM
- Go for it
- DP is probably a good person to ask
- Wizard — Today at 12:39 AM
- I guess I need to figure out what installation.resource()'s priority order is when only CUSTOM_FOLDERS is defined. Does it first search .erf/.mod within that folder and then raw files or is it the other way around: that's the question to answer here.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement