Jump to content

Context root question


Recommended Posts

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 by chlin
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...