Was just playing the map with a friend and it fired more then once on for both of us on different levels.
It's only happened one time so far and on one level. I was level ten when it fired twice. I don't know what level he was on.
This is the whole trigger:
LevelsEventsUnit-AnyUnitgainsanexperiencelevelLocalVariablesx=0<Integer>Conditions((Triggeringplayer)isinPlayers)==TrueHeroSwitching[(Triggeringplayer)] == False
Actions
Unit - Set (Triggering unit) Life (Percent) to 100.0
Unit - Set (Triggering unit) Energy (Percent) to 100.0
Bank - Open bank "DemonDelusionHeroes" for player (Triggering player)
General - For each integer x from 0 to 4 with increment 1, do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Unit type of (Triggering unit)) == Hero Type[x]
Then
Variable - Set Heroes[(Triggeringplayer)][x] = (Triggering unit)
Bank - Store unit Heroes[(Triggeringplayer)][x] as ("hero-" + (String(x))) of section "hero" in bank (Last opened bank)
Else
Bank - Save bank (Last opened bank)
General - If (Conditions) then do (Actions) else do (Actions)
If
((Experience level of (Triggering unit)) mod 3) == 0
Then
UI - Display "+1 Ability Point" for (Player group((Triggering player))) to Subtitle area
Bank - Open bank "DemonDelusionHeroes" for player (Triggering player)
General - If (Conditions) then do (Actions) else do (Actions)
If
(Unit type of (Triggering unit)) == Hero - Broodling
Then
Variable - Set Ability Total[(Triggeringplayer)][0] = (Ability Total[(Triggeringplayer)][0] + 1)
Bank - Store integer Ability Total[(Triggeringplayer)][0] as ("total-" + (String(0))) of section "ability" in bank (Last opened bank)
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
(Unit type of (Triggering unit)) == Hero - <cval="0098E1">Zergling</c>
Then
Variable - Set Ability Total[(Triggeringplayer)][1] = (Ability Total[(Triggeringplayer)][1] + 1)
Bank - Store integer Ability Total[(Triggeringplayer)][1] as ("total-" + (String(1))) of section "ability" in bank (Last opened bank)
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
(Unit type of (Triggering unit)) == Hero - <cval="FF4040">Roach</c>
Then
Variable - Set Ability Total[(Triggeringplayer)][2] = (Ability Total[(Triggeringplayer)][2] + 1)
Bank - Store integer Ability Total[(Triggeringplayer)][2] as ("total-" + (String(2))) of section "ability" in bank (Last opened bank)
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
(Unit type of (Triggering unit)) == Hero - <cval="0098E1">Hydralisk</c>
Then
Variable - Set Ability Total[(Triggeringplayer)][3] = (Ability Total[(Triggeringplayer)][3] + 1)
Bank - Store integer Ability Total[(Triggeringplayer)][3] as ("total-" + (String(3))) of section "ability" in bank (Last opened bank)
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
(Unit type of (Triggering unit)) == Hero - <cval="EA4BFC">Infestor</c>
Then
Variable - Set Ability Total[(Triggeringplayer)][4] = (Ability Total[(Triggeringplayer)][4] + 1)
Bank - Store integer Ability Total[(Triggeringplayer)][4] as ("total-" + (String(4))) of section "ability" in bank (Last opened bank)
Else
Catalog - Set value of Abilities "HeroSpells" "Points[0]" for player (Triggering player) to (String(((Value of Abilities "HeroSpells" "Points[0]" for player (Triggering player) as an integer) + 1)))
Bank - Save bank (Last opened bank)
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
((Experience level of (Triggering unit)) mod 5) == 0
Then
UI - Display "+1 Mutation Point" for (Player group((Triggering player))) to Subtitle area
Bank - Open bank "DemonDelusionHeroes" for player (Triggering player)
Variable - Set Mutations - Total[(Triggeringplayer)] = (Mutations - Total[(Triggeringplayer)] + 1)
Bank - Store integer Mutations - Total[(Triggeringplayer)] as "total" of section "mutations" in bank (Last opened bank)
Bank - Save bank (Last opened bank)
Catalog - Set value of Abilities "Mutations" "Points[0]" for player (Triggering player) to (String(((Value of Abilities "Mutations" "Points[0]" for player (Triggering player) as an integer) + 1)))
Else
------- Comment
Ya this just did it again. I've noticed it when I was level ten. It's given me 2 points at separate times like mid level ten
Also at level 12 just awarded two ability points. One for turning level 12 and another almost at level 13...
Update:
Another problem I see with this trigger is if a unit goes from lets say level 1 to level 3 in one experience gain. It will fire the trigger for each said level (2 times) and reward 2 points because the trigger fires twice and you we're level 3 which was a modulo of 3.
Use standard debugging procedures. Place a Display Text Message before the +1 Mutation Points to differentiate between the two. Then you'd know if one of them ran twice, or if they both ran. I'm guessing the former since it would only make sense that they both run at level 30.
ExpRemovalSystem2EventsUnit-AnyUnitgainsexperienceLocalVariablesx=0<Integer>Conditions((Triggeringplayer)isinPlayers)==TrueDyingUnit[(Ownerof(Triggeringunit))] != No Unit
Actions
Variable - Set Dying Unit[(Ownerof(Triggeringunit))] = No Unit
Unit Group - Pick each unit in (Any units in (Region(Dying Location[(Triggeringplayer)], 7.0)) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
((Owner of (Picked unit)) is in Players) == True
Then
Unit - Set (Picked unit) Experience to (((Picked unit) Experience (Current)) - (Triggering experience gained))
Else
Lets say you kill a unit and the unit gives you 50 xp and it pushes u into lv 10 from 9, but your 5+ levels higher then the target. It will bring up up a level, then drop you back down.
So you gain a free point. I think this is the problem.
Add a Turn (Levels) Off trigger before Unit - Set (Picked unit) Experience to (((Picked unit) Experience (Current)) - (Triggering experience gained)) in Exp Removal System 2 and add a Turn (Levels) On after it should do the trick.
Its a feature and actually quite helpfull. Just use a if statement and another variable to sort out the ones you dont want.
It has one disadvantage though - if your unit is level 1 and gets enough xp to reach level 9, the trigger fires 8 times telling you you reached level 9...
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
How do I say:
If hero level is divisible by 3, then fire, if not, do nothing?
Brain not working
So every 3 levels fire the trigger.
@Zero0018: Go
Modulo function. If Mod number, 3 = 0
Mod returns remainders.
THank you. Man couldn't wrap my head around that one.
Exactly. Should work for what you need man.
@Stealthsam: Go
Why would this fire more than once?
Was just playing the map with a friend and it fired more then once on for both of us on different levels.
It's only happened one time so far and on one level. I was level ten when it fired twice. I don't know what level he was on.
This is the whole trigger:
hmm im doing something similar in one of my maps:
it works fine.. I can't see anything wrong with yours...
If that's the only function doing that and it's not being ran by another function, I don't see why it would run twice, or error.
@Stealthsam: Go
Ya that's the only trigger I have with that event. I don't know why it would fire multiple times either.
Ya this just did it again. I've noticed it when I was level ten. It's given me 2 points at separate times like mid level ten
Also at level 12 just awarded two ability points. One for turning level 12 and another almost at level 13...
Update:
Another problem I see with this trigger is if a unit goes from lets say level 1 to level 3 in one experience gain. It will fire the trigger for each said level (2 times) and reward 2 points because the trigger fires twice and you we're level 3 which was a modulo of 3.
How to fix this and other issue?
Bump. I need a solution to this. It's quite annoying.
Use standard debugging procedures. Place a Display Text Message before the +1 Mutation Points to differentiate between the two. Then you'd know if one of them ran twice, or if they both ran. I'm guessing the former since it would only make sense that they both run at level 30.
@xKenneth: Go
I've already done this and I think I've found the problem.
Ok so I have an exp removal system that it removes XP form the unit if the unit is 5+ levels higher then the killing unit.
These are the two triggers:
Lets say you kill a unit and the unit gives you 50 xp and it pushes u into lv 10 from 9, but your 5+ levels higher then the target. It will bring up up a level, then drop you back down.
So you gain a free point. I think this is the problem.
How would I fix this :?
Add a Turn (Levels) Off trigger before Unit - Set (Picked unit) Experience to (((Picked unit) Experience (Current)) - (Triggering experience gained)) in Exp Removal System 2 and add a Turn (Levels) On after it should do the trick.
@xKenneth: Go
But it's a six player map. Wouldn't that turn off exp gain for the other players?
Actually ignore my previous post. I had the wrong idea. Turning it off and then turning it back on wouldn't solve it. D:
This is a stretch, but try this. In your Level Up trigger, at the beginning of it, add this condition:
Triggering Unit is in (Region(Dying Location[(Triggering player), 1.0 == False
@xKenneth: Go
I'm just going say f'it to the behavior exp system and just add the exp manually threw the triggers and do it the old fashion way.
Bam
edit: forget it
Its a feature and actually quite helpfull. Just use a if statement and another variable to sort out the ones you dont want. It has one disadvantage though - if your unit is level 1 and gets enough xp to reach level 9, the trigger fires 8 times telling you you reached level 9...