HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Checking a Units Level

11-30-2003, 04:33 AM#1
WeirdMusician
Is there anyway inside of a trigger to find out a units level?
11-30-2003, 02:54 PM#2
Roland of Gilead
You can check a units level by useing the intiger compairasion. I belive it should look like this.
Code:
(Unit-Level of (triggering unit)) equal to Value
I might be off a little but it is under the intiger comparison in the conditions menu.
11-30-2003, 03:14 PM#3
Hessgasoline
You could always use this
Set Variable (What ever) = Hero Level of X Unit.
If the unit wasn't preplaced and your were doing an RPG kinda thing do something like
()
Player Selects Hero
Give Hero To Selecting Player or what ever
Set Variable ( Hero ( Array = Player Number of Selecting Player ) = Selected Unit
()
Then the top would be Set Variable ( What ever) = Hero Level of ( Hero (Array What ever player number hero you need ))
11-30-2003, 04:07 PM#4
KaTTaNa
If you mean the level of a creep (not heroes), then there is no way to do it. You could, of course, make it all manually which is a very dry solution if your map has many kinds of creeps.
11-30-2003, 09:25 PM#5
WeirdMusician
Well see I was wanting to give out gold based on there level but I guess I'll just use an array for the info I want.
11-30-2003, 09:34 PM#6
Vexorian
Make every unit have a point value equal of it's level, then use Unit - Pint value of unit to get the level
11-30-2003, 10:01 PM#7
WeirdMusician
Actually I have made a very usefull system with the point value of my units, I have several arrays with different info on my different unit types
so for easy access of my arrays, I set each unit with a different point level like this

skeleton point level = 1
archer point level = 2
knight point level =3
and so on

so anytime I have a certain thing I want to happen to a particular unit doing something I can use

whateverarray [point-value of triggering unit]

this is very nifty and is much easier than using a for loop with the 50+ units I will have in my map.