HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Editing unit stats with triggers?

01-23-2004, 11:40 PM#1
Moss
How would you edit a units stats via a trigger? And could you edit just a particular units stats?

I want to be able to do something like "Set Unit Stat (Sight Radius) = 0" for example to blind a unit as a custom spell.
01-23-2004, 11:47 PM#2
Eriond
It's not possible to modify the unit's vision by a trigger, you would have to devise some sort of workaround. I use the upgrade workaround... but if you're doing this a computer, you could set their aqusition range to 1, which will effectively blind them...
01-24-2004, 12:02 AM#3
Moss
Wow do people always respond in 7 minutes on here?!

Hmmm, thanks. So you are suggesting that a unit would be "upgraded" to a different unit that can't see? Cuz this would need to work for any unit that has the spell cast on it, so target aquisition wouldn't work either if it is done to a human controlled player.

This seems like a severely lacking thing if the WE can't handle it. What about using JASS or one of them uber-editors?
01-24-2004, 01:03 AM#4
DaKaN
There is no trigger like Eriond said. So its out of the question

And upgrades cannot be taken away, so thats out of the question if this reduced vision is temporary.

The only thing I can think of is look and see if there is an ability that modifies Sight Radius, if so, you can add an ability when the unit has a Buff, then when the buff goes away, remove that ability.
01-24-2004, 03:02 AM#5
Moss
OK there is an ability called "Item Sight Range Bonus". (Smart idea by the way DaKaN). But when I stick the ability on a custom unit it seems to have no effect. Does anybody know what this is actually used for in the official game?

Regardless, I imagine that it's "Data - Sight Range Bonus" attribute only increases sight range since you cannot enter a negative value. Could it be modified with those special import/export tools and some code editing?
01-24-2004, 03:11 AM#6
Quell
File > Preferences
Check "Allow negative values in the Object Editor.
01-24-2004, 03:12 AM#7
DaKaN
goto your editor preferences, there is a check box to allow negative real values. Check that then you can add a negative value
01-24-2004, 07:47 PM#8
Moss
That's awesome, but some things still won't go into negative values, that range bonus is one of them.emote_confused
01-24-2004, 09:15 PM#9
DaKaN
some things perhaps cannot be a negative value