[Trigger] Every unit has 0 custom value?

Status
Not open for further replies.
Level 16
Joined
Mar 25, 2016
Messages
1,327
Custom value is always 0, unless you change it.

Custom values can be used in triggers to store one integer per unit. They are often used for unit indexers, so you should generally avoid using them for something else. If you know that you will never use a custom value based unit indexer, you can of course do with it what you want.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Hello there

So I've been wondering why my triggers don't work. Then I checked my triggering units' custom value using the Display Text trigger. Surprise surprise, they all have 0 custom value. All of them. I was thinking that maybe it's because of them being pre-placed in the editor.
Help would be appreciated :)

I'm sorry, this got me confused, you are saying that your triggers do not work because custom value is 0 ?
Erm... mind showing the triggers or we can take guesses ?

My answer is "Yes"
regards
-Ned
 
Custom value is always 0, unless you change it.

Custom values can be used in triggers to store one integer per unit. They are often used for unit indexers, so you should generally avoid using them for something else. If you know that you will never use a custom value based unit indexer, you can of course do with it what you want.

That's what I'm doing. I'm using custom values to make boolean indexes. I've worked with custom values to make indexes for so long, I've never come up with a problem except this one (heck, I never even knew that custom values are by default 0).
I don't know why this one doesn't work to be honest.

I'm sorry, this got me confused, you are saying that your triggers do not work because custom value is 0 ?
Erm... mind showing the triggers or we can take guesses ?

Take a wild guess ayy lmao
My triggers don't work because they depend on indexes, else all the triggers will happen on the first unit to trigger it.
 
Level 11
Joined
Jun 2, 2004
Messages
849
Yeah, sounds like you're used to a unit indexer being installed and working in your maps. That's not the default wc3 behavior.

Look into whatever unit indexer you're using (many systems come with them, like damage engine/etc) and see if you can force it to give your preplaced units indexes.
 
Status
Not open for further replies.
Top