HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Heros and Experience

08-04-2004, 07:44 PM#1
Mink
Is there a way to add negative experience to a hero? I am pretty sure I have seen it before but when I try it, it is not working. What I want to do is subtract 10% of a hero's experience when they die. I tried "Hero - Set (Picked unit) experience to ((Hero experience of (Picked unit)) - ((Hero experience of (Picked unit)) / 10)), Hide level-up graphics" but that is not working.

Is there a way to make it work?
08-04-2004, 08:03 PM#2
wwsage
You can't use picked unit because that refers to pick every unit in unitgroup functions and so forth, you would have to use something else, maybe triggering unit would work I dunno.
08-04-2004, 08:11 PM#3
Mink
I did not post the whole trigger because I did not think it was needed. Here is the whole trigger then.

Code:
Unit Group - Pick every unit in (Units owned by Player 1 (Red) matching (((Picked unit) is A Hero) Equal to True)) and do (Actions)
    Loop - Actions
        Hero - Set (Picked unit) experience to ((Hero experience of (Picked unit)) - ((Hero experience of (Picked unit)) / 10)), Hide level-up graphics
08-04-2004, 08:25 PM#4
HexenLordX
Quote:
Originally Posted by Mink
I did not post the whole trigger because I did not think it was needed. Here is the whole trigger then.

Code:
Unit Group - Pick every unit in (Units owned by Player 1 (Red) matching (((Picked unit) is A Hero) Equal to True)) and do (Actions)
    Loop - Actions
        Hero - Set (Picked unit) experience to ((Hero experience of (Picked unit)) - ((Hero experience of (Picked unit)) / 10)), Hide level-up graphics

Pick every unit in (Units owned by Player 1 (Red) matching (((Picked unit) is A Hero) Equal to True))

It says matching Picked unit is A hero, but how would it know what unit is picked if it hasn't picked them yet?

Btw, I'm sure you already know, but you cannot decrease a hero's level by removing experience, you gotta actually use another trigger to remove levels.
08-04-2004, 08:32 PM#5
HexenLordX
Try this:

Code:
    Actions
        Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is A Hero) Equal to True
                    Then - Actions
                        Hero - Set (Picked unit) experience to (Hero experience of (Picked unit))/10, Hide level-up graphics
                    Else - Actions

That should work fine.
08-04-2004, 08:48 PM#6
Mink
I tried that, it is still not subtracting EXP
08-04-2004, 09:26 PM#7
Xinlitik
Try this:

Code:
Unit Group - Pick every unit in (Units owned by Player 1 (Red) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
    Loop - Actions
        Hero - Add ((Hero experience of Picked unit / -10) experience to Picked Unit, Hide level-up graphics

That should work.

Quote:
It says matching Picked unit is A hero, but how would it know what unit is picked if it hasn't picked them yet?

Yup. Matching unit refers to the unit that is going through the filter of conditions.