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!
There is a field in Object Editor that units have called "Stats-Race". How to get value from this field. Is this Real, Integer, String? Can't find it. Or is it just an Editor field?
There are a few properties that can't be accessed with these functions and the race seems to be one of them, I think you'll need some workaround in order to detect that
Well, generally I want to add a special trait to the unit, depending on their race, so I thought it would be easy because we have the field "Stats-Race". But if these are the circumstances, I’ll do it differently.
If you're not using it for anything else, you could use the Point Value stat and say e.g. 1 = human, 2 = orc etc., and point value is something you can get with an integer comparison, so that's useful
Actually there's a Race comparison in Condition section with 5 races. I tested it out and believe the following trigger may help you to detect:
Race
Events
Player - Player 1 (Red) Selects a unit
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Race of (Triggering unit)) Equal to Human
Then - Actions
Game - Display to (All players) the text: Human
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Race of (Triggering unit)) Equal to Orc
Then - Actions
Game - Display to (All players) the text: Orc
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Race of (Triggering unit)) Equal to Undead
Then - Actions
Game - Display to (All players) the text: Undead
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Race of (Triggering unit)) Equal to Night Elf
Then - Actions
Game - Display to (All players) the text: Night Elf
Else - Actions
Game - Display to (All players) the text: Demon
Note that Neutral units such as Chicken, Firelord, Lady Vashj is classified as Demon. This also corresponds if you customize their race in the Object Editor.
Actually there's a Race comparison in Condition section with 5 races. I tested it out and believe the following trigger may help you to detect:
Race
Events
Player - Player 1 (Red) Selects a unit
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Race of (Triggering unit)) Equal to Human
Then - Actions
Game - Display to (All players) the text: Human
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Race of (Triggering unit)) Equal to Orc
Then - Actions
Game - Display to (All players) the text: Orc
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Race of (Triggering unit)) Equal to Undead
Then - Actions
Game - Display to (All players) the text: Undead
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Race of (Triggering unit)) Equal to Night Elf
Then - Actions
Game - Display to (All players) the text: Night Elf
Else - Actions
Game - Display to (All players) the text: Demon
Note that Neutral units such as Chicken, Firelord, Lady Vashj is classified as Demon. This also corresponds if you customize their race in the Object Editor.
If you're not using it for anything else, you could use the Point Value stat and say e.g. 1 = human, 2 = orc etc., and point value is something you can get with an integer comparison, so that's useful
I believe it's used for the scorescreen? But it's quite irrelevant and it's a convenient way to assign a value to an unit type that you can retrieve to do other stuff later
Edit: unlike custom value, I think we don't have a function "set point value" (at least in GUI), so that's a limiting factor
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.