chlin Posted July 8, 2010 Report Share Posted July 8, 2010 (edited) Whilst exploring the source, I notice that the engine will LoadDefaultScripts() in simulation2/Simulation2.cpp. After checking a while, it looks like the context root is set to `binaries/data/mods/public/simulation' when loading scripts. However, when checking the source, the code shows that it loads directly from `simulation/...'bool CSimulation2::LoadDefaultScripts(){ return ( m->LoadScripts(L"simulation/components/interfaces/") && m->LoadScripts(L"simulation/helpers/") && m->LoadScripts(L"simulation/components/") );}Where to specify the path `binaries/data/mods/public/'? Is it a fixed path? Or it may change dynamically (For instance, when loading other type of scripts, path may be changed to e.g. binaries/data/mods/_test.dae)?Thanks for help. Edited July 8, 2010 by chlin Quote Link to comment Share on other sites More sharing options...
Ykkrosh Posted July 8, 2010 Report Share Posted July 8, 2010 See VFS. The LoadScripts function takes a VfsPath argument, so "simulation/components/" is a virtual path. ps/GameSetup/GameSetup.cpp's InitVfs mounts physical paths (like ".../binaries/data/mods/public/") onto virtual paths (like ""), so the VFS can translate back to the physical path when the code wants to open a file.There can be multiple mods loaded at once, so files will be read from a combination of them all. And the VFS can also load .zip files, so the virtual path might correspond to a file inside the zip instead of a single physical file. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.