How are the numbers implemented? 1 model with 10 animations? Or 10 models?
For 1 model with 10 animations you will need to work out the animation string for each of the digits. For 10 models you will need to create a map to the appropriate digit path. I recommend using an array as the map and using the indices 0 to 9 to represent to appropriate decimal digit as this would be easiest to process. This would be generated at map initialisation.
The first step to creating such a number would be to work out all the required digits. The low level approach to this would be to convert your source number into unpacked binary-coded decimal and use the above created array to convert each digit into the appropriate model or animation string. A less technical approach might be to convert the number to a string, and then convert each character back into an integer and use that as the index for the array. This should end up doing the same thing but might be easier to understand.
Now that you have a sequence of model paths or animations to represent the number, you need to produce the actual number. This would be done by starting at one point of the sequence and creating the model/running the animation at the desired location. Repeat this for the remaining characters in the sequence, except each time offset the desired position by the character width. Repeat until all digits are on screen.
If you are using units rather than models, you can instead store the unit type code in the array rather than a path or animation string. You will want to keep track of all the created special effects or units so that you can remove them after some amount of time to prevent leaks. You might want additional logic to combine damage numbers or otherwise limit the amount of 3D text on the screen at any time to avoid potential performance issues if thousands of such numbers are shown per second nearby.
Character width depends on the font used. For testing you might want to hard-code a constant character width for all characters, creating a fixed-width font. Otherwise for a variable character width another array could be used to map the glyph code to the character width. When displaying the characters, the desired position in the game would would be moved by the character width value for the last glyph displayed.
If it is used in many maps then it is likely some sort of standard library they are using.I don't know how they do it? but the Chinese often create maps and often use floating damage models based on numbers, which will make the game more attractive and professional.
Remember to tell people that you're on an older version!This is a test map that includes the entire number pattern 0 to 9, can you help me make it?
Unbelievable, I thought this would be very difficult to do because it was displayed using a model but you did it, are you the founder of this gameRemember to tell people that you're on an older version!
Here's a working design.
Variables used in these triggers:
View attachment 472582
Display Damage Numbers Setup
Events
Time - Elapsed game time is 0.00 seconds
Conditions
Actions
Set DDN_Width_Offset = 30.00
Set DDN_Height_Offset = 30.00
Set DDN_Model_Path[0] = war3mapImported\z4 (0).mdx
Set DDN_Model_Path[1] = war3mapImported\z4 (1).mdx
Set DDN_Model_Path[2] = war3mapImported\z4 (2).mdx
Set DDN_Model_Path[3] = war3mapImported\z4 (3).mdx
Set DDN_Model_Path[4] = war3mapImported\z4 (4).mdx
Set DDN_Model_Path[5] = war3mapImported\z4 (5).mdx
Set DDN_Model_Path[6] = war3mapImported\z4 (6).mdx
Set DDN_Model_Path[7] = war3mapImported\z4 (7).mdx
Set DDN_Model_Path[8] = war3mapImported\z4 (8).mdx
Set DDN_Model_Path[9] = war3mapImported\z4 (9).mdx
WARNING
Display Damage Numbers Run
Events
Unit - A unit Takes damage
Conditions
(Damage taken) Greater than 0.00
Actions
-------- Get the amount of damage that was dealt: --------
Set DDN_Damage_Amount = (Damage taken)
-------- --------
-------- Convert that damage amount into an Integer and store that value in a String variable: --------
Set DDN_Damage_String = (String((Integer(DDN_Damage_Amount))))
-------- --------
-------- Get the total number of digits in our new String: --------
Set DDN_Digit_Count = (Length of DDN_Damage_String)
-------- --------
-------- Set the starting position of the damage text: --------
Set DDN_Point[0] = ((Position of (Damage Target)) offset by (-60.00, DDN_Height_Offset))
-------- --------
-------- Create the damage number special effects by using each digit of our damage string: --------
For each (Integer DDN_Loop) from 1 to DDN_Digit_Count, do (Actions)
Loop - Actions
Set DDN_Digit_Value = (Integer((Substring(DDN_Damage_String, DDN_Loop, DDN_Loop))))
Set DDN_Point[1] = (DDN_Point[0] offset by ((DDN_Width_Offset x (Real(DDN_Loop))), DDN_Height_Offset))
Special Effect - Create a special effect at DDN_Point[1] using DDN_Model_Path[DDN_Digit_Value]
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation( udg_DDN_Point[1] )
-------- --------
Custom script: call RemoveLocation( udg_DDN_Point[0] )
If you don't have the Unit - A unit Takes damage Event it's because you're on a version older than 1.31. To fix this you need to rely on an older version of Bribe's Damage Engine which will help you detect when damage is taken. You should be able to find one if you search around Hive.
With the Damage Engine system imported, simply modify the above trigger to work like this:
Display Damage Numbers Run
Events
Real - DamageEvent becomes Equal to 1.00
Conditions
DamageEventAmount Greater than 0.00
Actions
-------- Convert that damage amount into an Integer and store that value in a String variable: --------
Set DDN_Damage_String = (String((Integer(DamageEventAmount))))
-------- --------
-------- Get the total number of digits in our new String: --------
Set DDN_Digit_Count = (Length of DDN_Damage_String)
-------- --------
-------- Set the starting position of the damage text: --------
Set DDN_Point[0] = ((Position of DamageEventTarget) offset by (-60.00, DDN_Height_Offset))
-------- --------
-------- Create the damage number special effects by using each digit of our damage string: --------
For each (Integer DDN_Loop) from 1 to DDN_Digit_Count, do (Actions)
Loop - Actions
Set DDN_Digit_Value = (Integer((Substring(DDN_Damage_String, DDN_Loop, DDN_Loop))))
Set DDN_Point[1] = (DDN_Point[0] offset by ((DDN_Width_Offset x (Real(DDN_Loop))), DDN_Height_Offset))
Special Effect - Create a special effect at DDN_Point[1] using DDN_Model_Path[DDN_Digit_Value]
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation( udg_DDN_Point[1] )
-------- --------
Custom script: call RemoveLocation( udg_DDN_Point[0] )
It only works on Warcraft III version 1.31, do you have any other way for it below version 1.3? Just create an icon and click it with the mouse.It's a bit complicated but this program can help make it easier to do:
![]()
Warcraft 3 Reforged UI Designer (RUID)
Warcraft III Reforged UI Designer (v2.6.1) Discord Link Github Repository Link A tool made to create User Interface designs and systems for Warcraft 3 Maps without code. The application terminates the need for coding in favor of creating draggable graphical elements to express the design. Its...www.hiveworkshop.com
Custom UI was introduced in 1.31. But I've seen some older systems that fake buttons using units, not a pretty solution.It only works on Warcraft III version 1.31, do you have any other way for it under version 1.3? Just operate clicking on the icon.
No, you'd have to downgrade the map to 1.29, which will lose any 1.3-only features that you may have been using:For example, if my map is used in World Editor 1.3, will it still be playable in Warcraft 3 1.29? or requires playing on Warcraft 3 1.3 or higher.
Can you please post a new thread if you have different questions. But the base attack cooldown cannot be modified in pre 1.31, outside of using a Morph ability that changes the Unit-Type. Also, your Object Editor is on rawdata mode in case you didn't know (press Control + D).@Uncle Can I change this in the trigger? For example, a hero with an Agi over 1000 will reduce his attack speed to 1.0