Decals


Decals are materials that are printed onto surfaces. These are perfect for adding detail and for things like blood spatter or dirt.
A decal is an object spawned into the world, usually by sprites, and can even have AI.

  • Decals are created by adding a .txt script file in the /Script/Decals folder of a mod.
  • The name of the .txt file will be how this decal will be referred to in other script files.
  • To replace a base game decal, you must name the .txt file using the right decal ID.
  • Using the same name as a previous mod's decal will overwrite it.

    Script file content example

    // Every script operation must end with a semicolon. Spaces or line returns are ignored.;
    // Base game decal file names are a number, so only use non-number names to add new decal. Ex: BlueChickenDecal.txt;
    // Don't put spaces in file names.;

    // This decal script is for a water ripple from a raindrop.;

    // If true, will grow if another decal of the same type is overlapping it;
    grows = false;

    // AI is a subject on its own. Please check the AI section in the modding documentation at https://blazingbitgames.com/mods ;
    // This will call the PLAY_SOUND AI command to play the BLOOD_HIT sound.;
    ai.AddNode(56, -1.0, -1.0, 8, 0.0, 0.0, 189.0, 1.0, 1.0, 1.65, 1.75, -1.0);

    // This will call the DECAL_KILL command after 0.5 seconds.;
    ai.AddNode(219, 0.5, -1.0, 0);

    // anim is a temporary animation structure that setups animations for future use.;
    // If true, m_clamp will stop the animation after playing it once. false will loop the animation forever.;
    anim.m_clamp = true;
    // m_animationSpeed is how fast the animation will play.;
    anim.m_animationSpeed = 2.0;
    // m_frameAmount is the amount of frames in the animation.;
    anim.m_frameAmount = 4;
    // m_frameOffset is the sprite sheet offset of the start of the animations.;
    anim.m_frameOffset = 0;
    // This adds the animation structure to animations which will play it when the decal is spawned.;
    animations.Push(anim);

    // This actually initalizes the decal. Definition: Init(material, size, fadeDistance);
    // You can choose a material at random by adding many and separating them with ":" like in this example.;
    // fadeDistance refers to how small the decal has to be(because it's far away) on the player's screen to be hidden.;
    Init(RippleMaterial:RippleMaterial2, 0.075, 0.0075);

    // If true, if this is the oldest decal added to a room, it'll be killed if the amount of decals in this room is higher than the maximum amount allowed due to the quality settings.;
    quantityManagedByRoom = false;