HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Very strange bug

09-05-2008, 11:37 AM#1
Flame_Phoenix
Guys, I am making my map, and I use GetUnitTypeId(u) to know the id of a unit. Problem is that in this line
Collapse JASS:
if (GetUnitTypeId(u) == ARCHER_ID) and countArchers then

knowing that countArchers is tru, and ARCHER_ID is the Id of the archers and it is correct "earc", the computer tells me that the unit type is false. I don't understand, the integer is well set, I checked twice.

Collapse JASS:
 private constant integer ARCHER_ID = 'earc'

However if I change that globals to:
Collapse JASS:
 private constant integer ARCHER_ID = 1700884333
than the computer accepts the unit type archer as true.

This is weird, can some one explain me why this happens ?
09-05-2008, 11:49 AM#2
Alexander244
'earc' == 1700885091 (Archer)
'eaom' == 1700884333 (Ancient of War)

So, is u actually an AoW?
09-05-2008, 12:13 PM#3
Flame_Phoenix
This is stupid, I can't train a building !
The trigger is fired when I finish training a unit ... why does it fire only if I use AoW !?
09-05-2008, 12:28 PM#4
Vexorian
you are using the wrong event response...
09-05-2008, 09:45 PM#5
Flame_Phoenix
Quote:
you are using the wrong event response...
What do you mean ?
What should I use to know when I finish training a unit ? Afaik UNIT_EVENT_TRAIN_FINISH (or something like this) is the only one I know =S
09-05-2008, 10:41 PM#6
TEC_Ghost
There's two different units involved with training.

Collapse JASS:
GetSoldUnit() //The unit you're training.
GetSellingUnit() //The building you're training from.

You want the first one.
09-05-2008, 11:33 PM#7
Vexorian
Quote:
Originally Posted by Flame_Phoenix
What do you mean ?
What should I use to know when I finish training a unit ? Afaik UNIT_EVENT_TRAIN_FINISH (or something like this) is the only one I know =S
I said event response, not event.
09-06-2008, 09:58 AM#8
Flame_Phoenix
Mmm, you mean

Quote:
There's two different units involved with training.


Collapse JASS:
GetTrainedUnit() //The unit you're training.
GetTriggerUnit() //The building you're training from.

You want the first one.

D'Oh ... Silly me, and me thinking I had found a great bug xD

Sorry for this silly question guys, +rep to you all
EDIT
Crap, sorry Vexorian and Alex I can't ive you guys +rep because I have to spread it first =S