Adding a VPK to a search path via code
I am using Source SDK Base 2013 Multiplayer and all I want to do is add a VPK to the "MOD" search path.
The VPK gets added to the search path, but files inside of the VPK do not get detected by the filesystem. Using this same code, if I mount a regular folder instead, the files inside of it are detected by the filesystem just fine, so I don't understand why it isn't working for VPKs.
I know the pending SDK update has a lot of changes to the filesystem, but I hope that mounting a VPK like this isn't something I have to wait for the new update to do.
Does anybody know why I can't access the files inside of the VPK this way?
The VPK gets added to the search path, but files inside of the VPK do not get detected by the filesystem. Using this same code, if I mount a regular folder instead, the files inside of it are detected by the filesystem just fine, so I don't understand why it isn't working for VPKs.
- Code: Select all
char buf[MAX_STRING_LENGTH];
filesystem->GetSearchPath("MOD", true, buf, sizeof(buf) - 1);
DevMsg("Search Paths: %s\n", buf);
KeyValues* pFilesKV = new KeyValues("files");
std::string VPKBasePath = "juju/TesterThing.vpk";
filesystem->AddSearchPath(VarArgs("%s/%s", engine->GetGameDirectory(), VPKBasePath.c_str()), "MOD");
char buf2[MAX_STRING_LENGTH];
filesystem->GetSearchPath("MOD", true, buf2, sizeof(buf2) - 1);
DevMsg("xxxSearch Paths: %s\n", buf2);
I know the pending SDK update has a lot of changes to the filesystem, but I hope that mounting a VPK like this isn't something I have to wait for the new update to do.
Does anybody know why I can't access the files inside of the VPK this way?