• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

give costum value to units all around the map

Status
Not open for further replies.
Hellow friends ^.^ I would like to give a different value to any unit on the map.
I used this but it gives the same value to all units:
  • gives value
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set unitgroupsystem = (Units in (Playable map area))
      • Unit Group - Pick every unit in unitgroupsystem and do (Actions)
        • Loop - Actions
          • For each (Integer A) from 1 to (Number of units in unitgroupsystem), do (Actions)
            • Loop - Actions
              • Unit - Set the custom value of (Picked unit) to (Integer A)
      • Custom script: call DestroyGroup (udg_unitgroupsystem)
      • Trigger - Remove (This trigger) from the trigger queue
There are 12 units and i want unit 1 to be value 1 and unit 2 to be 2.
The current trigger above give all units value 12.
"units on the map" has 1000 slots [1000]
 
Level 4
Joined
Jul 18, 2009
Messages
85
If your look at your trigger you have it so it gives every picked unit the value of integer A which is 12.

I'm not sure if this will work for you but,
  • Event
  • Map Initialization
  • Actions
  • Set unitgroupsystem = (Units in (Playable map area))
  • Unit Group - Pick every unit in (units in (unitgroupsystem), and do (Actions)
  • Loop - Actions
  • For Each (Integer A) from 1 to (Number of unit sin unitgroupsystem, do (Actions)
  • Loop - Actions
  • Unit - Set the custom value of (Picked unit) to (0 + (Player number of (Owner of (Picked unit))))
  • Custom script: call DestroyGroup (udg_unitgroupsystem)
  • Trigger - Remove (This trigger) from the trigger queue
So basically if one unit belongs to red he will be 0 + 1. or 1
If blue 0 + 2. or 2
and so on. If you want a number 12 however that must mean that you have players 1-12 and each one has one of these units. I have no clue what your map is about/who controls units etc so if this wont work for you please explain the circumstances of your units.
 
So basically if one unit belongs to red he will be 0 + 1. or 1
If blue 0 + 2. or 2
and so on. If you want a number 12 however that must mean that you have players 1-12 and each one has one of these units. I have no clue what your map is about/who controls units etc so if this wont work for you please explain the circumstances of your units.

this unit number was random number that was in my map, i want it to work for 100 units,
so when I input the string -show 1 it will show the name of unit 1 of that 100 and -show 2 will show another name of unit that in the group.
 
Level 4
Joined
Jul 18, 2009
Messages
85
  • Events
  • Unit - A Enters Region (playable map area)
  • Actions
  • Unit - Set the custom value of (Triggering unit) to (0 + (Number of units in unitgroupsystem))
Would that work for you?
 
Status
Not open for further replies.
Top