Invul structures

Scary Nachos

Castro flashing Gang Signs!
Reaction score
45
Hello! I, Scary, need help with triggers, i am semi at them? meh... anyway... im trying to do this one thing, but first ill explain the map, the map goes like this, first there you got these units and there is a tower and the main base, if your main base gets killed, you lose! And well.. idiots like to kill the base and ruin the game... so i need help with a trigger that makes the heart invulable, but turns vulable once all your towers are dead. help scary plz! Here is scarys code
Code:
AllianceHeart
    Events
        Unit - Scout Tower 0040 <gen> Dies
        Unit - Scout Tower 0038 <gen> Dies
        Unit - Scout Tower 0037 <gen> Dies
        Unit - Scout Tower 0036 <gen> Dies
        Unit - Scout Tower 0039 <gen> Dies
    Conditions
    Actions
        Unit - Remove Invulnerable (Neutral) from Heart of Alliance 0035 <gen>
 

Azlier

Old World Ghost
Reaction score
461
Add a condition making sure every tower is dead. If you don't, your base will become vulnerable when a single tower dies.
 

Squishinator

New Member
Reaction score
3
this is simple. Do an integer variable, so when one of those specific structures dies, add one to that integer. so say that there are 10 structures. Do:

Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Scout Tower
      • Dead_Towers Equal to 10
    • Actions
      • Unit - Make Castle 0000 &lt;gen&gt; Vulnerable
 

Vaius

New Member
Reaction score
19
That would require A: another trigger to set the variables and B: 11 towers to be destroyed. A better trigger would be
Code:
Castle Vulnerability
    Events
        Unit - A unit owned by Player 1 (Red) Dies
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Dead_Scout_Towers Equal to 9
            Then - Actions
                Unit - Make Castle Vulnerable
            Else - Actions
                Set Scout_Towers = (Scout_Towers + 1)

NOTE: The reason it's Dead_Scout_Towers = 9, is because that would mean 9 towers are already destroyed, and therefore the trigger is detecting the tenth tower being destroyed.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Juz add conditions IsUnitDead(Scout Tower) to trigger, then is ok already...

***
Is Scout Tower 0040 <gen> Dies
Is Scout Tower 0038 <gen> Dies
Is Scout Tower 0037 <gen> Dies
Is Scout Tower 0036 <gen> Dies
Is Scout Tower 0039 <gen> Dies

***:)
 

Scary Nachos

Castro flashing Gang Signs!
Reaction score
45
Hm... ok but then how would i add more players on to that? and "Dead_Scout_Towers" would that b a integer?
 

ccsdude

New Member
Reaction score
2
I think this should work, you just need to make Dead_Towers = 0 at map initialization and set Main_Base for the base you want.

Code:
Untitled Trigger 001
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Dying unit)) Equal to Scout Tower
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Dead_Towers Equal to 9
            Then - Actions
                Unit - Make Main_Base Vulnerable
            Else - Actions
                Set Dead_Towers = (Dead_Towers + 1)
 

Vaius

New Member
Reaction score
19
A: Yes, Dead_Scout_Towers is an integer.

B: Dangit, forgot the (Unit-type of (Dying unit)) Equal to Scout Tower in my trigger.
 
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