Hello all,
I'm starting to pick up WC3 map editing, so go easy on me.
I reviewed most "how-to" guides out there related to variables, but I'm still confused with the assignments & comparisons. I am trying to achieve this......
IF
Completed Structure = PREDEFINED STRUCTURE
THEN
DO ACTION
Here's what my code looks like
I tried two approaches with defining the UNIT_1 and UNIT_2 by using pre-placed units on map and using unit groups, but neither gave me the result I desired in the code below;
If I used unit groups, unit comparisons sometimes work and sometimes doesn't.
If I used the pre-placed units, it must remain in the map or it stops working. (leak)
so this way I can confirm that the specific building gets specific abilities based on its type. Any pointers would be greatly appreciated!
-Luf
I'm starting to pick up WC3 map editing, so go easy on me.
I reviewed most "how-to" guides out there related to variables, but I'm still confused with the assignments & comparisons. I am trying to achieve this......
IF
Completed Structure = PREDEFINED STRUCTURE
THEN
DO ACTION
Here's what my code looks like
Code:
Define UNIT
Events
Map initialization
Conditions
NONE
Actions
Set VariableSet UNIT_1 = ???
Set VariableSet UNIT_2 = ???
I tried two approaches with defining the UNIT_1 and UNIT_2 by using pre-placed units on map and using unit groups, but neither gave me the result I desired in the code below;
Code:
Resistance Engine
Events
Unit - A unit Finishes construction
Conditions
NONE
Actions
Set VariableSet FocalBLDG = (Constructed structure)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
FocalBLDG Equal to UNIT_1
Then - Actions
Trigger - Run A_COMP <gen> (checking conditions)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
FocalBLDG Equal to UNIT_2
Then - Actions
Trigger - Run B_COMP <gen> (checking conditions)
Else - Actions
ETC
If I used unit groups, unit comparisons sometimes work and sometimes doesn't.
If I used the pre-placed units, it must remain in the map or it stops working. (leak)
so this way I can confirm that the specific building gets specific abilities based on its type. Any pointers would be greatly appreciated!
-Luf