Ardenian
A
Ardenian
Hello,
I worked the couple last days on a TD system as it is seen in Power Towers.
A 'simple' system that allows one to constantly add mana to targets.
However, although the system is not finished yet, I cannot get ride of a certain problem:
Only the first unit being a supplier supplies, every new supplier does not.
There is also another issue with suppliers ( the first supplier) not supplying mana to other suppliers.
My debug does not show any mistakes or issues.
I would appreciate if you could help me.
I worked the couple last days on a TD system as it is seen in Power Towers.
A 'simple' system that allows one to constantly add mana to targets.
However, although the system is not finished yet, I cannot get ride of a certain problem:
Only the first unit being a supplier supplies, every new supplier does not.
There is also another issue with suppliers ( the first supplier) not supplying mana to other suppliers.
My debug does not show any mistakes or issues.
I would appreciate if you could help me.
-
PS Configuration
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
Custom script: local integer i = 1
-
Set PS_GeneratorUnitType[1] = Small Generator
-
Set PS_GeneratorUnitType[2] = Big Generator
-
Set PS_ManaAmount[1] = 10.00
-
Set PS_ManaAmount[2] = 20.00
-
-------- --------
-
Set PS_Ability = Add Power Link
-
-------- --------
-
Hashtabelle - Create a hashtable
-
Set Hash_PowerSystem = (Last created hashtable)
-
-------- --------
-
Set PS_TempUnitType[0] = Small Generator
-
Custom script: set udg_TempInteger_1[0] = udg_PS_TempUnitType[0]
-
Hashtable - Save (Integer(PS_ManaAmount[PS_Index2])) as 0 of TempInteger_1[0] in (Last created hashtable)
-
Set PS_Index2 = (PS_Index2 + 1)
-
-------- --------
-
Set PS_TempUnitType[0] = Big Generator
-
Custom script: set udg_TempInteger_1[0] = udg_PS_TempUnitType[0]
-
Hashtable - Save (Integer(PS_ManaAmount[PS_Index2])) as 0 of TempInteger_1[0] in (Last created hashtable)
-
Set PS_Index2 = (PS_Index2 + 1)
-
-------- --------
-
Custom script: loop
-
Custom script: exitwhen udg_PS_GeneratorUnitType[i] == null
-
Custom script: set udg_TempInteger = udg_PS_GeneratorUnitType[i]
-
Hashtabelle - Save True as 0 of TempInteger in Hash_PowerSystem
-
Custom script: set i = i + 1
-
Custom script: endloop
-
-
-
Index Supplier
-
Events
-
Unit - A unit finishes construction
-
-
Condition
-
Actions
-
Set TempUnit = (Constructed structure)
-
Custom script: set udg_TempInteger = GetUnitTypeId(GetConstructedStructure())
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Condition
-
(Load 0 of TempInteger from Hash_PowerSystem) Equal True
-
-
'THEN'-Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
-
(TempUnit is in PS_GeneratorGroup) Equal False
-
-
'THEN'-Actions
-
Set PS_Index = (PS_Index + 1)
-
Set PS_Generator[PS_Index] = TempUnit
-
Unit Group - Add TempUnit to PS_GeneratorGroup
-
Set PS_Counter[PS_Index] = 0
-
Unit Group - Add TempUnit to PS_SupplyGroup[PS_Index]
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
-
PS_Index Equal 1
-
-
'THEN'-Actions
-
Trigger - Turn on Loop <gen>
-
-
'ELSE'-Actions
-
-
-
'ELSE'-Actions
-
-
-
'ELSE'-Actions
-
-
-
-
Add Remove Supplied Units
-
Events
-
Unit - A unit starts casting an ability
-
-
Conditions
-
(Ability being cast) Equal PS_Ability
-
-
Actions
-
Set TempUnit = (Target unit of ability being cast)
-
For each (Integer TempInteger2) from 1 to PS_Index, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
-
(Casting unit) Equal PS_Generator[TempInteger2]
-
-
'THEN'-Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
-
(TempUnit is in PS_SupplyGroup[TempInteger2]) Equal False
-
-
'THEN'-Aktionen
-
Unit Group - Add TempUnit to PS_SupplyGroup[TempInteger2]
-
-
'ELSE'-Actions
-
Unit Group - Remove TempUnit from PS_SupplyGroup[TempInteger2]
-
-
-
-
'ELSE'-Actions
-
-
-
-
-
-
Loop
-
Events
-
Time - Every 0.05 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer TempInteger2) from 1 to PS_Index, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
-
(PS_Generator[TempInteger2] is alive) Equal True
-
-
'THEN'-Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Copnditions
-
PS_Counter[TempInteger2] Equal 20
-
(PS_SupplyGroup[TempInteger2] is empty) Equal False
-
-
'THEN'-Actions
-
Set PS_TempUnitType[0] = (Unit-type of PS_Generator[TempInteger2])
-
Custom script: set udg_TempInteger_1[0] = udg_PS_TempUnitType[0]
-
Set TempInteger_1[1] = (Load 0 of TempInteger_1[0] from Hash_PowerSystem)
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in PS_SupplyGroup[TempInteger2] and do (Actions)
-
Loop - Actions
-
Set PS_TempUnitType[TempInteger2] = (Unit-type of PS_Generator[TempInteger2])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
-
(Unit-type of (Picked unit)) Not equal PS_TempUnitType[TempInteger2]
-
-
'THEN'-Actions
-
Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + (Real(TempInteger_1[1])))
-
Set PS_Counter[TempInteger2] = 0
-
-
'ELSE'-Actions
-
-
-
-
-
'ELSE'-Actions
-
Set PS_Counter[TempInteger2] = (PS_Counter[TempInteger2] + 1)
-
-
-
-
'ELSE'-Aktionen
-
Unit Group - Remove PS_Generator[TempInteger2] from PS_GeneratorGroup
-
Unit Group - Remove all units from PS_SupplyGroup[TempInteger2]
-
Set TempUnit = PS_Generator[TempInteger2]
-
Set PS_Generator[PS_Index] = TempUnit
-
Set PS_Counter[TempInteger2] = PS_Counter[PS_Index]
-
Set PS_Index = (PS_Index - 1)
-
Set TempInteger2 = (TempInteger2 - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
-
PS_Index Equal 0
-
-
'THEN'-Actions
-
Trigger - Turn off (This trigger)
-
-
'ELSE'-Actions
-
-
-
-
-
-
-
Last edited by a moderator: