• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Invisibility of...... a city ?

Status
Not open for further replies.
Level 8
Joined
Sep 17, 2009
Messages
606
like create your own invisibility ability, name it whatever you want, add it to the buildings you want and in the invisibility ability the part that says Stats-Targets alowed put Ground and Struture
 

If it's night, and a night elf building is made, give it invisibility.
  • Constructed Invis Building
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • ((Constructed structure) is A structure) Equal to True
      • (Race of (Owner of (Constructed structure))) Equal to Night Elf
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (In-game time of day) Greater than 6.00
          • (In-game time of day) Less than or equal to 18.00
        • Then - Actions
          • Unit - Add Permanent Invisibility to (Constructed structure)
        • Else - Actions



Each game-day is 480 seconds. If you set the game to start at noon or midnight, this will work. If not, use a wait action at the beginning of Actions to time it properly.
  • Invisible Buildings
    • Events
      • Time - Every 240.00 seconds of game time
    • Conditions
    • Actions
      • Set TempUnitGroup = (Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to True) and ((Race of (Owner of (Matching unit))) Equal to Night Elf)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Permanent Invisibility for (Random unit from TempUnitGroup)) Equal to 0
        • Then - Actions
          • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
            • Loop - Actions
              • Unit - Add Permanent Invisibility to (Picked unit)
        • Else - Actions
          • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
            • Loop - Actions
              • Unit - Remove Permanent Invisibility from (Picked unit)
      • Custom script: call DestroyGroup( udg_TempUnitGroup )


This should work for a fairly basic scenario. If it starts at night, you'll need a third trigger to give all night-elf buildings invis at the start.

Also, it might be better to use a unit-type comparison, rather than a player race one, in case someone builds another race's units (charmed a worker, etc.)
 
Level 3
Joined
Jan 2, 2010
Messages
65
I just tested it out.
Just make sure you know two things
Night Elf buildings are classified as ancients
And two even if it doesn't look like its invisible, it is. I tried it with a big bunch of neutral creeps. They hit it then i changed to night and after i clicked hide they went away

Hope that helps
 
Status
Not open for further replies.
Top