• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Arbiter

Status
Not open for further replies.
Level 4
Joined
Aug 2, 2015
Messages
50
Howdy

I want to make an Arbiter unit similar to the one from starcraft.
That is (for those who not know) a flying unit that makes all friendly units within a certain distance invisible leaving himself visable and vulnerable.

Preferly trigger based, so it has to work for all arbiters that the player build, not just single hero etc.

I had some own ideas on how to do, but cant seem to make it top shape, can anyone help out with this?
 

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,456
Fairly simple to do. All you need is a point var, a unit var, 2 unit group variables, and 3 triggers.

  • Arbiter Add
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Arbiter
    • Actions
      • Unit Group - Add (Triggering unit) to Arbiter_ArbGroup
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Arbiter Loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Arbiter Loop <gen>
        • Else - Actions
  • Arbiter Remove
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Arbiter
    • Actions
      • Unit Group - Remove (Triggering unit) from Arbiter_ArbGroup.
  • Arbiter Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Arbiter_InvisGroup and do (Actions)
        • Loop - Actions
          • Unit - Remove Arbiter Invisibility (Permanent Invis) from (Picked unit)
          • Unit Group - Remove (Picked unit) from Arbiter_InvisGroup.
      • -------- --------
      • Unit Group - Pick every unit in Arbiter_ArbGroup and do (Actions)
        • Loop - Actions
          • Set VariableSet Arbiter_Unit = (Picked unit)
          • Set VariableSet Arbiter_Point = (Position of Arbiter_Unit)
          • -------- --------
          • -------- Search for nearby units to make invisible: --------
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 600.00 of Arbiter_Point.) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Not equal to Arbiter
                  • ((Picked unit) is in Arbiter_InvisGroup.) Equal to False
                  • ((Picked unit) is alive) Equal to True
                  • ((Picked unit) belongs to an ally of (Owner of Arbiter_Unit).) Equal to True
                  • ((Picked unit) is A structure) Equal to False
                • Then - Actions
                  • Unit - Add Arbiter Invisibility (Permanent Invis) to (Picked unit)
                  • Unit Group - Add (Picked unit) to Arbiter_InvisGroup
                • Else - Actions
          • Custom script: call RemoveLocation (udg_Arbiter_Point)
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Arbiter_ArbGroup) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
If you want your Arbiters to only cloak units that belong to you, change the Condition "Picked unit belongs to an ally of Owner of Arbiter_Unit Equal to True" to: "Owner of picked unit equal to Owner of Arbiter_Unit Equal to True". It's a Player Comparison.

Arbiter_ArbGroup contains all of the Arbiters.

Arbiter_InvisGroup contains all of the units currently invisible.

Arbiter Loop trigger is Inititally OFF.

So you add the Arbiter to Arbiter_ArbGroup upon creation and remove the Arbiter from Arbiter_ArbGroup when it dies. You turn on the Arbiter Loop trigger whenever it's turned off and there's at least 1 Arbiter alive.

The Loop trigger picks through every single Arbiter every 1.00 second, searching for nearby units around it to make invisible. The invisibility is done by adding the Permanent Invisibility ability to our eligible units. We add these invisible units to Arbiter_InvisGroup so we can keep track of them and remove Permanent Invisibility from them later on. This method seems weird since we're removing/adding the ability constantly, but it works.
 

Attachments

  • Arbiter 1.w3m
    18.9 KB · Views: 17
Last edited:
Status
Not open for further replies.
Top