Tutorial Useful Data of the World Editor

Chocobo

White-Flower
Reaction score
409
This tutorial covers some of useful parts of the World Editor.


Table of Contents
1. Known Deysnchronisation causes
2. Pre-Placed World Editor Limitations
3. Guarding Points
3.1 Name of Guarding Points
3.2 Usage of Guard Positions
3.3 Guard Position Generation
3.4 Guard Position in Trigger Editor
3.41 AI - Ignore Unit Guard Position
3.42 AI - Recycle Unit Guard Position
3.43 AI - Lock Unit Guard Position
4. Map Size Limitations
5. Size taken by variables (globals or locals)
6. Object Data Files in Warcraft 3
7. Path Colors in World Editor
8. Abusive Using of Backward Animations
9. Running Warcraft 3 in Window Mode
10. Infopanel movement/attack speed filter
11. Blight infodata with UI\MiscData.txt
12. Selection Circle
13. Simulating Text Datas
14. Area Damage
15. Blizzard Chat Limit


1. Known Deysnchronisation causes

There is many desynchronisation causes online, and I will list them there :

- Missusing of GetLocalPlayer() (JASS Script Trigger Editor)
- Using Negative Sight Range for a unit (Unit Editor)
- Camera - Pan Camera as Necessary (GUI Trigger Editor)
- Traditionnal Fade Filter with a GetLocalPlayer() filter (JASS Script Trigger Editor, use an Advanced Filter to solve the problem)
- Too many initializations and preloads after (and not before) 0.00 seconds of game-time using Event - Time Elapsed (GUI Trigger Editor)
- Selection - Select Group For Player (GUI Trigger Editor)
- Too big Far Z usage, happens only on slow computers, like >2.5ghz with 20000.00 Far Z (GUI Trigger Editor - Camera Editor)
- Units with too many dice and sides per dice combined with a too small attack speed, like 1-1000000000 every 0.01 seconds (Unit Editor)


1.1 Missusing of GetLocalPlayer()

The causes of the desynchronisation while using GetLocalPlayer() are :
- Creating an alone handle (One handle that isn't existing on others' computers. An handle returns : widget (unit - item - destructable), player, trigger, (unit - item - destructable - player - trigger) extends handle)
- Creating an alone string (One string that handle a value in a computer but not in others' computers, returning automaticly "" and instant desync)
- Changing the amount of rows or columns of a Multiboard shown to an alone player
- Setting a same variable with differant values that use GetLocalPlayer() inside (Example : set whatever=GetPlayerName(GetLocalPlayer()))
- Running a Trigger for an alone player (Runs a trigger that isn't ran in others' computers)
- Using a Traditonnal Fade Filter instead of an Advanced Fade Filter


1.2 Safe uses of GetLocalPlayer()

GetLocalPlayer() is safe for :
- Special Effects' Model Names ("" for others' computers whereas you have "<blabla>")
- Creating Alone Multiboards or changing their values
- Using Differant Colorations for units
- Advanced Fade Filters
- Sounds
- Game - Display Text .... extended with parameters
... and more more. Too many to list it.


2. Pre-Placed World Editor Limitations

There is a limit to all Pre-Placed things in World Editor for a NON-campaign map:
- 6144 Pre-Placed Destructables
- 8192 Pre-Placed Doodads (Beware, doodads includes destructables)
- 512 Pre-Placed Neutral Hostile Units + Neutral Hostile Buildings + Neutral Passive Units
- 96 Pre-Placed Neutral Passive Units
- 1080 Pre-Placed Units for Players from 1 to 12 (0 to 11)
- 600 Pre-Placed Buildings for Players from 1 to 12 (0 to 11)
- 256 Pre-Placed Items
- 7776 Custom Units
- 7776 Custom Items
- 7776 Custom Doodads
- 7776 Custom Destructables
- 7776 Custom Abilities (including Buffs, which are obviously called Buffs, but are origanally Abilities)
- 7776 Custom Upgrades

The limits for each Campaign map is :
- 6144 Pre-Placed Destructables
- 8192 Pre-Placed Doodads (Beware, doodads includes destructables)
- 512 Pre-Placed Neutral Hostile Units + Neutral Hostile Buildings + Neutral Passive Units
- 96 Pre-Placed Neutral Passive Units
- 1080 Pre-Placed Units for Players from 1 to 12 (0 to 11)
- 600 Pre-Placed Buildings for Players from 1 to 12 (0 to 11)
- 256 Pre-Placed Items
- 5184 Custom Units
- 5184 Custom Items
- 5184 Custom Doodads
- 5184 Custom Destructables
- 5184 Custom Abilities
- 5184 Custom Upgrades


3. Guarding Points


3.1 Name of Guarding Points

Guarding Points are called in an another side Units' Guard Positions (UGPs). They are supposed for the computer to refill all important points with new units when the guarding units gets killed. This only applies to computer players from 1 to 12 (0 to 11). The Guarding Points do not affect Neutral Units.


3.2 Usage of Guard Positions

When a spawned unit for the AI has no guard position, it'll be ordered to one of his images to do the same guard position to fill it, or to search a point to be filled. If there is no empty guard position, the unit will go on the First Guard Position (FGP), which is the point of the first pre-placed unit/building for the player. In simple, it is : The Starting Point
Without any guard position available on the map for the computer, the unit will stand there and do nothing unless a hostile unit comes close to it to be attacked forever until the death of the new unit. When the spawned unit moves too far of the Guard Position, it'll be ordered to return to its Guard Point. This is very similar for creeps' behaviour (neutrals' behaviour) that uses creep camps.


3.3 Guard Position Generation

When you create a pre-placed unit in World Editor for a computer, it generates automaticly a Guard Position (which can not be the FGP, First Guard Position, because it is the Starting Point). It stores the Owner, the Location, and also the Unit Type. You can not create Guard Positions after the game has started. Pre-placed normal units and removing them at map initialization do not remove the Guard Position. This can be useful when you need a Guard Position. But too many for the computer won't allow him to do an efficient guard of its outposts.


3.4 Guard Position in Trigger Editor

There is 3 functions about the Guard Position in the Trigger Editor :


3.41 AI - Ignore Unit Guard Position

This function can not be used on the First Guard Position and on Neutral Units.
This function removes the Guard Position of a unit, so there is no longer a guard position at the location of the unit, and can not be filled then. Also, the unit ignores the Guard Position, and won't return if it gets too far of its old position (following forever its target until one's death). And this function make the unit unavailable (considering as dead) for AI Scripts and in some cases, stucking it.


3.42 AI - Recycle Unit Guard Position

This function can not be used on the First Guard Position and on Neutral Units.
This function removes the Guard Position of a unit, like AI - Ignore Unit Guard Position. But, it sends the unit to the First Guard Position of the computer, and makes it also available for AI Scripts (considering as alive).
This almost undo the effect of AI - Ignore Guard Position.


3.43 AI - Lock Unit Guard Position

This function creates a homepoint for the unit at its current location. It works with similitudes as a Guard Position, but isn't a Guarding Point. It works more as a Patrol Point, and is used when the unit hasn't any Guard Point available. You can combine AI - Lock Unit Guard Position and AI - Recycle Unit Guard Position to make units patrols between special patrol points and the first guard position, but it cannot be ignored by AI - Ignore Unit Guard Position and cannot be removed or moved.


4. Map Size Limitations

The limit for online maps is 4 mb (4,194,304 bytes) after MPQ Compression. The MPQ Compression is very high in some cases (80% reduction from imported files is almost the max), very small in other cases (2~3% reduction from imported files). Singleplayer and Campaign map limitations are unlimited. You can have for example a map with 2 gb or a map with 20 kb size.


5. Size taken by variables (globals or locals)

Warcraft III Variable Format has 8 differants format type.

- Integers
Integers are 4 bytes in Little Endian Order
Example : 1234 Not Equal [00 00 04 D2]h
1234 Equal [D2 04 00 00]h

- Small Integers
Small integers are from -16384 to 16383. They take 2 bytes and are in Little Endian Order.

- Reals
Reals are Floats. They take 4 bytes and are in Little Endian Order.
Example : 7654.32 ~ [8F 32 EF 45]h ~ 7654.319824
The last number is the closest number to 7654.32

- Arrays
1 Array take 1 byte

- UnitIds
UnitId Integers takes 32 bytes. (46656 possibilities, they are like normal Integers)

- Flags
Boolean, or "Flags", take 4 bytes. In those 4 bytes, there are 32 bit, which can contains 32 flags. Each Flag can contain only the value 0 (False) or 1 (True).

- Water
Water Level (In the terrain) takes 4 bytes every cell, it handles 2 bytes for a total of 16 flags, and the 2 lasts for the closest number to the Water Level.

- Custom Handles
An integer or a flag may share themselves some bytes. A byte may handle two or more differant data.

- Structured Handles
Unknown. They have various size.

- Strings / Trigger Strings
Strings are just like arrays of chars finished with a null char (From C++ : "\0").
But, Blizzard uses a special coloring code to change the color of the text shown, these starts with "|cff", and finishes with "|r", most of the times. An example is "|c00BBGGRR|r", in which you replace by the percentage value "BB", "GG", "RR", by the percentage value you want. They are hexadecimal values (0123456789ABCDEF), using 2 digits each, BB = Blue, GG = Green, RR = Red.
In Trigger Strings, if it starts with "TRIGSTR_", with a sensitive case, it is a Trigger String. Trigger Strings are ever keep in the virtual memory when you play a map, which is loaded at the map initalization, as a name of "TRIGSTR_***". Instead of writing the TRIGSTR_<WHATEVER> thing, Warcraft III get a look in the string table, and displays the correct trigger string. They work only for files inside a .w3m or .w3x map, but not with the exception of WTS files, which is used for Trigger Strings files itself. If the following number after "TRIGSTR_" is negative, it will be considered as the first one, called "TRIGSTR_000". And when there are letters, they will be considered as 0, or if an example of "5aa", as 5.
At all, they takes :
- Strings : (String Length + 1) bytes (Because of the finishing char)
- Trigger Strings : 12 bytes (Note Trigger Strings handles Strings, so the total is Trigger Strings + Strings)

Variable renaming types:
Code:
Value  	Variable Type  	Value Format
0 	Integer 	int
1 	Real 	float (single precision)
2 	Unreal (0 <= val <= 1) 	float (single Precision)
3 	String 	string (null terminated)


6. Object Data Files in Warcraft 3

The table shows where to get the object IDs and the modification IDs and if the files use the 2 additional level and data pointer integers.

Code:
Extension  	Object Type  	Object IDs  	 	 	Mod IDs  	 	 	 	 	Uses Optional Ints
w3u 	  	Units 	 	Units\UnitData.slk 	 	Units\UnitMetaData.slk 	 	 	 	No
w3t 	  	Items 	 	Units\ItemData.slk 	 	Units\UnitMetaData.slk (those where useItem = 1) No
w3b 	  	Destructables 	Units\DestructableData.slk 	Units\DestructableMetaData.slk 	 	 	No
w3d 	  	Doodads 	Doodads\Doodads.slk 	 	Doodads\DoodadMetaData.slk 	 	 	Yes
w3a 	  	Abilities 	Units\AbilityData.slk 	 	Units\AbilityMetaData.slk 	 	 	Yes
w3h 	  	Buffs 	 	Units\AbilityBuffData.slk 	Units\AbilityBuffMetaData.slk 	 	 	No
w3q 	  	Upgrades 	Units\UpgradeData.slk 	 	Units\UpgradeMetaData.slk 	 	 	Yes

2 additionnal level and data pointers seems small, but can be used in mass to store data and to change Ids if you want to use them with the Trigger Editor and a bit of ASCII.


7. Path Colors in World Editor

Code:
Color  	Build state  	Walk state  	Fly state
White  	no build 	no walk 	no fly
Red  	build ok 	no walk 	fly ok
Yellow 	build ok 	no walk 	no fly
Green  	build ok 	walk ok 	no fly
Teal  	no build 	walk ok 	no fly
Blue  	no build 	walk ok 	fly ok
Magenta no build 	no walk 	fly ok
Black  	build ok 	fly ok  	walk ok

In simple :
-> White : Can not be built, can not be walked, can not be flyed
-> Red : Can be built, can not be walked, can be flyed
-> Yellow : Can be built, can not be walked, can not be flyed
-> Green : Can be built, can be walked, can not be flyed
-> Teal : Can not be built, can be walked, can not be flyed
-> Blue : Can not be built, can not be walked, can be flyed
-> Magenta : Can not be built, can not be walked, can be flyed
-> Black : Can be built, can be flyed, can be walked


8. Abusive Using of Backward Animations

When you want to play an animation in reverse mode, like the death animation of a footman, an archer.. or whatever you want, you think for triggers that -100.00% in animation speed is imposible, but, it is possible.

Example with that trigger that has a death unit of 2.333s :

Code:
     Events
          Selection - Player 1 (Red) selects a unit
     Conditions
     Actions
          Set MyUnit = (Selected unit)
          Animation - Play MyUnit's Animation - death animation
          Animation - Change MyUnit's animation speed to 500.00% of its original speed
          Animation - Change MyUnit's vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
          Wait (2.333 / (500.00 / 100.00)) seconds of game-time
          Animation - Change MyUnit's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
          Animation - Change MyUnit's animation speed to (0.00 - 100.00)% of its original speed
          Wait 2.333 seconds of game-time
          Animation - Change MyUnit's animation speed to 100.00% of its original speed
          Animation - Play MyUnit's Animation - stand animation

Notice : 2.333/(500.00/100.00) = 0.4666
2.333 : Death Animation Time (this is not constant for all units)
500.00 = 500.00% of its original speed
100.00 = A meaning for 100%, bracking 500.00 to 5.

The death animation is played first, with an improvement of the animation speed by 5x and a vertex coloring making the unit invisible to avoid death particles. Then there is a Polled Wait, and the vertex come back to the normal values and the animation speed is reversed. And after, it waits until the animation is fully reversed and the animation is set to 100.00% and to stand to avoid the unit to stuck doing nothing.



9. Running Warcraft 3 in Window Mode

To run Warcraft 3 in Window Mode, it is very simple. Right Click the Warcraft 3 Icon, choose Properties, go in Shortcut, and look for Frozen Throne.exe. Then add the tag -window after a space and ", and Warcraft 3 will run in Window Mode. Quite useful if you are using World Editor and Warcraft 3 at same time.


10. Infopanel movement/attack speed filter

The filter used by Warcraft 3 for the movement speed filter is :
(s meaning for current movement speed)
Very Slow = s<175
Slow = 175<s<220
Average = 220<s<280
Fast = 280<s<350
Very Fast 350<s

The filter for the attack speed filter is :
(s meaning for attack speed)
Very Slow = 3.00<s
Slow = 3.00<s<2.00
Average = 2.00<s<1.50
Fast = 1.50<s<1.00
Very Fast = s<1.00


11. Blight infodata with UI\MiscData.txt

This is only allowed in singleplayer mode if you changed UI\MiscData.txt to avoid preload bugs, desyncs, and game splits on multiplayer.

Texture=TerrainArt\Blight\Blight
PuffModel=Environment\BlightDoodad\BlightDoodad.mdl
PuffDuration=3000 // Duration of a puff, in milliseconds
PuffInterval=2500 // Interval between checks for new puffs, in milliseconds
PuffChance=0.7 // Chance for a vertex to create a puff (per interval), in percent

// Dirt Chance Table
// Specifies the chance (in percent) that a neighboring vertex will be changed to dirt
// when a vertex is blighted. Due to symmetry, only five unique values are needed
// for a 2 vertex radius. The the upper right quadrant of the table is:
//
// s2 sd d2
// s1 d1 sd
// cn s1 s2
//
// where 'cn' is the center vertex, 's' means "straight", 'd' means "diagonal".
// Note that the chance for 'cn' is always 100%, and not listed here.
//

DCT_s1=5
DCT_s2=10
DCT_sd=15
DCT_d1=5
DCT_d2=20

Remember : DCT = Dirt Chance Table
s1 = Straight 1 (5)
s2 = Straight 2 (10)
sd = Straight Diagonal (15)
d1 = Diagonal 1 (5)
d2 = Diagonal 2 (20)
cn = Center Node (100, can not be changed)

Which leads us to :

Code:
10%  15%  20% 
5%   5%   15%
100% 5%   10%


12. Selection Circle

Like the Blight, this is only allowed in singleplayer if you modify UI\MiscData.txt, but it is quite useless.

// Defines different textures to be used based on selection circle size.
// The Size## value defines the largest size which uses the given textures.
// Note that the last size does not need a Size## value since anything bigger
// than the next size down uses it.
NumSizes=3
Size00=100
Texture00=ReplaceableTextures\Selection\SelectionCircleSmall
TextureDotted00=ReplaceableTextures\Selection\SelectionCircleSmallDotted

Size01=300
Texture01=ReplaceableTextures\Selection\SelectionCircleMed
TextureDotted01=ReplaceableTextures\Selection\SelectionCircleMedDotted

Texture02=ReplaceableTextures\Selection\SelectionCircleLarge
TextureDotted02=ReplaceableTextures\Selection\SelectionCircleLargeDotted

// This value is multiplied by the SLK scale field to get the circle size
ScaleFactor=72

// This value is added to the selection circle height
// when on walkable doodads.
// Note: this is also applied to shadow images
ImageWalkableZOffset=15

Meaning a circle of 1.00 returns 72 radius size in Warcraft 3.


13. Simulating Text Datas

A text data is a floating text like the gold shown when killing a unit, a critical strike, an evasion...
If you modify it, it is like the part 11 and 12.

Here is an example :
??? text data :
??? Text Color=transparency (255 meaning 0.00%),red,blue,green
??? Text Velocity=real X level,real Y level,100
??? Text Lifetime=lifespan
??? Text FadeStart=fading time start (in seconds)

Velocity is calculated in that way :
real X level = speed * 0.071 / 128 * Cos(angle * 3.14159/180.0)
real Y level = speed * 0.071 / 128 * Sin(angle * 3.14159/180.0)


Here is the list of text datas :

Gold Text Data :
Gold Text Color=255,255,220,0
Gold Text Velocity=0,0.03,100
Gold Text Lifetime=2
Gold Text FadeStart=1

Lumber text data :
Lumber Text Color=255,0,200,80
Lumber Text Velocity=0,0.03,100
Lumber Text Lifetime=2
Lumber Text FadeStart=1

Bounty text data :
Bounty Text Color=255,255,220,0
Bounty Text Velocity=0,0.03,100
Bounty Text Lifetime=3
Bounty Text FadeStart=2

Missile 'miss' text tag data :
Miss Text Color=255,255,0,0
Miss Text Velocity=0,0.03,100
Miss Text Lifetime=3
Miss Text FadeStart=1

Critical Strike text tag data :
Critical Strike Text Color=255,255,0,0
Critical Strike Text Velocity=0,0.04,100
Critical Strike Text Lifetime=5
Critical Strike Text FadeStart=2

Shadow Strike text tag data :
Shadow Strike Text Color=255,160,255,0
Shadow Strike Text Velocity=0,0.04,100
Shadow Strike Text Lifetime=5
Shadow Strike Text FadeStart=2

Mana Burn text tag data :
Mana Burn Text Color=255,82,82,255
Mana Burn Text Velocity=0,0.04,100
Mana Burn Text Lifetime=5
Mana Burn Text FadeStart=2

Bash text tag data :
Bash Text Color=255,0,0,255
Bash Text Velocity=0,0.04,100
Bash Text Lifetime=5
Bash Text FadeStart=2

For unknown reasons, Bash text is not used.


14. Area Damage (more for newbies)

Most of the times (and mostly only, else you nuke everyone), you are going to say : I want to damage the enemy units in the area only, not friendly units.

Example of wrong way of doing this :
Code:
        Unit - Cause [B]<whatever unit>[/B] to damage circular area after 0.00 seconds of radius [B]<whatever size>[/B] at [B]<whatever location>[/B] dealing [B]<whatever damage[/B] damage of attack type [B]<whatever attacktype>[/B] and damage type [B]<whatever damagetype>[/B]

Though it looks ok, it isn't because this takes all units (including the damage source if it is in the area of damage) and deal damage to them.

Here is a good way of doing this (though it takes some lines) :

Code:
        Custom script:    set bj_wantDestroyGroup=true
        Unit Group - Pick every unit in (Units within [B]<whatever range>[/B] of [B]<whatever location>[/B] Matching ((Owner of (Matching unit)) belongs to an enemy of ([B]<whatever damage source>[/B]) Equal to True) and do (Actions)
            Loop - Actions
                Unit - Cause [B]<whatever unit>[/B] to damage (Picked unit), dealing [B]<whatever damage>[/B] damage of attack type [B]<whatever attacktype>[/B] and damage type [B]<whatever damagetype>[/B]

This deals damage to every unit that is an enemy to the "whatever damage source".

Note : Damage Area is the only function with a "overtime" argument.


15. Blizzard Chat Limit

This is stupid.. but remember the limit of character amount is 254.. do not bypass it with the Game Interface (ex : setting things like [All], [Referees].....), else the game crashes.

More to come later.
 

2-P

I will work hard tomorrow
Reaction score
325
>"- Too big Far Z usage, happens only on slow computers, like >2.5ghz with 20000.00 Far Z (GUI Trigger Editor - Camera Editor)"

Is 20000 possible? 10000 is the limit AFAIK.
 

Mahucharn

I wear a fez now, fezzes are cool.
Reaction score
173
Pretty good tutorial though, it does need a little work though.
 

Chocobo

White-Flower
Reaction score
409
>"- Too big Far Z usage, happens only on slow computers, like >2.5ghz with 20000.00 Far Z (GUI Trigger Editor - Camera Editor)"

Is 20000 possible? 10000 is the limit AFAIK.

I have put 20000 one time with the Trigger Editor, then I detected the Far Z and it gived me 20000. In camera editor you only have 10000. :p
 

2-P

I will work hard tomorrow
Reaction score
325
I have put 20000 one time with the Trigger Editor, then I detected the Far Z and it gived me 20000. In camera editor you only have 10000. :p
o_O You detected Far Z...
Wells, the visible(!) Far Z doesn't go above 10000, even if you use triggers, detected or not. :p
 

Quauhtli

I have the right to remain silent.
Reaction score
62
- 8192 Pre-Placed Doodads (Beware, doodads includes destructables)
no no no no...
Doodads do not include destructables, only destructables that are outside of the playable map bounds count as doodads...
 

Tom Jones

N/A
Reaction score
437
This tutorial covers almost all useful parts of the World Editor.
Maybe you should rephrase that?
How about a table of content?
Also grimoire is worth to mention in the last paragraph.
 

Cal1991

New Member
Reaction score
7
Useful tutorial imo, +rep

The filter used by Warcraft 3 for the movement speed filter is :
(s meaning for current movement speed)
Very Slow = s<175
Slow = 175<s<220
Average = 220<s<280
Fast = 280<s<350
Very Fast 350<s

You might want to use "Disable smilies in text" for this post, becuase < + 3 = <3
 

swe_suffer

New Member
Reaction score
20
But, Blizzard uses a special coloring code to change the color of the text shown, these starts with "|c00", and finishes with "|r

I thought they started with |cff, can you start with both or have I wrong? :confused:
 

Chocobo

White-Flower
Reaction score
409
I thought they started with |cff, can you start with both or have I wrong? :confused:

|cff
|c00

The 2 first Base16 numbers are for transparency (not the "c").

It's just to show a demo text begin, not a real one, because ff = 255 (100% transparency), meaning it hides completly the text.


And also, I wrote "most of the times".

I edited it.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top