Alternate town halls and group invulnerability shields for a noob

Level 2
Joined
Nov 9, 2018
Messages
9
So, I have a project I’m working on, a map for some friends and I, wherein two of us have largely reworked custom races...Dwarves and High Elves. As both have entirely separate tech trees and town hall structures, this has created a problem where the map reveals all our structures, not recognizing the town halls.

I’ve looked for this problem elsewhere. Apparently the offending element is the trigger that enforces the victory/defeat conditions, which specifies only the original town hall structures.

Now, I have two potential solutions. The first is to modify the original town hall, removing its ability to create human peasants, (I preserved the original human tech tree), maybe make it cheaper, and add it to the Elven and Dwarven build trees to prevent revelation. The second is to totally redo the victory/defeat conditions trigger. I have no idea how to do that last, but it is the preferred option. If someone could tell me how to do that, it would be welcome.

——

That pales in comparison to the second problem. I’m creating an item, stack of two, which when activated should apply total invulnerability to all friendly ground units nearby for four seconds. So far I’ve been able to apply a divine shield visual effect to all of them, but no more. I don’t think this is a matter for a trigger, but I’ve really no idea, and thus am asking about how to achieve this.


I await your wisdom, oh mighty internet!
 
I guess this should do the trick
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (Your ability here)
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 300.00 of (Position of (Triggering unit))) and do (Actions)
        • Loop - Actions
          • Set Units = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Units) has buff Divine Shield) Equal to False
              • (Units belongs to an ally of (Owner of (Triggering unit))) Equal to True
            • Then - Actions
              • Unit - Add Invulnerable (Neutral) to Units
            • Else - Actions
      • Trigger - Turn on Loop<gen>
EDIT:
make sure to uncheck Initially On
  • Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set duration = (duration + 1.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • duration equal 3.00
        • Then - Actions
          • Unit - Remove Invulnerable (Neutral) from (Units)
          • Set duration = 0.00
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Last edited:
Level 2
Joined
Nov 9, 2018
Messages
9
I'm copying that trigger now, how/where do I find that "Set Units = (Picked Unit)" bit?

[Edit]: I figured that bit out, but now after the units become invulnerable, which they now do successfully, they remain invulnerable forever. How do I fix that?
 
Last edited:
Level 2
Joined
Nov 9, 2018
Messages
9
I've made the edits, thanks...but the armor type still seems to remain invulnerable. Also, my duration trigger seems a tad different...

c6332173c3872c6f255900a99d55636c.png
 
Level 7
Joined
Apr 17, 2017
Messages
316
Try to add these:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
    • Actions
      • Set Caster = (Triggering unit)
      • Set UG = (Units within 300.00 of (Position of Caster) matching ((((Matching unit) belongs to an ally of (Owner of Caster)) Equal to True) and (((Matching unit) has buff Divine Shield) Equal to False)))
      • Unit Group - Pick every unit in UG and do (Actions)
        • Loop - Actions
          • Set Unit = (Picked unit)
          • Unit - Add Invulnerable (Neutral) to Unit
      • Trigger - Turn on Untitled Trigger 002 <gen>

  • Untitled Trigger 002
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set duration = (duration + 1.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • duration Equal to 4.00
        • Then - Actions
          • Unit Group - Pick every unit in UG and do (Actions)
            • Loop - Actions
              • Set Unit = (Picked unit)
              • Unit - Remove Invulnerable (Neutral) from Unit
          • Custom script: call DestroyGroup(udg_UG)
          • Set duration = 0.00
          • Trigger - Turn off (This trigger)
        • Else - Actions
Note: UG is Unit Group variable
 
Last edited:
Level 34
Joined
Feb 27, 2007
Messages
4,586
Neither of these solutions are MUI (won't work for multiple units simultaneously) but if that works for you then you can remove the need for counting up the duration in Aeryn's trigger by using a timer variable. Also there was a point leak in the second line of the first trigger that I've fixed.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
    • Actions
      • Set Caster = (Triggering unit)
      • Set TmpPoint = (Position of Caster)
      • Set UG = (Units within 300.00 of TmpPoint matching ((((Matching unit) belongs to an ally of (Owner of Caster)) Equal to True) and (((Matching unit) has buff Divine Shield) Equal to False)))
      • Unit Group - Pick every unit in UG and do (Actions)
        • Loop - Actions
          • Set Unit = (Picked unit)
          • Unit - Add Invulnerable (Neutral) to Unit
      • Countdown Timer - Start INVULN_TIMER as a one-shot timer that will expire in 4.00 seconds
      • Custom script: call RemoveLocation(udg_TmpPoint) //change to match the name of your variable but keep the udg_ prefix
  • Untitled Trigger 002
    • Events
      • Countdown Timer - INVULN_TIMER expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in UG and do (Actions)
        • Loop - Actions
          • Unit - Remove Invulnerable (Neutral) from Unit
      • Custom script: call DestroyGroup(udg_UG)
 
Level 2
Joined
Nov 9, 2018
Messages
9
I do need for multiple units to be able to be under the effect, though I do not need the effect to be able to trigger multiple times simultaneously. So if that is as the trigger works, then good...I’ll be trying the updated version tonight and I’ll tell you guys how it goes...but if MUI is required to achieve that effect, then it may not work.
Stay tuned for the update by tomorrow.
 
Level 2
Joined
Nov 9, 2018
Messages
9
Alright, it was a success, but only on a single unit in the group. This ability does need to be able to affect multiple units with a single cast at the same time.

[EDIT]: To clarify, the whole group became invulnerable, but only one unit returned to normal.
 
Last edited:
Level 7
Joined
Apr 17, 2017
Messages
316
You need to declare picked unit variable in the second trigger again.

  • Loop
    • Events
      • Time - InvulnTimer expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Set Units = (Picked unit)
          • Unit - Remove Invulnerable (Neutral) from Units
      • Custom script: call DestroyGroup(udg_UnitGroup)
 
Level 2
Joined
Nov 9, 2018
Messages
9
Ahah! It is now successful in its entirety! You have my most profound gratitude, Aeryn, Pyrogasm, and also Doomhammer!
Now, I don't suppose the former question on town halls has a simpler answer, does it?
 
Top