Uszi
New Member
- Reaction score
- 5
Hello all.
Interested in the ability system used in Azeroth Grand Prix map, that came out with an old patch of WC3.
If you're not familiar, in the map you drive a cart through a "Random Power Up" unit, which then gives your cart a random ability. You can hold up to 4, and the hotkeys are "a" or "s" or "d" or "f," each so each ability has 4 entities in the editor, etc.
Essentially, I'm reading through the triggers, and trying to figure them out. But I get stuck at some points. Take this example:
Err, These are what the variables are, for quick reference:
PowerUpUnitTypeNum = integer
PowerUpUnitTypes = unit-type array
PowerUpUnitTypeNum = integer
nIndex = integer
nIndexChance = integer
PowerUpTypes = ability array
Where am I confused?
Well, I don't get why we keep setting some of the integer values to one thing, and then reset them in the very next line, ie:
Interested in the ability system used in Azeroth Grand Prix map, that came out with an old patch of WC3.
If you're not familiar, in the map you drive a cart through a "Random Power Up" unit, which then gives your cart a random ability. You can hold up to 4, and the hotkeys are "a" or "s" or "d" or "f," each so each ability has 4 entities in the editor, etc.
Essentially, I'm reading through the triggers, and trying to figure them out. But I get stuck at some points. Take this example:
Code:
Actions
-------- Initialize Power Up Unit Types --------
Set PowerUpUnitTypeNum = 0
Set PowerUpUnitTypes[PowerUpUnitTypeNum] = Mushroom
Set PowerUpUnitTypeNum = (PowerUpUnitTypeNum + 1)
Set PowerUpUnitTypes[PowerUpUnitTypeNum] = Poison Smoke
Set PowerUpUnitTypeNum = (PowerUpUnitTypeNum + 1)
Set PowerUpUnitTypes[PowerUpUnitTypeNum] = Random Power Up
Set PowerUpUnitTypeNum = (PowerUpUnitTypeNum + 1)
-------- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --------
-------- Initialize Power Up Types --------
-------- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --------
Set nIndex = 0
Set nIndexChance = 0
Set PowerUpTypeNum = 0
-------- ------------------------------------------------------------- --------
Set PowerUpTypes[nIndex] = Repair Kit a
Set nIndex = (nIndex + 1)
Set PowerUpTypes[nIndex] = Repair Kit s
Set nIndex = (nIndex + 1)
Set PowerUpTypes[nIndex] = Repair Kit d
Set nIndex = (nIndex + 1)
Set PowerUpTypes[nIndex] = Repair Kit f
Set nIndex = (nIndex + 1)
Set PowerUpPickChance[nIndexChance] = 20
Set nIndexChance = (nIndexChance + 1)
Set PowerUpPickChance[nIndexChance] = 30
Set nIndexChance = (nIndexChance + 1)
Set PowerUpPickChance[nIndexChance] = 40
Set nIndexChance = (nIndexChance + 1)
Set PowerUpNames[PowerUpTypeNum] = |cff80ff80Repair Kit|r
Set PowerUpTypeNum = (PowerUpTypeNum + 1)
-------- ------------------------------------------------------------- --------
Set PowerUpTypes[nIndex] = Blaze a
Set nIndex = (nIndex + 1)
Set PowerUpTypes[nIndex] = Blaze s
Set nIndex = (nIndex + 1)
Set PowerUpTypes[nIndex] = Blaze d
Set nIndex = (nIndex + 1)
Set PowerUpTypes[nIndex] = Blaze f
Set nIndex = (nIndex + 1)
Set PowerUpPickChance[nIndexChance] = 50
Set nIndexChance = (nIndexChance + 1)
Set PowerUpPickChance[nIndexChance] = 30
Set nIndexChance = (nIndexChance + 1)
Set PowerUpPickChance[nIndexChance] = 0
Set nIndexChance = (nIndexChance + 1)
Set PowerUpNames[PowerUpTypeNum] = |cff80ff80Blaze|r
Set PowerUpTypeNum = (PowerUpTypeNum + 1)
-------- -------------------------------------------------------------
[...]
------------------------------------------------------------- --------
Custom script: call DestroyTrigger( GetTriggeringTrigger() )
Err, These are what the variables are, for quick reference:
PowerUpUnitTypeNum = integer
PowerUpUnitTypes = unit-type array
PowerUpUnitTypeNum = integer
nIndex = integer
nIndexChance = integer
PowerUpTypes = ability array
Where am I confused?
Well, I don't get why we keep setting some of the integer values to one thing, and then reset them in the very next line, ie:
Code:
Set PowerUpPickChance[nIndexChance] = 50
Set nIndexChance = (nIndexChance + 1)
Set PowerUpPickChance[nIndexChance] = 30
Set nIndexChance = (nIndexChance + 1)
Set PowerUpPickChance[nIndexChance] = 0
Set nIndexChance = (nIndexChance + 1)