Many many thanks and major credit goes to DrSuperEvil, he's the one who started the ball rolling.
Here's the original thread, and how some of this was discovered.
Link to Kueken531's Texture Swap Testmap!!
- You will only be required to modify 3 data types, they are Actors, Models, and Textures.
- You will also need to use the Previewer, which can be opened with Ctrl + Shift + V, or by going to the menu Data -> Preview Model.
- Setup the following buttons(seen in the picture) all pushed in. It will allow you to see the proper fields.
For all intents and purposes, I am going to be modifying the PrisonZealot to look like a regular Zealot(sort of) with blue Dreadlocks!
Now let's get started shall we?
First, open up the previewer, and find/load the PrisonZealot into the previewer. Afterwards, you will need to make sure that the little button with 2 green and 2 black squares is pressed(in the red circle).
This displays the Materials folder of the model, which is where we are going to find our Prefix and Substrings.
We are looking to modify the Hair and the entirety of the Prison Zealot, and taking a look at the material folders, we will need to reference [3: Dredlocks] and [5: Standard_14] folders.
Now it's time to modify our Model!
Look up the Prisoner Zealot model, and head on in! You will want to scroll down and find the field
Texture Declarations+ which you will notice is empty. Open it up and right click in the first box Texture Declarations, and select Add Value, OR you can just click on the green X to the right.
All that happens, is that you get a new Index at 0, and you can now modify the Adaptions box below it(if you have Index 0 selected), so do that(select Index 0) and again right-click Add Value or Green X in the Adaptions section. Do that 4 times, so you get Indexes 0 through 3. Here is where we will be modifying the PrisonZealot's main textures.
WARNING: If you have multiple indexes like the above, 0 through 3, and you attempt to delete 0, 1 or 2, it will crash your editor. You MUST delete Index 3 first, then 2, then 1, or as stated, the editor will crash!
Select Index 0 of Adaptions and using Main Reference from above [5: Standard_14], first thing we will want to do is add our Prefix, which you might notice from the picture, is PrisonZealot, so write PrisonZealot_ in the Prefix box. (Through testing, in many cases it is REQUIRED that the _ be included in the Prefix as well as the Substring, else it MAY NOT function in-game.)
NOTE: you only need to input the Prefix once per Texture Declaration Index.
- Now write main in the Slot box, and write _Diffuse in the Trigger on Substring box.
- Select Index 1 and write main in the Slot box, and write _Specular in the Trigger on Substring box.
- Select Index 2 and write main in the Slot box, and write _Emissive in the Trigger on Substring box.
- Select Index 3 and write main in the Slot box, and write _Normal in the Trigger on Substring box.
Now, add a new Index to Texture Declarations, this will be Index 1. And add a new Index to Adaptions under Index 1.
Select Index 0 of Adaptions and using Hair Reference from above [3: Dredlocks], first thing we will want to do is add our Prefix, which you might notice from the picture, is ZealotDreads, so write ZealotDreads_ in the Prefix box.
- Now write hair in the Slot box, and write _Diffuse in the Trigger on Substring box.
Now our Prison Zealot's main textures are ready and able to be modified to our hearts content!
Here's what it should look like. Click on the picture to view better detail.
The Prefix (and possibly the Substring) seem to be case sensitive. In the case of the Prison Zealot, it's main Prefix is PrisonZealot, and the Colossus' main Prefix is colossus, not Colossus.
Head over to the textures tab, and right click, Add Texture, Name along the line of PrisonZealot_Diffuse, click on Suggest, leave Based ON as CTexture.
- Modify the Slot field, write/input main.diffuse
- Modify the File field, file path Assets\Textures\Zealot_Diffuse.dds
Add Texture, PrisonZealot_Emissive.
- Modify the Slot field, write/input main.emissive
- Modify the File field, file path Assets\Textures\Zealot_Emissive.dds
Add Texture, PrisonZealot_Specular.
- Modify the Slot field, write/input main.specular
- Modify the File field, file path Assets\Textures\Zealot_Specular.dds
Add Texture, PrisonZealot_Normal.
- Modify the Slot field, write/input main.normal
- Modify the File field, file path Assets\Textures\Zealot_normal.dds
Add Texture, PrisonZealotHair_Diffuse.
- Modify the Slot field, write/input hair.diffuse
- Modify the File field, file path Assets\Textures\twilightcouncil_diffuse_holo.dds
We're all done in the Textures Tab now.
ADDENDUM: There is no way to use 1 file for multiple texture slots, besides re-importing the file. However, you can use 1 texture object on multiple units easily, just make sure you always use the same slot.
Find Prison Zealot, and modify Events - Events+ field. Scroll down to the bottom, select the last entry, right click, Add Event then modify the Event to look like the following
- Actor Creation
- TextureSelectById PrisonZealot_Diffuse.
Add a few new events, should look like this when you are done.
ADDENDUM: You are able to view textures within the map editor by slightly modifying when the Texture Select By ID occurs. The tutorial creates it on Actor Creation, and can only be viewed and tested in-game. By using a TimerSet into a Timer Expired event (example below), you are able to preview some changes directly in the editor.
- TimerSet Timer 0.1
- TimerName Timer
- TextureSelectByID texture1
We are now Finished!!
Please read the Note below about Slots. Should remove some confusion.
Also, You might get some errors in the editor from time to time something along the line of "Cannot load blah blah Expression 1". This is either an Editor "Thing", or you are linking the improper Texture in the Actor Event. If it works fine in game, no worries about the editor.
Here are some of the SLOTS you might use. Don't know if it's the full list, but it might be.
- Generic 01
- Generic 02
- Generic 03
- Generic 04
- Generic 05
Note: Specific textures DO NOT have to be placed in specific slots. You can use the Main slot to change a Smoke Trail, and you can use the Decal slot to change the primary texture of a unit. Slots are Interchangeable, use whichever slot you like.