Hello.
My map has a multiboard and 19 heroes total, so far. Each hero has three tiers:
T1 = lv 1 to 10
T2 = lv 10 to 20
T3 = lv 20 to 30
Counting each tier, there's 57 heroes.
Now, i'm trying to do that for each tier, the hero's scorescreen icon on the multiboard is changed. If there's something i've learned from my map editing so far, is that variables makes EVERYTHING easier, so what i got on the map, is a "Set Variables" trigger that sets hero name, description, scorescreen icon, etc.
This is the set variables trigger, i edited it and filtered only the information i use on the trigger that switches the hero's icon on the Multiboard.
The bold part of the text, is what isn't working. I mean, the icons itself are working, what's not working is this next code.
This is the code that makes the hero switch and changes it's icon on the scorescreen. I excluded the T2 evolve part cuz it won't matter for now.
Everything on this trigger works, except the icon switch, that is below the "---- Team 1 ----" comment. Since the variable was correctly set on the "Set Variable" trigger, i figure the problem was on the "Integer A", so i used the text display function to display the integer that was returning from the "Integer A" and it returned 20 instead of 1.
Why isn't it returning 1? Why did it change from a few lines of code from 1 to 20? Why is it that if i change the variable "Heroes_Number_of_Heroes" from 19 to 20 (for example) on the "Set Variables" trigger, the number returned is 21 (always the variable +1)?
Since the hero is replaced correctly, that means the "Integer A" is 1 at least until this line:
Thanks in advance.
My map has a multiboard and 19 heroes total, so far. Each hero has three tiers:
T1 = lv 1 to 10
T2 = lv 10 to 20
T3 = lv 20 to 30
Counting each tier, there's 57 heroes.
Now, i'm trying to do that for each tier, the hero's scorescreen icon on the multiboard is changed. If there's something i've learned from my map editing so far, is that variables makes EVERYTHING easier, so what i got on the map, is a "Set Variables" trigger that sets hero name, description, scorescreen icon, etc.
This is the set variables trigger, i edited it and filtered only the information i use on the trigger that switches the hero's icon on the Multiboard.
Code:
Set Variables
Events
Conditions
Actions
[B]Set Heroes_Number_of_Heroes = 19
-------- Hero - Night Stalker --------
Set Hero_Temp_ID = 1
Set Hero_Name[Hero_Temp_ID] = Night Stalker
Set Board_Hero_Icon_T1[Hero_Temp_ID] = ReplaceableTextures\CommandButtons\BTNArcher.blp
Set Board_Hero_Icon_T2[Hero_Temp_ID] = ReplaceableTextures\CommandButtons\BTNSylvanusWindrunner.blp
Set Board_Hero_Icon_T3[Hero_Temp_ID] = UI\Glues\ScoreScreen\scorescreen-hero-priestessofthemoon.blp[/B]
Set Hero_Region_Pick[Hero_Temp_ID] = Hero Night Stalker <gen>
Set Hero_T1[Hero_Temp_ID] = Night Stalker T1
Set Hero_T2[Hero_Temp_ID] = Night Stalker T2
Set Hero_T3[Hero_Temp_ID] = Night Stalker T3
Set Hero_CircleOfPower[Hero_Temp_ID] = Select Hero 0058 <gen>
Set Hero_Attack_Type[Hero_Temp_ID] = Ranged
Set Hero_Primary_Atribute[Hero_Temp_ID] = Agility
Set Hero_Abilities[Hero_Temp_ID] = Arrow Barrage, Poison|n Arrow,Marksman Presence
Set Hero_Description[Hero_Temp_ID] = (|cff32cd32 + (Hero_Name[Hero_Temp_ID] + (|r|n|n + (|cffff0000 + (Attack Type: + (|r + (Hero_Attack_Type[Hero_Temp_ID] + (|n + (|cffff0000 + (Primary Attribute: + (|r + (Hero_Primary_Atribute[Hero_Temp_ID] + (|n + (|cffff0000 + (Abilities: + (|r + Hero_Abi
-------- Hero - Warglaive Bearer --------
...
...
Trigger - Turn off (This trigger)
This is the code that makes the hero switch and changes it's icon on the scorescreen. I excluded the T2 evolve part cuz it won't matter for now.
Code:
Hero Evolve
Events
Unit - A unit Gains a level
Conditions
Or - Any (Conditions) are true
Conditions
(Hero level of (Triggering unit)) Equal to 10
(Hero level of (Triggering unit)) Equal to 20
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Triggering unit)) Equal to 10
Then - Actions
For each (Integer A) from 1 to Heroes_Number_of_Heroes, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Triggering unit)) Equal to Hero_T1[(Integer A)]
Then - Actions
Unit - Pause (Triggering unit)
Unit - Replace (Triggering unit) with a Hero_T2[(Integer A)] using The old unit's relative life and mana
Special Effect - Create a special effect attached to the overhead of (Last replaced unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
Selection - Add (Last replaced unit) to selection for (Owner of (Triggering unit))
Special Effect - Create a special effect attached to the overhead of (Last replaced unit) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
Game - Display to (All players) the text: ((|cffff0000 + ((Name of (Owner of (Last replaced unit))) + |r )) + (has evolved into + (|cff32cd32 + ((Name of (Last replaced unit)) + |r))))
-------- Team 1 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Owner of (Triggering unit)) Equal to Player 1 (Red)
(Owner of (Triggering unit)) Equal to Player 2 (Blue)
(Owner of (Triggering unit)) Equal to Player 3 (Teal)
Then - Actions
Multiboard - Set the icon for (Last created multiboard) item in column 1, row ((Player number of (Owner of (Triggering unit))) + 1) to Board_Hero_Icon_T2[(Integer A)]
[B]Game - Display to (All players) the text: (String((Integer A)))[/B]
Else - Actions
Why isn't it returning 1? Why did it change from a few lines of code from 1 to 20? Why is it that if i change the variable "Heroes_Number_of_Heroes" from 19 to 20 (for example) on the "Set Variables" trigger, the number returned is 21 (always the variable +1)?
Since the hero is replaced correctly, that means the "Integer A" is 1 at least until this line:
Code:
Unit - Replace (Triggering unit) with a Hero_T2[(Integer A)] using The old unit's relative life and mana
Thanks in advance.