Custom values are a trigger action that defines around a maxium of 66 real variables. These variables can be any real number you want. Not impressed by this? Well put it this way. A projectile system can use these numbers on the projectiles ( as they are essentially units ) and carry around all the data they need. For instance, if you want it to do 65 dmg then, set custom value 0 of unit to 65. And now when the trigger finds a collision you can retrieve this value and use it as damage.
Still not impressed? Think numbers are just not enough?
Well, numbers can represent things as well, you know? They can be used with if/then/else with an appropiate real comparison condition, the actions can be made to represent an element, for instance. Say you wanted to deal fire damage to the unit, therefore you can do the proper damage to the type of unit, such as in pokemon when a fire type is weak against a water type, or if you just simply wanted to play the proper death animation (Aren't roasting zerglings neat?
To Conclude
Here's a video of a projectile system I made a few months back. It was the first time I've used custom values in sc2, as wc3 was limited to only 1 value field, so it's not perfect. You may download the map below, though, as I said before, nothing is perfect, and also the entire map is there. You may use anything in it, or the map it self for anything you want ( I apologize for no sound on the video).
It's good someone mentions this. So many could be benefited by knowing about custom values. So much cleaner than using an array for each unit to store numbers...
Yeah, that's what I was kinda thinking. I didn't feel a real need to go into detail since it's really a simple concept. And search didn't give me a tutorial for it. (checked before making it)
Epic Tut man, defiantly a under rated feature! For a look at how to convert a single custom value into hundreds of bit flag values check out this tutorial.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Introduction:
Custom values are a trigger action that defines around a maxium of 66 real variables. These variables can be any real number you want. Not impressed by this? Well put it this way. A projectile system can use these numbers on the projectiles ( as they are essentially units ) and carry around all the data they need. For instance, if you want it to do 65 dmg then, set custom value 0 of unit to 65. And now when the trigger finds a collision you can retrieve this value and use it as damage.
Still not impressed? Think numbers are just not enough?
Well, numbers can represent things as well, you know? They can be used with if/then/else with an appropiate real comparison condition, the actions can be made to represent an element, for instance. Say you wanted to deal fire damage to the unit, therefore you can do the proper damage to the type of unit, such as in pokemon when a fire type is weak against a water type, or if you just simply wanted to play the proper death animation (Aren't roasting zerglings neat?
To Conclude
Here's a video of a projectile system I made a few months back. It was the first time I've used custom values in sc2, as wc3 was limited to only 1 value field, so it's not perfect. You may download the map below, though, as I said before, nothing is perfect, and also the entire map is there. You may use anything in it, or the map it self for anything you want ( I apologize for no sound on the video).
@Skittles17: Go
It's good someone mentions this. So many could be benefited by knowing about custom values. So much cleaner than using an array for each unit to store numbers...
@OneTwoSC: Go
Yeah, that's what I was kinda thinking. I didn't feel a real need to go into detail since it's really a simple concept. And search didn't give me a tutorial for it. (checked before making it)
Epic Tut man, defiantly a under rated feature! For a look at how to convert a single custom value into hundreds of bit flag values check out this tutorial.