• 🏆 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] Chat messages command only applies to heroes

Level 4
Joined
Mar 7, 2024
Messages
47
Please help me, Chat messages/move orders only apply to heroes, soldiers and horses in the team will not receive the above commands.
di chuyen.PNG
 
Level 28
Joined
Feb 18, 2014
Messages
3,580
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing /move as An exact match
      • Player - Player 2 (Blue) types a chat message containing /move as An exact match
    • Conditions
    • Actions
      • Set Group = (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))
      • Set Hero = (Random unit from Group)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero level of Hero) Greater than or equal to 2
        • Then - Actions
          • Set Point = (Center of (Playable map area))
          • Unit - Move Hero instantly to Point
          • Camera - Pan camera for (Triggering player) to Point over 0.00 seconds
          • Hero - Modify Strength of Hero: Add 50
          • Custom script: call RemoveLocation (udg_Point)
        • Else - Actions
      • Custom script: call DestroyGroup (udg_Group)
You need to store the hero inside a variable to prevent memory leaks and changing the target per action.
 
Level 4
Joined
Mar 7, 2024
Messages
47
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing /move as An exact match
      • Player - Player 2 (Blue) types a chat message containing /move as An exact match
    • Conditions
    • Actions
      • Set Group = (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))
      • Set Hero = (Random unit from Group)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero level of Hero) Greater than or equal to 2
        • Then - Actions
          • Set Point = (Center of (Playable map area))
          • Unit - Move Hero instantly to Point
          • Camera - Pan camera for (Triggering player) to Point over 0.00 seconds
          • Hero - Modify Strength of Hero: Add 50
          • Custom script: call RemoveLocation (udg_Point)
        • Else - Actions
      • Custom script: call DestroyGroup (udg_Group)
You need to store the hero inside a variable to prevent memory leaks and changing the target per action.
just what I needed, thanks for your help 😍
 
Level 4
Joined
Mar 7, 2024
Messages
47
Sorry to bother you, you can help me when the hero's bag is full and picking up more will move the next item in the Horse's bag.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
Please help me, Chat messages/move orders only apply to heroes, soldiers and horses in the team will not receive the above commands.
What Warseeker suggested is a nice start, but I don't think it does exactly what you wanted:

You can keep track of your heroes using array variables like this:
  • Store Preplaced Hero
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Store Player 1's hero: --------
      • Set VariableSet Player_Hero[1] = Paladin 0000 <gen>
      • -------- --------
      • -------- Note: Make sure that Player_Hero_Group's array Size is set to 28 in the Variable Editor! --------
      • Unit Group - Add Player_Hero[1] to Player_Hero_Group[1]
You can interact with specific heroes and groups of units like this:
  • Move Command
    • Events
      • Player - Player 1 (Red) types a chat message containing /move as An exact match
      • Player - Player 2 (Blue) types a chat message containing /move as An exact match
      • Player - Player 3 (Teal) types a chat message containing /move as An exact match
    • Conditions
      • (Hero level of Player_Hero[(Player number of (Triggering player))]) Greater than or equal to 2
    • Actions
      • Set VariableSet Temp_Point = (Position of Player_Hero[(Player number of (Triggering player))])
      • Camera - Pan camera for (Triggering player) to Temp_Point over 0.00 seconds
      • Custom script: call RemoveLocation( udg_Temp_Point )
      • -------- --------
      • Set VariableSet Temp_Point = (Center of MoveRegion <gen>)
      • Set VariableSet Temp_Group = (Units owned by (Triggering player).)
      • -------- --------
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet Temp_Unit = (Picked unit)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Temp_Unit is A Hero) Equal to True
                  • (Unit-type of Temp_Unit) Equal to Pack Horse
                  • (Temp_Unit is A peon-type unit) Equal to False
            • Then - Actions
              • Unit - Order Temp_Unit to Move To Temp_Point
            • Else - Actions
      • -------- --------
      • Custom script: call RemoveLocation( udg_Temp_Point )
      • Custom script: call DestroyGroup( udg_Temp_Group )
^ Modify the Conditions under the Or - Any (Conditions) are true to determine which class and type of unit get issued the order.

Sorry to bother you, you can help me when the hero's bag is full and picking up more will move the next item in the Horse's bag.
  • Pack Horse Transfer Item
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Target item of issued order) Not equal to No item
      • (Item carried by (Triggering unit) in slot 1) Not equal to No item
      • (Item carried by (Triggering unit) in slot 2) Not equal to No item
      • (Item carried by (Triggering unit) in slot 3) Not equal to No item
      • (Item carried by (Triggering unit) in slot 4) Not equal to No item
      • (Item carried by (Triggering unit) in slot 5) Not equal to No item
      • (Item carried by (Triggering unit) in slot 6) Not equal to No item
    • Actions
      • Set VariableSet Temp_Group = (Units owned by (Owner of (Triggering unit)).)
      • -------- --------
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet Temp_Unit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of Temp_Unit) Equal to Pack Horse
            • Then - Actions
              • Hero - Give (Target item of issued order) to Temp_Unit
            • Else - Actions
          • -------- --------
      • -------- --------
      • Custom script: call DestroyGroup( udg_Temp_Group )
^ You could change the Then - Actions to Order the Pack Horse to walk up to and pick-up the item instead:
  • Unit - Order Temp_Unit to Right-Click (Target item of issued order)
There's some other example triggers in the attached map. Requires latest patch to open.
 

Attachments

  • Alex Triggers 1.w3m
    22.3 KB · Views: 0
Last edited:
Level 4
Joined
Mar 7, 2024
Messages
47
What Warseeker suggested is a nice start, but I don't think it does exactly what you wanted:

You can keep track of your heroes using array variables like this:
  • Store Preplaced Hero
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Store Player 1's hero: --------
      • Set VariableSet Player_Hero[1] = Paladin 0000 <gen>
      • -------- --------
      • -------- Note: Make sure that Player_Hero_Group's array Size is set to 28 in the Variable Editor! --------
      • Unit Group - Add Player_Hero[1] to Player_Hero_Group[1]
You can interact with specific heroes and groups of units like this:
  • Move Command
    • Events
      • Player - Player 1 (Red) types a chat message containing /move as An exact match
      • Player - Player 2 (Blue) types a chat message containing /move as An exact match
      • Player - Player 3 (Teal) types a chat message containing /move as An exact match
    • Conditions
      • (Hero level of Player_Hero[(Player number of (Triggering player))]) Greater than or equal to 2
    • Actions
      • Set VariableSet Temp_Point = (Position of Player_Hero[(Player number of (Triggering player))])
      • Camera - Pan camera for (Triggering player) to Temp_Point over 0.00 seconds
      • Custom script: call RemoveLocation( udg_Temp_Point )
      • -------- --------
      • Set VariableSet Temp_Point = (Center of MoveRegion <gen>)
      • Set VariableSet Temp_Group = (Units owned by (Triggering player).)
      • -------- --------
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet Temp_Unit = (Picked unit)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Temp_Unit is A Hero) Equal to True
                  • (Unit-type of Temp_Unit) Equal to Pack Horse
                  • (Temp_Unit is A peon-type unit) Equal to False
            • Then - Actions
              • Unit - Order Temp_Unit to Move To Temp_Point
            • Else - Actions
      • -------- --------
      • Custom script: call RemoveLocation( udg_Temp_Point )
      • Custom script: call DestroyGroup( udg_Temp_Group )
^ Modify the Conditions under the Or - Any (Conditions) are true to determine which class and type of unit get issued the order.


  • Pack Horse Transfer Item
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Target item of issued order) Not equal to No item
      • (Item carried by (Triggering unit) in slot 1) Not equal to No item
      • (Item carried by (Triggering unit) in slot 2) Not equal to No item
      • (Item carried by (Triggering unit) in slot 3) Not equal to No item
      • (Item carried by (Triggering unit) in slot 4) Not equal to No item
      • (Item carried by (Triggering unit) in slot 5) Not equal to No item
      • (Item carried by (Triggering unit) in slot 6) Not equal to No item
    • Actions
      • Set VariableSet Temp_Group = (Units owned by (Owner of (Triggering unit)).)
      • -------- --------
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet Temp_Unit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of Temp_Unit) Equal to Pack Horse
            • Then - Actions
              • Hero - Give (Target item of issued order) to Temp_Unit
            • Else - Actions
          • -------- --------
      • -------- --------
      • Custom script: call DestroyGroup( udg_Temp_Group )
^ You could change the Then - Actions to Order the Pack Horse to walk up to and pick-up the item instead:
  • Unit - Order Temp_Unit to Right-Click (Target item of issued order)
There's some other example triggers in the attached map. Requires latest patch to open.
Nice to see you again, thank you for helping me. Thanks to you my map is better.
 
Level 4
Joined
Mar 7, 2024
Messages
47
Is there any way to rename the item Claws of Attack +12 to Claws of Attack +13 each upgrade and the next upgrade will be Claws of Attack +14,15,16,, please help me.
item+.PNG
 
Level 4
Joined
Mar 7, 2024
Messages
47
Why can't you rename it in the Object Editor? Won't you be creating a new item each time?

My map has a lot of weapons, cloaks, helmets, shields, staves. bow. clothes.., if each item is +1,2,3,4,5,6.. then there will be a lot of items. I want when upgrading all items to get +1, the next times will be +2,3,4,5,6...
item1.PNG
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
Alright, so you aren't going to create a new item then.

One method is to track the number of times the Item has been upgraded and use that to determine the new name.

Here's a useful system for tracking data on Items:
By using that system we can do something like this.

Store the different item names for the Claws of Attack in a String array variable. The [index] represents the number of times it's been upgraded:
  • Events
    • Time - Elapsed game-time is 0.00 seconds
  • Conditions
  • Actions
    • Set Variable Claws_Upgrade_Name[1] = Claws of Attack +13
    • Set Variable Claws_Upgrade_Name[2] = Claws of Attack +14
    • Set Variable Claws_Upgrade_Name[3] = Claws of Attack +15
When upgrading the Item, increase the number of times it's been upgraded by using an Integer array variable:
  • -------- Do this when upgrading the item --------
  • Set Variable Item = (The item you want to upgrade)
  • Set Variable Item_CV = (Custom value of Item)
  • Set Variable Item_Upgrades[Item_CV] = (Item_Upgrades[Item_CV] + 1)
  • Item - Set name of Item to Claws_Upgrade_Name[Item_Upgrades[Item_CV]]
We use the new Integer value as the [index] in the matching String array to update it's name.

So if Item_Upgrades is equal to 2 then that means the Item has been upgraded 2 times. That means it's name will be set to Claws_Upgrade_Name[2]. So it's name will be set to Claws of Attack +14.
 
Last edited:
Level 4
Joined
Mar 7, 2024
Messages
47
Thank you very much, I've been working all morning but this is beyond my ability ☺️
Alright, so you aren't going to create a new item then.

You'll have to track the number of times the Item has been upgraded and use that to determine the new name:

Here's a useful system for tracking data on Items:

By using that system we can do something like this:

Store the different item names for the Claws of Attack in a String array variable. The [index] represents the number of times it's been upgraded:
  • Events
    • Time - Elapsed game-time is 0.00 seconds
  • Conditions
  • Actions
    • Set Variable Claws_Upgrade_Name[1] = Claws of Attack +13
    • Set Variable Claws_Upgrade_Name[2] = Claws of Attack +14
    • Set Variable Claws_Upgrade_Name[3] = Claws of Attack +15
When upgrading the Item, increase the number of times it's been upgraded by using an Integer array variable:
  • -------- Do this when upgrading the item --------
  • Set Variable Item = (The item you want to upgrade)
  • Set Variable Item_CV = (Custom value of Item)
  • Set Variable Item_Upgrades[Item_CV] = (Item_Upgrades[Item_CV] + 1)
  • Item - Set name of Item to Claws_Upgrade_Name[Item_Upgrades[Item_CV]]
We use that new Integer value as the [index] in the matching String array to update it's name.

So if Item_Upgrades is equal to 2 then that means the Item has been upgraded 2 times. That means it's name will be set to Claws_Upgrade_Name[2]. So it's name will be set to Claws of Attack +14.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
I have a new idea, can you help me? Is there any way to subtract the last 3 letters when renaming items?
Substring is the name of the function.

Here's an example:
 
Last edited:
Level 4
Joined
Mar 7, 2024
Messages
47
It's really difficult, it took me several days but there is no way to solve this problem, please help me, like photo trigger editor, item points - remaining amount is armor, I want to finish Combine the items successfully and it will work. item points - the remaining points and it will turn into the hero's armor, it's so hard do you have any way? Please help me. When removing items and when using items, armor will be deducted unevenly.
1.PNG
2.PNG
3.PNG
 
Level 4
Joined
Mar 7, 2024
Messages
47
Hello, please help me. Is there any way to convert all points (item - charges remaining) into the hero's armor? For example, when wearing an armor with 50 charges remaining, it will be 50 armor, but when you take it off, it will be deducted evenly from the number of charges remaining. Or is there any other way that the total item charges remaining in 6 boxes will all be counted as armor? When you lose 1 point of remaining charges, 1 armor will be deducted.
 
Top