- Joined
- Mar 1, 2013
- Messages
- 555
Greetings everyone
I use to have an event for every possible recipe (a unit aquires an item) plus a ITE to check the conditions and then give the ability. I was still new to trigger when I invented this method:
^ and I have 84 of them. I'm aware of the poor programming style.
Anyway so after 6 months of exp I invented a new method:
I havent tested it yet but my logic says that this should work.
Is this the best possible way to make recieps in GUI or is there a better way do do it?
Help are appriciated
----------
Intro:
I'm making a map wich has 7 orbs.
You need to pick up any 3 to gain an ability.
There are 84 possible combos.
Sometimes a diffirent hero type gets a diffirent spell.
----------
Intro:
I'm making a map wich has 7 orbs.
You need to pick up any 3 to gain an ability.
There are 84 possible combos.
Sometimes a diffirent hero type gets a diffirent spell.
----------
I use to have an event for every possible recipe (a unit aquires an item) plus a ITE to check the conditions and then give the ability. I was still new to trigger when I invented this method:
-
Frost amor
-
Events
- Unit - A unit Acquires an item
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
And - All (Conditions) are true
-
Conditions
- (Item-type of (Item carried by (Hero manipulating item) in slot 1)) Equal to Orb of frost
- (Item-type of (Item carried by (Hero manipulating item) in slot 2)) Equal to Orb of frost
- (Item-type of (Item carried by (Hero manipulating item) in slot 3)) Equal to Orb of mana
-
Conditions
-
And - All (Conditions) are true
-
Conditions
- (Item-type of (Item carried by (Hero manipulating item) in slot 1)) Equal to Orb of frost
- (Item-type of (Item carried by (Hero manipulating item) in slot 2)) Equal to Orb of mana
- (Item-type of (Item carried by (Hero manipulating item) in slot 3)) Equal to Orb of frost
-
Conditions
-
And - All (Conditions) are true
-
Conditions
- (Item-type of (Item carried by (Hero manipulating item) in slot 1)) Equal to Orb of mana
- (Item-type of (Item carried by (Hero manipulating item) in slot 2)) Equal to Orb of frost
- (Item-type of (Item carried by (Hero manipulating item) in slot 3)) Equal to Orb of frost
-
Conditions
-
And - All (Conditions) are true
-
Conditions
-
Or - Any (Conditions) are true
-
Actions
- Item - Remove (Item carried by (Hero manipulating item) in slot 1)
- Item - Remove (Item carried by (Hero manipulating item) in slot 2)
- Item - Remove (Item carried by (Hero manipulating item) in slot 3)
- Unit - Add Frost Armor to (Hero manipulating item)
- Special Effect - Create a special effect attached to the overhead of (Hero manipulating item) using Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
- Wait 0.80 seconds
- Special Effect - Destroy (Last created special effect)
- Special Effect - Create a special effect attached to the overhead of (Hero manipulating item) using Abilities\Spells\Items\ResourceItems\ResourceEffectTarget.mdl
- Wait 0.10 seconds
- Special Effect - Destroy (Last created special effect)
-
Events
Anyway so after 6 months of exp I invented a new method:
Only one of these
-
Counter
-
Events
- Unit - A unit Acquires an item
- Conditions
-
Actions
- Set Temp_Unit = (Triggering unit)
-
For each (Integer Temp_Int) from 1 to 7, do (Actions)
-
Loop - Actions
- Set iOrbs[Temp_Int] = 0
-
Loop - Actions
-
For each (Integer Temp_Int) from 1 to 6, do (Actions)
-
Loop - Actions
- If ((Item-type of (Item carried by Temp_Unit in slot Temp_Int)) Equal to Orb of frost) then do (Set iOrbs[1] = (iOrbs[1] + 1)) else do (-------- 0 --------)
- If ((Item-type of (Item carried by Temp_Unit in slot Temp_Int)) Equal to Orb of fire) then do (Set iOrbs[2] = (iOrbs[2] + 1)) else do (-------- 0 --------)
- If ((Item-type of (Item carried by Temp_Unit in slot Temp_Int)) Equal to Orb of lighting) then do (Set iOrbs[3] = (iOrbs[3] + 1)) else do (-------- 0 --------)
- If ((Item-type of (Item carried by Temp_Unit in slot Temp_Int)) Equal to Orb of light) then do (Set iOrbs[4] = (iOrbs[4] + 1)) else do (-------- 0 --------)
- If ((Item-type of (Item carried by Temp_Unit in slot Temp_Int)) Equal to Orb of nature) then do (Set iOrbs[5] = (iOrbs[5] + 1)) else do (-------- 0 --------)
- If ((Item-type of (Item carried by Temp_Unit in slot Temp_Int)) Equal to Orb of dark) then do (Set iOrbs[6] = (iOrbs[6] + 1)) else do (-------- 0 --------)
- If ((Item-type of (Item carried by Temp_Unit in slot Temp_Int)) Equal to Orb of mana) then do (Set iOrbs[7] = (iOrbs[7] + 1)) else do (-------- 0 --------)
-
Loop - Actions
- If (iOrbs[1] Equal to 3) then do (Trigger - Run FrostFrostFrost <gen> (ignoring conditions)) else do (-------- 0 --------)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
-
Then - Actions
- -------- If true then run trigger --------
- Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
-
Then - Actions
- -------- If true then run trigger --------
- Else - Actions
-
Events
-
FrostFrostFrost
- Events
- Conditions
-
Actions
- Item - Remove (Item carried by Temp_Unit of type Orb of frost)
- Item - Remove (Item carried by Temp_Unit of type Orb of frost)
- Item - Remove (Item carried by Temp_Unit of type Orb of frost)
- -------- repeat this for every hero type --------
- If ((Unit-type of Temp_Unit) Equal to Spirit of vengeance) then do (Unit - Add Frost bolt to Temp_Unit) else do (-------- 0 --------)
Is this the best possible way to make recieps in GUI or is there a better way do do it?
Help are appriciated