HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

What's more efficient: Constant or Variable Units?

10-04-2007, 12:57 AM#1
Viper5030
So a new question just came up while I was working on my map and I know most of you know alot more about leaking and efficiency, so I thought I'd ask:

If I have a map that focuses on mainly 8 heros, would I be best to refer to them as preset units or create them runtime and refer to them as variables?

I know that I would have to create a specific unit event for each unit as opposed to using only 1 general unit event and adding in a condition that checks to make sure it's the right unit, but I think it might still be more efficient to use presets. Am I right or wrong?
10-04-2007, 01:09 AM#2
Vexorian
When you preplace a unit, the editor is pretty much making an script that creates them at run time and then all the <gen> things are just variables themselves...
10-04-2007, 01:13 AM#3
Viper5030
Oh thanks. So then I wonder, why are some events only available for preset units, such as <specific unit> takes damage? Why can't we use that event for general unit variables?
10-04-2007, 01:19 AM#4
Blackroot
Preplaced units are set as global variables I do beileive. You can directly reference any global unit using thoes functions aswell, though.
10-04-2007, 02:52 AM#5
Vexorian
Quote:
Originally Posted by Viper5030
Oh thanks. So then I wonder, why are some events only available for preset units, such as <specific unit> takes damage? Why can't we use that event for general unit variables?
Because the events GUI uses are declared after the creation of the preplaced units.

You could use Add Event and a variable on it. After the variable is assigned an unit.
10-05-2007, 05:25 AM#6
Viper5030
Woa, that's cool. I didn't know that. Becuase of the fact that I use the GUI, I figured I was limited to having to preplace them to use in a "takes damage" event. Thanks alot for the help, Vexorian.

Yes, I'm a noob at this.