User Tools

Site Tools


asset-override

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
asset-override [2019/05/31 11:15] – external edit 127.0.0.1asset-override [2019/09/26 17:09] (current) maxime
Line 1: Line 1:
 ====== Asset Override ====== ====== Asset Override ======
  
-All [[preview:assets|game assets]] (and other mods assets) can be override by mods, partially or totally.+All [[assets|game assets]] (and other mods assets) can be override by mods, partially or totally.
  
 The ''mod:override'' function should be used for that purpose. The ''mod:override'' function should be used for that purpose.
Line 50: Line 50:
  
 The list will also include all villages added by other active mods. (unless one of theme completely override the List after your mod append its villages). The list will also include all villages added by other active mods. (unless one of theme completely override the List after your mod append its villages).
 +
 +===== FBX asset override =====
 +
 +You can now override the materials generated from textures when you import a 3D model. This can be useful for example to enable Alpha Test for models created with Blender. All materials of a model can be found in a virtual directory under your model's file.
 +
 +For example, in the //Example 01// mod, there is a 3D model named ''fountain.fbx'' in the directory ''models'', and this model uses a texture named ''FountainColor.png''.
 +
 +The material can be found at the path ''[path to the FBX file]/Materials/[name of the texture without extension]''. In //Example 01//, here is how to enable alpha test on a material:
 +
 +<file lua buildings.lua>
 +-- File path is "models/fountain.fbx" and texture name is "FountainColor.png"
 +mod:registerAssetId("models/fountain.fbx/Materials/FountainColor", "FOUNTAIN_COLOR_MATERIAL")
 +mod:override({
 +    Id = "FOUNTAIN_COLOR_MATERIAL",
 +    HasAlphaTest = true
 +})
 +</file>
  
 ===== Related features not yet implemented ===== ===== Related features not yet implemented =====
   * Removing specific items from a list   * Removing specific items from a list
  
asset-override.1559315748.txt.gz · Last modified: 2019/05/31 11:15 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki