Author Topic: (Resource) extraResources  (Read 1333 times)

This lets you add files to the download manifest without having to associate them with a datablock.
It is intended to replace cases where you would create an unnecessary ParticleData datablock just to have people download a bitmap.

Note: This does not let you force people to download files. The client-sided download filters are still respected, this just lets you save datablocks.

addExtraResource(string fileName)
  Add a new file for clients to download. Not all extensions are allowed by the engine.
  You should call this before the mission is created (inside add-on execution is fine).
  If you do need to add files after that, you'll need to call the following to update:

    EnvGuiServer::PopulateEnvResourceList();
    snapshotGameAssets();


Example:

     addExtraResource("Add-Ons/A_B/assets/textures/c.png");



https://github.com/qoh/bl-lib/blob/master/extraResources.cs

This is extremely useful. Beats creating a crapton of emitter datablocks just for some chat emoticons or something

any clarification on how this works? it looks like it makes it part of the environment gui data set in some way

any clarification on how this works? it looks like it makes it part of the environment gui data set in some way

When blockland creates the file manifest it'll collect dependencies from datablocks, damage types (the kill icons) and environments (skyboxes, sunflares, etc).
The environment ones are stored in global variables, so we can easily add our own and regenerate the file manifest (with snapshotGameAssets)

Very nice! I'll put this in use right away.