- Joined
- Jun 24, 2004
- Messages
- 42
I'm not 100% sure how I will explain this, so I'll do my best. Long Story short, I NEED HELP!
Before I try to explain, let me point out that I would prefer any help I get in GUI, as I'm not very good with JASS (I can read it very well, but as for creating triggers using it, it takes me a while).
Basically I want to create a unit creation system for my map to decrease the number of triggers I have (~350) and make adding new units to the map much much easier on me.
In my current system, you take 2 units to a circle of power and they are 'fused' together to become a stronger unit. Right now I have to create a new trigger every time I want to add new units to the map. I was hoping to maybe set a variable to every single unit in the map during initialization and then just using simple integer conditions to determine which units are in the circle and which units to create.
This is something like what I currently use:
What I want to do is shrink all of these down to a SINGLE trigger using variables. I do know how I can create the unit, but I don't know how to do the integer checks to tell if the two units in the fusion circle are able to fuse, and then fuse them.
Example of what I want to do:
Then I want to create a single trigger for the fusions that checks which 2 units entered the fusion circle and if they are able to fuse together, and then fuse them into the appropriate unit.
I realize I'll probably need more variables, like a variable that is set equal to the unit-type of which unit a certain unit fuses to, such as:
Before I try to explain, let me point out that I would prefer any help I get in GUI, as I'm not very good with JASS (I can read it very well, but as for creating triggers using it, it takes me a while).
Basically I want to create a unit creation system for my map to decrease the number of triggers I have (~350) and make adding new units to the map much much easier on me.
In my current system, you take 2 units to a circle of power and they are 'fused' together to become a stronger unit. Right now I have to create a new trigger every time I want to add new units to the map. I was hoping to maybe set a variable to every single unit in the map during initialization and then just using simple integer conditions to determine which units are in the circle and which units to create.
This is something like what I currently use:
-
Fuse Wolf to Captain
-
Events
- Unit - A unit enters Fusion Circle <gen>
-
Conditions
- (Level of (Entering unit)) Equal to 3
-
Actions
- If ((Number of units in (Units in Fusion Circle <gen>(((Owner of (Matching unit)) Equal to (Owner of (Triggering unit))) and ((Unit-type of (Matching unit)) Equal to |c0000FF00Wolf|r)))) Equal to 0) then do (Skip remaining actions) else do (Do nothing)
- If ((Number of units in (Units in Fusion Circle <gen>(((Owner of (Matching unit)) Equal to (Owner of (Triggering unit))) and ((Unit-type of (Matching unit)) Equal to |c0000FF00Captain|r)))) Equal to 0) then do (Skip remaining actions) else do (Do nothing)
- Unit - Create 1 |c0000FF00Armor Horse|r for (Owner of (Triggering unit)) at (Center of Fused Unit Appear <gen>) facing Default building facing (270.0) degrees
- Unit Group - Pick every unit in (Random 1 units from (Units in Fusion Circle <gen>(((Unit-type of (Matching unit)) Equal to |c0000FF00Wolf|r) and ((Owner of (Matching unit)) Equal to (Owner of (Triggering unit)))))) and do (Unit - Remove (Picked unit) from the game)
- Unit Group - Destroy unit group (Last created unit group)
- Unit Group - Pick every unit in (Random 1 units from (Units in Fusion Circle <gen>(((Unit-type of (Matching unit)) Equal to |c0000FF00Captain|r) and ((Owner of (Matching unit)) Equal to (Owner of (Triggering unit)))))) and do (Unit - Remove (Picked unit) from the game)
- Unit Group - Destroy unit group (Last created unit group)
-
Events
What I want to do is shrink all of these down to a SINGLE trigger using variables. I do know how I can create the unit, but I don't know how to do the integer checks to tell if the two units in the fusion circle are able to fuse, and then fuse them.
Example of what I want to do:
-
Init Variables
-
Events
- Map initialization
- Conditions
-
Actions
- Set Level3Unit[1] = Wolf
- Set Level3Unit[2] = Captain
- Set Level4Unit[1] = Armor Horse
-
Events
Then I want to create a single trigger for the fusions that checks which 2 units entered the fusion circle and if they are able to fuse together, and then fuse them into the appropriate unit.
I realize I'll probably need more variables, like a variable that is set equal to the unit-type of which unit a certain unit fuses to, such as:
-
Init Variables
-
Events
- Map initialization
- Conditions
-
Actions
- Set Level3Unit[1] = Wolf
- Set Level3Unit[2] = Captain
- Set Level4Unit[1] = Armor Horse
- Set Level3Fuse[1] = Captain
- Set Level3Fuse[2] = Wolf
-
Events
-
Level 3 Fusion Trigger
-
Events
- Unit - A unit enters Fusion Circle <gen>
- Conditions
-
Actions
-
For each (Integer A) from 1 to 10, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Fusion Circle <gen> contains Level3Unit[Integer A]) Equal to True
- (Fusion Circle <gen> contains Level3Fuse[Integer A]) Equal to True
-
Then - Actions
- Unit - Create 1 Level4Unit[Integer A] for (Owner of (Triggering unit)) at (Center of Fusion Unit Create <gen>) facing Default building facing (270.0) degrees
-
Else - Actions
- Do Nothing
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer A) from 1 to 10, do (Actions)
-
Events
Last edited: