Specific PAK file loading Created 2 years ago2021-06-13 09:27:39 UTC by Petko Petko

Created 2 years ago2021-06-13 09:27:39 UTC by Petko Petko

Posted 2 years ago2021-06-13 09:27:39 UTC Post #345697
Hello everyone!

I was wondering if it would be possible to only have 1 PAK
file loaded at a time (for example: vanilla hl models in pak0 and
modified models in pak1, and the correct pak file gets loaded based on the map)

The only thing is, that the correct assets need to be loaded/map (so pak1 shouldnt override pak0 on some maps)

I am aware that pak file reading is mostly in the engine, so I wont be able to modify
that, but maybe iirc the engine only checks for .pak files with the name pak0,1,2,3, etc

So could it be possible to use code found here to read custom named pak files?
And have it load the correct pakfile on a specific map?

So could this be possible?

Thanks for reading! :biggrin:
Posted 2 years ago2021-06-14 09:25:53 UTC Post #345701
You can add custom pak files using the IFileSystem interface: https://developer.valvesoftware.com/wiki/IFileSystemV009

However i wouldn't recommend doing this because pak files can't be removed (RemoveSearchPath crashes the game).

The engine can also reset the filesystem at any time if the player changes certain settings which could cause your pak file to be unloaded.
Posted 2 years ago2021-06-14 18:51:59 UTC Post #345702
Try looking at Xash
Posted 2 years ago2021-12-20 22:59:03 UTC Post #346143
Yeah this probably isn't really doable - you could load both sets of models with different names and do conditional rendering in client.dll based on the map name but that's probably about it.
You must be logged in to post a response.