• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ HD Level Design Contest #1 POLL is now OPEN! Check out the stunning visuals of the final entries. 🔗Click here to cast your vote!

Linking Data Elements & Changing Textures by Id [Data Editor]

Level 22
Joined
Feb 4, 2005
Messages
3,971
This is some basic tutorial but I am posting it because I recently had problems with the same and now I, as well as others could see which element can be linked where and how. Because in many cases this is confusing and I didn't see any tutorial on linking things. (it may be subject to editing if more things are found during the process).

Actors are the most important data for an object because without an actor you will not have the object working on the map. That is why everything is either linked to the Actor or has relation to it. You can have an object without Unit data (doodads are just Actors with Models they are not Units and have no Unit data) but for all Actor is present.

Linking a Unit to Actor

When duplicating an actor that you will later attach to a unit, it's good to choose an actor that has Token/Unit Name.



This is where you link an actor and a unit by selecting the unit in my case John johnson ID (this unit is an item, will explain later). I'm sure the Token is called by one of the Actor Events (Event tab you see when selecting an actor) but I didn't find out which one so best is to duplicate an actor with already existing Token/Unit Name.

Linking Models to Actor

Models are data that contains the information which model M3 file is used and other data but the Model in Data Editor is just the data not the filename itself. Linking the model you want to use for a unit is easy: Just change the model in the Art tab of the Actor (there you can also change the Portrait Model, Placement Model, etc.) Notice 'Scale', you can change the unit's what in war3 is Scaling Value i.e the size of the unit from there but it could be done on Model's scale too from the Model data.



Linking Items

Items are units to which you need to connect some additional things. And here is one tricky thing that not everyone can find I'm sure.. In the Data editor click Show Advanced Fields. Now having selected Unit, go to the Stats tab of the Unit and with the advanced fields revealed, that is where you link an Item to the Unit if that Unit will be an item (kind of anti logic since what would Item field be doing among Unit stats?)

unledgac.png



Automatic Linking Buttons

It will auto link if it has the same name as the item's and unit's name. So if you use the same name for a custom Button you made. Alert Icon - the icon, Alert Name - the name, Alert Tooltip - you write down the item description. (the Tooltip, name and Icon are automatically pasted to the lower fields of that Button: Icon, name, tooltip. You need to make a Button (with the same name) for each Ability or Unit you do as it is where the tooltip name and such are displayed.



Linking/Removing Abilities, Behaviors

On the Ability tab of the Unit you add the ability. Don't forget creating a Button for that ability with the same name and putting the icon and text tooltip to not appear blank in-game. Behaviors are added or removed in the same way but to the Behaviors tab.

Linking Or Removing Death Models

Again enable Show Advanced Fields and go to Combat tab of Actor and there with advanced fields on, you will see Custom Death - Model where Protoss Death, Zerg Death, Terran Death models are attached to every unit. This is where you change or remove the link with them.



Linking Or Removing Death Sounds

In Actor, choose 'Combat' tab, scroll down to Death Effects - Sound and Death Effects - Voice Link
In Actor on 'Sound' tab you will see the list of sounds, this is where you add Unit_Explode, Unit_What or change sounds in any way.

Linking Elements With Actor Events

Sometimes you see elements and you cannot figure out where they are linked that they appear at all. It is in the Actor Events that do that under Events Tab of the Actor, if you delete all actor events the unit may not work as there are some actor events crucial for the unit to work. So it is via these events that you link or separate some of the elements of a unit. In order to understand them you need to understand Actor Events and which does what, that is not covered in this tutorial.

Validators and Movers are created via ActorEvents - it is not a good idea to delete those, as they allow you to determine whether the unit is flying, what pathing it has and you can do that by clicking on Movers, Ground or the validators - Is Flying/Is Not Flying.

Changing A Unit's Texture (Texture Select By Id Method)

It isn't done just by selecting a different .dds file. Changing by Texture Select By Id is the best method. Here is how to do it:

Let's say you want to change the texture of a Sphere to not be the chess grey-white squares but some other texture called Korhal.dds. For it you need to:




Create a duplicate or new texture from the Data editor. With the new Texture data you select for File: the Korhal.dds or whatever texture you will use. In 'Slot' field you type main.diffuse and exactly like that with a dot. Then you go to the Sphere's model in the Data editor. There in the Model data of the sphere you need to touch some things:

on all fields from Texture Declarations Adaptations - Applies to File you should doubleclick the empty field you see and check the box Enabled. You do the same for Texture Declarations Adapatations - Properties Add, the same for next field ~ Properties Remove, Properties Set, for all you should have:

The next field: Texture Declarations Adapatations - Slot you type main.diffuse. Next two fields: Trigger on Substring and Prefix should be blank, Trigger on substring has again 0 0. If it says Sphere on the Texture Declarations - Prefix field, remove the name, it should be blank field.




Having set that data in Model, here is how to change a texture of a model but these steps so far are needed. Go to Actor and from the actor go to Events tab. Here is how you change by TextureId. There are two ways:

First way
You can see the effects of Actor Events ingame but you will not see them in the editor. See the image which to choose and change, start by creating a new Event and choose ActorCreation from the list.



Second way
You can see the effects of Actor Events ingame AND in the editor as well. Since the editor doesn't want to show the changes you do when applying the changes directly with ActorCreation, using a Timer does the same but also the editor shows it. You start again with Right-Click mouse, Add Event, choose ActorCreation. But this time you don't hurry with TextureSelectById, you add a TimerSet instead. In TimerSet you put 1 for its name, you leave Duration: 0.00000

Now you create a new one, 'Add Event' this time is TimerExpired. This time you also add Term, so on the TimerExpired right click, add Term and choose TimerName, again put 1 for Name: (Term is a condition for the Actor events and here it is like Name of Timer equal to '1' to specify to which Expired Timer the action is added). When the term is set, you do the same as First Way choosing the action TextureSelectById and the same as above.



Here is how the texture also changes in the editor:



(Big thanks to SC2Mapster guys for teaching me the TextureId Method, most of the Links I found myself).
 
Top