Snippet How to show deny with player colors

BacTyrael

New Member
Reaction score
1
Introduction
This is a guide to show how you can create a simple and easy deny system with shown denial.

Things you will need
1. World Editor
2. One added variable
3. Basic understanding of the editor

Step One: Necessary
First you should create your variable since they will be needed for this to work.

Variable Name: Player_Colors
Variable Type: String (string)
Array: Checked
Size: 12
Initial Value: None

Step Two: Necessary
Now that we have the variable setup we can add value to Player_Colors. We will do this with an easy trigger.
Trigger:
  • Player Colors
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Player_Colors[1] = |c00ff0303
      • Set Player_Colors[2] = |c000042ff
      • Set Player_Colors[3] = |c001ce6b9
      • Set Player_Colors[4] = |c00540081
      • Set Player_Colors[5] = |c00fffc01
      • Set Player_Colors[6] = |c00ff8000
      • Set Player_Colors[7] = |c0020c000
      • Set Player_Colors[8] = |c00e55bb0
      • Set Player_Colors[9] = |c00959697
      • Set Player_Colors[10] = |c007ebff1
      • Set Player_Colors[11] = |c00106246
      • Set Player_Colors[12] = |c004e2a04


Step Three: Necessary
With the variable made and setup completely all that is left is showing denial. We can do this with another trigger.
Trigger:
  • Show Deny
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) belongs to an ally of (Owner of (Killing unit))) Equal to True
    • Actions
      • Floating Text - Create floating text that reads (Player_Colors[(Player number of (Owner of (Killing unit)))] + (! + |r)) above (Triggering unit) with Z offset 0.00, using font size 14.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 0.75 seconds


Step Four: Optional
I felt like this guide would be pretty pointless if you didn't have a deny unit system to follow this. It is very easy to follow/make and hopefully you will find it with good use.
Trigger:
  • Deny
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacked unit) is A structure) Equal to True
          • ((Attacked unit) is A Hero) Equal to True
        • Then - Actions
          • Unit - Order (Attacking unit) to Stop
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of (Attacked unit)) Greater than 20.00
            • Then - Actions
              • Unit - Order (Attacking unit) to Stop
            • Else - Actions


Credits - Please Read
Thanks to Accname for Step Four all credit goes to him for that trigger. Rest of the work was tinkered out by yours truly. Also thanks to the forum community for other great guides and help (sharkbait87 especially for assistance in steps one and two).
 

Exide

I am amazingly focused right now!
Reaction score
448
In Step Three, you should use 'Floating Text - Disable Permanence', and 'Floating Text - Set Lifespan' (if I remember correctly.)
Instead of using 'Floating Text - Destroy (Last created Floating Text)'.
 

BacTyrael

New Member
Reaction score
1
In Step Three, you should use 'Floating Text - Disable Permanence', and 'Floating Text - Set Lifespan' (if I remember correctly.)
Instead of using 'Floating Text - Destroy (Last created Floating Text)'.
Changed and thank you.
 

Exide

I am amazingly focused right now!
Reaction score
448
What is Temp_Exclamation, btw?
You should show the trigger where you set it, or don't use a variable for it.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
What about me where is my credits i help you with step 1 and 2
 

BacTyrael

New Member
Reaction score
1
:thup: changed and thanks again.

What is Temp_Exclamation, btw?
You should show the trigger where you set it, or don't use a variable for it.

Removed the unnecessary variable and changed step two. Thank you for noticing my typo Exide.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top