• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] model

Level 4
Joined
Mar 7, 2024
Messages
68
Mình có mô hình các số từ 0 đến 9 muốn chia sẻ với nhóm mô hình nhưng chưa biết cách làm, bạn có thể hướng dẫn mình được không?
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,223
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.
 
Level 4
Joined
Mar 7, 2024
Messages
68
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.

There are 10 models, each model is a number.
 
Level 4
Joined
Mar 7, 2024
Messages
68
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.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,223
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.
If it is used in many maps then it is likely some sort of standard library they are using.

"professional" games do not necessarily use such text. Games like Heroes of the Storm use billboarded floating text similar to the built in floating text in Warcraft III. In fact most games go with the billboarded text approach, including big named titles such as Borderlands 2 and 3.

I recommend breaking the problem down into steps, such as those I talked about above. Firstly get all your models mapped to an array at appropriate indices. Then work on converting your damage number into a sequence of index numbers to use with that array. Finally create a loop that creates the models for all the index numbers in the sequence, offsetting them in the world by a character width to prevent overlap. Then work out how to clean up all the models after they expire. Finally bundle this all into a system that lets you pass it a number and position, and it then creates the number at the desired location.
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,662
This is a test map that includes the entire number pattern 0 to 9, can you help me make it?
Remember to tell people that you're on an older version!

Here's a working design.

Variables used in these triggers:
1715425746986.png

  • 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
  • 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] )
WARNING
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] )
 

Attachments

  • Custom Damage Numbers 1.w3m
    84.3 KB · Views: 1
Last edited:
Level 4
Joined
Mar 7, 2024
Messages
68
Remember 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
  • 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] )
WARNING
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] )
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 game 😍 😍 😍
 
Level 4
Joined
Mar 7, 2024
Messages
68
like the image, is there any way to create an icon outside the screen area? And it has a certain function, for example, left mouse click on that icon and it will increase the hero by 1 level or click on it to ask the player with 100 gold to raise the hero by 1 level. Can you do it? Please help.
hoi1.PNG
hoi2.PNG
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,662
It's a bit complicated but this program can help make it easier to do:
 
Level 4
Joined
Mar 7, 2024
Messages
68
It's a bit complicated but this program can help make it easier to do:
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.
 
Level 4
Joined
Mar 7, 2024
Messages
68
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.
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,662
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.
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:

Not every patch introduced big changes though so you may be fine.

Anyway, imagine you downloaded a new patch that added a new Hero to the game, Master Uncle. Players that haven't downloaded the new patch will not have the files and data for this new Hero, so the Hero literally does not exist for them. It'd be impossible for them to play a map on the new patch since their computer literally does not have the files needed.
 
Last edited:
Level 4
Joined
Mar 7, 2024
Messages
68
Thank you for explaining clearly so I can understand better, I edited the map in version 1.3, Warcraft 3 Reforged UI Designer (RUID) is really difficult, only a master can use it. I have researched it without success, like in the picture I want to make 5 more Inventory slots, when the hero's 6 Inventory slots are full it will move to the position of the other 5 slots, can you help me?
HOII.PNG
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,662
@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
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).
 
Top