SC2Mapster Forums

Resources > Tutorials

[Texture, Misc] How To Implement Custom Player Decals Without Overriding

  • 7 posts
    #1 Apr 15, 2012 at 09:42 UTC - 2 likes

    How To Implement Custom Decals Without Overriding

    Purpose

    If you're like me, you probably hate overriding and avoid modifying existing data if you can help it. You probably found yourself bewildered at the apparent lack of custom decal support, staring incredulously at the decal dropdown list, wondering how it determines which decal Textures to include. It's not yet known how that list is determined (I'd wager it's statically defined in the editor), but implementing custom decals without overriding existing decals is possible and will be covered by the instructions contained in this tutorial.

    Requisite Tools

    • StarCraft 2 Editor to edit the map
    • Hex editor to modify binary files
    • MPQ editor to import/export map files
    • StarCraft 2 to test the results

    Assumptions

    This tutorial assumes you have a custom decal ready to be implemented, as creating custom decals is outside the scope of this tutorial, and that you are aware of how to open and save files in each of the requisite tools listed above; this tutorial assumes the tools you'll use are Hex Workshop (from hexworkshop.com) and MPQ Editor (from zezula.net), with the screenshots throughout this tutorial demonstrating key instructions within these applications.

    Instructions

    Section 1: Preparations in the StarCraft 2 Editor

    Run the StarCraft 2 Editor, open a map, and access the Import module (Modules -> Import or F9). Import the .dds file containing the decal texture and save. Throughout this tutorial, ZergEmblem.dds will be the example decal.
    Optionally, after saving, you may choose to move the file (Data -> Move Files, or Right click -> Move Files, or Ctrl+M) to the "Assets/Textures/" MPQ directory, and save again. This will be handy later in the step.
    Access the Data module (Modules -> Data or F7), access the Textures data tab, and add a new Texture (Data -> Add Texture, or Right click -> Add Texture, or Ctrl+=).
    Set the Name field, click Suggest or otherwise set the ID field, leaving the other parameters at default values. Remember the ID for use later in this tutorial.
    Set both the Prefix and Slot fields to decal. If you chose not to move the imported .dds to "Assets/Textures/", you must set the File field manually.
    Access the player properties (Map -> Player Properties).
    Note the player slots and their respective decals along the Decal column, and record the decal IDs you intend to replace. In this tutorial, the "Zerg Swarm" player will have its decal "Decal_Zerg_0022_01" replaced with "ZergEmblem".
    Save if you have made any changes. Access the Import module, enable Show Reserved, export MapInfo (Data -> Export Files, or Right click -> Export Files, or Ctrl+E), and close the application.

    Section 2: Hex editing the MapInfo

    Run the hex editor application, open the MapInfo file (File -> Open or Ctrl+O).
    Access the Replace dialog (Edit -> Replace or Ctrl+H).
    Set Type to Text String, disable Pad with Nulls if it is enabled. For each decal you intend to replace, set the Find field to the decal ID and set the Replace field to the replacement decal ID.
    A new dialog will appear that will allow you to control the replacement. In the example, "Decal_Zerg_0022_01" is being replaced by "ZergEmblem".
    Once the strings have been replaced, save the file (File -> Save or Ctrl+S), create a backup if you desire, and close the application.

    Section 3: Reimporting the MapInfo

    Run the MPQ editor application, open the map file (File -> Open MPQ or Ctrl+O).
    Add the edited MapInfo file (Operations -> Add File(s), or Right click -> Add File(s), or Ctrl+A) to replace the map's unedited version, and close the application.

    Section 4: Testing and Results

    Well, that was easy. And look at how beautifully it renders in the player properties. For whatever reason, it's even in the dropdown menu now.
    And it looks pretty cute in game, though it's not really popping on the terran structures.
    Last edited Apr 15, 2012 by JademusSreg
    • Step01.png
    • Step02.png
    • Step03.png
    • Step04.png
    • Step05.png
    • Step06.png
    • Step07.png
    • Step08.png
    • Step09.png
    • Step10.png
    • Step11.png
    • Step12.png
    • Step13.png
    • Step14.png
    • Step15.png
    • Step16.png
    • Step17.jpg
    #2 May 05, 2012 at 02:27 UTC - 0 likes

    Pretty cool mang

    #3 May 05, 2012 at 20:22 UTC - 0 likes

    It would be cooler if hover images worked for embedded images.

    #4 May 13, 2012 at 05:55 UTC - 0 likes

    You know you can texture swap decals using Texture Select By ID.

    Last edited May 13, 2012 by DrSuperEvil
    #5 May 13, 2012 at 07:39 UTC - 0 likes

    If the subject of this tutorial was not the implementation of custom player decals, that would be a legitimate observation.

    Last edited May 13, 2012 by JademusSreg
    #6 May 13, 2012 at 08:20 UTC - 0 likes

    Oh yeah, sorry.

    #7 Jan 24, 2013 at 17:30 UTC - 0 likes

    Is there any way to do this with a mod? That is, through hex editing make custom decals available in the drop-down menu?

  • 7 posts

You must login to post a comment. Don't have an account? Register to get one!