Deleted member 231919
D
Deleted member 231919
(GUI preferably, just so I can edit it myself, I don't know how to code jass.)
Hi everybody, I have this trigger that I have been trying to create but its not working at all. The trigger pretty much checks the whole map, assigns different types of crops into a unit group, and then uses an If statement to check every singular crop. If the crop has 100 health, that crop will receive 1 mana(and will be damaged by 20). If not, then that crop will not get the 1 mana, and will still get damaged for 20.
Once the crop has reached full mana, it will be removed and drop a fruit(certain types of crops will not be removed, they will drop a fruit and have its mana go down to 0.)
The problem is, is that I can't get it to work, on top of that there're multiple types of crops that will be checked to see if they have 100 health. Also, each crop has a different amount of max mana.
Example:
Turnips = 6 max mana
Strawberries = 4 max mana (Strawberries can be regrown, so they will not be removed but will have their mana reset to 0.)
I'm using seeds instead of fruits being dropped right now, I was going to replace them later.
Hi everybody, I have this trigger that I have been trying to create but its not working at all. The trigger pretty much checks the whole map, assigns different types of crops into a unit group, and then uses an If statement to check every singular crop. If the crop has 100 health, that crop will receive 1 mana(and will be damaged by 20). If not, then that crop will not get the 1 mana, and will still get damaged for 20.
Once the crop has reached full mana, it will be removed and drop a fruit(certain types of crops will not be removed, they will drop a fruit and have its mana go down to 0.)
The problem is, is that I can't get it to work, on top of that there're multiple types of crops that will be checked to see if they have 100 health. Also, each crop has a different amount of max mana.
Example:
Turnips = 6 max mana
Strawberries = 4 max mana (Strawberries can be regrown, so they will not be removed but will have their mana reset to 0.)
-
Crops Check
-

Events
-


Time - Every 10.00 seconds of game time
-
-

Conditions
-

Actions
-


Set Temp_Crop_Group = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Turnip Crop))
-


Set Temp_Crop_Group = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Strawberry Crop))
-


Unit Group - Pick every unit in Temp_Crop_Group and do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Life of (Picked unit)) Equal to 100.00
-
-





Then - Actions
-






Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + 1.00)
-






Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 20.00)
-






Trigger - Turn on Fruits Check <gen>
-
-





Else - Actions
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(Life of (Picked unit)) Not equal to 100.00
-
-







Then - Actions
-








Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 20.00)
-
-







Else - Actions
-
-
-
-
-
-
-
-
Fruits Check
-

Events
-


Time - Every 2.00 seconds of game time
-
-

Conditions
-

Actions
-


Unit Group - Pick every unit in Temp_Crop_Group and do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Max mana of (Picked unit)) Equal to 6.00
-






(Mana of (Picked unit)) Equal to 6.00
-
-





Then - Actions
-






Hero - Create Turnip Seed and give it to (Picked unit)
-






Unit - Remove (Picked unit) from the game
-
-





Else - Actions
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(Max mana of (Picked unit)) Equal to 4.00
-








(Mana of (Picked unit)) Equal to 4.00
-
-







Then - Actions
-








Hero - Create Strawberry Seed and give it to (Picked unit)
-








Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - 4.00)
-
-







Else - Actions
-








Trigger - Turn off (This trigger)
-
-
-
-
-
-
-
-
Last edited by a moderator:


