cleeezzz
The Undead Ranger.
- Reaction score
- 268
UPDATED V1.21 See change log at post #10
MUI: Yes (Buildings and up to the max array limit, although i doubt you will have 8000 buildings.)
GUI/JASS?: GUI
Leakless?: I think
This is an interesting system i made that works surprisingly well in melee maps.
Basically, it takes all the structures in the map, sets a capture amount (Max HP/10) and creates nice little bars above the structures. If an enemy unit stands next to the building, the bar will slowly fill up (faster with more units around). The bar will freeze (stop capturing) if an enemy comes in range of the building. It will resume after only 1 team is around the building. (1 team means, if red and blue are allies, they both can capture, which ever player get there first gets the building, if both players are there, it randomly picks a player) If an enemy player fills the bar but runs away or dies before it is captured, the owner (or allies) of the unit will have to stand next to the building to Recapture the building.
hard to show in screen shots, just play the map with an AI or something.
(in the demo map, i used phantomgrove but you can use anything, to import, go to your WE, go to File -> Preferences and checkmark Create Variables unknown to the editor, then just simply copy and paste all the triggers (except the triggers in the folder Initialization)
CODE:
Screenies! (It is still difficult to see everything)
If anyone finds bugs or leaks (or suggestions, including optimization) please tell me!
MUI: Yes (Buildings and up to the max array limit, although i doubt you will have 8000 buildings.)
GUI/JASS?: GUI
Leakless?: I think
This is an interesting system i made that works surprisingly well in melee maps.
Basically, it takes all the structures in the map, sets a capture amount (Max HP/10) and creates nice little bars above the structures. If an enemy unit stands next to the building, the bar will slowly fill up (faster with more units around). The bar will freeze (stop capturing) if an enemy comes in range of the building. It will resume after only 1 team is around the building. (1 team means, if red and blue are allies, they both can capture, which ever player get there first gets the building, if both players are there, it randomly picks a player) If an enemy player fills the bar but runs away or dies before it is captured, the owner (or allies) of the unit will have to stand next to the building to Recapture the building.
hard to show in screen shots, just play the map with an AI or something.
(in the demo map, i used phantomgrove but you can use anything, to import, go to your WE, go to File -> Preferences and checkmark Create Variables unknown to the editor, then just simply copy and paste all the triggers (except the triggers in the folder Initialization)
CODE:
Code:
Player Colors
Events
Time - Elapsed game time is 0.10 seconds
Conditions
Actions
For each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Color of (Player((Integer A)))) Equal to Red
Then - Actions
Set Player_Colors[(Integer A)] = |c00ff0000
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Color of (Player((Integer A)))) Equal to Blue
Then - Actions
Set Player_Colors[(Integer A)] = |c000033ff
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Color of (Player((Integer A)))) Equal to Teal
Then - Actions
Set Player_Colors[(Integer A)] = |c0000ffff
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Color of (Player((Integer A)))) Equal to Purple
Then - Actions
Set Player_Colors[(Integer A)] = |c009900ff
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Color of (Player((Integer A)))) Equal to Yellow
Then - Actions
Set Player_Colors[(Integer A)] = |c00ffff00
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Color of (Player((Integer A)))) Equal to Orange
Then - Actions
Set Player_Colors[(Integer A)] = |c00ff9900
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Color of (Player((Integer A)))) Equal to Green
Then - Actions
Set Player_Colors[(Integer A)] = |c0000ff00
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Color of (Player((Integer A)))) Equal to Pink
Then - Actions
Set Player_Colors[(Integer A)] = |c00ff66ff
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Color of (Player((Integer A)))) Equal to Gray
Then - Actions
Set Player_Colors[(Integer A)] = |cff959697
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Color of (Player((Integer A)))) Equal to Light Blue
Then - Actions
Set Player_Colors[(Integer A)] = |cff7ebff1
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Color of (Player((Integer A)))) Equal to Dark Green
Then - Actions
Set Player_Colors[(Integer A)] = |cff106246
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Color of (Player((Integer A)))) Equal to Brown
Then - Actions
Set Player_Colors[12] = |cff4e2a04
Else - Actions
Code:
Setup
Events
Conditions
Actions
Set Capture_String = llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to True) and (((Owner of (Matching unit)) Not equal to Neutral Passive) and (((Matching unit) is alive) Equal to True))))
Unit Group - Pick every unit in Temp_Group and do (Actions)
Loop - Actions
Set i = (i + 1)
Unit Group - Add (Picked unit) to Building_Group
Unit - Set the custom value of (Picked unit) to i
Set Owner[i] = (Owner of (Picked unit))
Set Capture_Time[i] = ((Integer((Max life of (Picked unit)))) / 10)
Set Capture_Bar_Show[i] = (Player_Colors[(Player number of (Owner of (Picked unit)))] + (Substring(Capture_String, 1, Capture_Time[i])))
Set Temp_Point = (Position of (Picked unit))
Set Capture_Progress[i] = 0
Unit - Make (Picked unit) Invulnerable
Custom script: call DestroyGroup(udg_Temp_Group)
Code:
Setup 2
Events
Unit - A unit Finishes construction
Conditions
Actions
Set i = (i + 1)
Unit Group - Add (Constructed structure) to Building_Group
Unit - Set the custom value of (Constructed structure) to i
Set Owner[i] = (Owner of (Constructed structure))
Set Capture_Time[i] = ((Integer((Max life of (Constructed structure)))) / 10)
Set Capture_Bar_Show[i] = (Player_Colors[(Player number of (Owner of (Constructed structure)))] + (Substring(Capture_String, 1, Capture_Time[i])))
Set Capture_Progress[i] = 0
Unit - Make (Picked unit) Invulnerable
Code:
Update
Events
Time - Every 0.50 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in Building_Group and do (Actions)
Loop - Actions
Floating Text - Destroy Capture_Bar[(Custom value of (Picked unit))]
Floating Text - Create floating text that reads Capture_Bar_Show[(Custom value of (Picked unit))] above (Picked unit) with Z offset 0.00, using font size 4.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Set Capture_Bar[(Custom value of (Picked unit))] = (Last created floating text)
Set Temp_Point = (Position of (Picked unit))
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Temp_Point is fogged for (Picked player)) Equal to True
(Temp_Point is masked for (Picked player)) Equal to True
Then - Actions
Set Temp_Force = (Player group((Picked player)))
Floating Text - Hide Capture_Bar[(Custom value of (Picked unit))] for Temp_Force
Custom script: call DestroyForce(udg_Temp_Force)
Else - Actions
Custom script: call RemoveLocation(udg_Temp_Point)
Code:
Death
Events
Unit - A unit Dies
Conditions
((Triggering unit) is A structure) Equal to True
Actions
Floating Text - Destroy Capture_Bar[(Custom value of (Triggering unit))]
Unit Group - Remove (Triggering unit) from Building_Group
Code:
Capture
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in Building_Group and do (Actions)
Loop - Actions
Set Enemy = False
Set Allied = False
Set Enemy_Allied = False
Set Enemy_Enemy = False
Player Group - Remove all players from Player_Group
Set Temp_Point = (Position of (Picked unit))
Set Capture_Group = (Units within 512.00 of Temp_Point matching (((Matching unit) Not equal to (Picked unit)) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is an illusion) Equal to False) and ((((Matching unit) is Summoned) Equal to False) and (((
Custom script: call RemoveLocation(udg_Temp_Point)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Capture_Group is empty) Equal to False
Then - Actions
Unit Group - Pick every unit in Capture_Group and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Owner of (Picked unit)) Equal to Neutral Hostile
(Owner of (Picked unit)) Equal to Neutral Victim
(Owner of (Picked unit)) Equal to Neutral Extra
(Owner of (Picked unit)) Equal to Neutral Passive
Then - Actions
Unit Group - Remove (Picked unit) from Capture_Group
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Picked unit)) is in Player_Group) Equal to False
Then - Actions
Player Group - Add (Owner of (Picked unit)) to Player_Group
Else - Actions
Set Rate = (Number of units in Capture_Group)
Player Group - Pick every player in Player_Group and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Picked unit)) is an enemy of (Picked player)) Equal to True
Then - Actions
Set Enemy = True
Else - Actions
Set Allied = True
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Enemy Equal to True
Allied Equal to False
Then - Actions
Set Temp_Player = (Random player from Player_Group)
Player Group - Pick every player in Player_Group and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Temp_Player is an ally of (Picked player)) Equal to True
Then - Actions
Set Enemy_Allied = True
Else - Actions
Set Enemy_Enemy = True
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Enemy Equal to True
Allied Equal to False
Enemy_Allied Equal to True
Enemy_Enemy Equal to False
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Capturer[(Custom value of (Picked unit))] is in Player_Group) Equal to False
Then - Actions
Set Capturer[(Custom value of (Picked unit))] = Temp_Player
Else - Actions
Unit - Cause (Random unit from Capture_Group) to damage (Picked unit), dealing 0.00 damage of attack type Spells and damage type Normal
Custom script: call DestroyGroup(udg_Capture_Group)
Set Capture_Progress[(Custom value of (Picked unit))] = (Capture_Progress[(Custom value of (Picked unit))] + Rate)
Set Capture_Bar_Show[(Custom value of (Picked unit))] = ((((((Player_Colors[(Player number of Capturer[(Custom value of (Picked unit))])] + (Substring(Capture_String, 1, Capture_Progress[(Custom value of (Picked unit))]))) + |r) + Player_Colors[(Player number of Owner[(Custom value of (Picked unit))])]) + (Substri
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Capture_Progress[(Custom value of (Picked unit))] Greater than or equal to Capture_Time[(Custom value of (Picked unit))]
Then - Actions
Unit - Change ownership of (Picked unit) to Capturer[(Custom value of (Picked unit))] and Change color
Set Owner[(Custom value of (Picked unit))] = Capturer[(Custom value of (Picked unit))]
Set Capture_Progress[(Custom value of (Picked unit))] = 0
Set Capture_Bar_Show[(Custom value of (Picked unit))] = (Player_Colors[(Player number of (Owner of (Picked unit)))] + (Substring(Capture_String, 1, Capture_Time[(Custom value of (Picked unit))])))
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Enemy Equal to False
Allied Equal to True
Or - Any (Conditions) are true
Conditions
Capture_Progress[(Custom value of (Picked unit))] Greater than or equal to 0
Capture_Progress[(Custom value of (Picked unit))] Less than or equal to 0
Then - Actions
Unit - Make (Picked unit) Invulnerable
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Capture_Progress[(Custom value of (Picked unit))] Less than or equal to 0
Then - Actions
Set Capture_Bar_Show[(Custom value of (Picked unit))] = (Player_Colors[(Player number of (Owner of (Picked unit)))] + (Substring(Capture_String, 1, Capture_Time[(Custom value of (Picked unit))])))
Set Capture_Progress[(Custom value of (Picked unit))] = 0
Else - Actions
Set Capture_Progress[(Custom value of (Picked unit))] = (Capture_Progress[(Custom value of (Picked unit))] - Rate)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Capture_Progress[(Custom value of (Picked unit))] Less than or equal to 0
Then - Actions
Set Capture_Bar_Show[(Custom value of (Picked unit))] = (Player_Colors[(Player number of (Owner of (Picked unit)))] + (Substring(Capture_String, 1, Capture_Time[(Custom value of (Picked unit))])))
Set Capture_Progress[(Custom value of (Picked unit))] = 0
Else - Actions
Set Capture_Bar_Show[(Custom value of (Picked unit))] = ((((((Player_Colors[(Player number of Capturer[(Custom value of (Picked unit))])] + (Substring(Capture_String, 1, Capture_Progress[(Custom value of (Picked unit))]))) + |r) + Player_Colors[(Player number of Owner[(Custom value of (Picked unit))])]) + (Substri
Else - Actions
Else - Actions
Unit - Make (Picked unit) Invulnerable
Code:
Invulnerable Off
Events
Unit - A unit Is issued an order targeting an object
Conditions
((Target unit of issued order) is A structure) Equal to True
((Owner of (Triggering unit)) is an enemy of (Owner of (Target unit of issued order))) Equal to True
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Issued order) Equal to (Order(smart))
Then - Actions
Unit - Make (Target unit of issued order) Vulnerable
Else - Actions
Screenies! (It is still difficult to see everything)
If anyone finds bugs or leaks (or suggestions, including optimization) please tell me!