Will this trigger work?

mystic_elf

New Member
Reaction score
2
Note: Not done yet. Still need WEU to create the custom script to remove the variables.

Alright, so I have a portal that spawns 2 grunts every 60 seconds. And every 120 seconds it upgrades up one spawn every 60 seconds. Will this work? And is there a better way to create the trigger? I don't want to copy and paste 40 times ><

JASS:
Dark Portal Spawn
    Events
        Time - Every 60.00 seconds of game time
    Conditions
        (The Dark Portal 0177 &lt;gen&gt; is alive) Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in (Units owned by Player 1 (Red) of type Hillsbrad)) Equal to 1
            Then - Actions
                Set DarkPortalSpawn = (Center of DarkPortalSpawn &lt;gen&gt;)
                Unit - Create 2 Grunt for Player 1 (Red) at DarkPortalSpawn facing Default building facing degrees
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in (Units owned by Player 1 (Red) of type Hillsbrad)) Equal to 2
                    Then - Actions
                        Set DarkPortalSpawn = (Center of DarkPortalSpawn &lt;gen&gt;)
                        Unit - Create 4 Grunt for Player 1 (Red) at DarkPortalSpawn facing Default building facing degrees
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Number of units in (Units owned by Player 1 (Red) of type Hillsbrad)) Equal to 3
                            Then - Actions
                                Set DarkPortalSpawn = (Center of DarkPortalSpawn &lt;gen&gt;)
                                Unit - Create 6 Grunt for Player 1 (Red) at DarkPortalSpawn facing Default building facing degrees
                            Else - Actions
 

trb92

Throwing science at the wall to see what sticks
Reaction score
142
>And is there a better way to create the trigger?

Actually, yeah, there is. Well maybe not better, but much much shorter and does the same thing.

Code:
Dark Portal Spawn
    Events
        Time - Every 60.00 seconds of game time
    Conditions
        (The Dark Portal 0177 <gen> is alive) Equal to True
    Actions
        Set DarkPortalSpawn = (Center of DarkPortalSpawn <gen>)
        Unit - Create ((Number of living Hillsbrad units owned by Player 1 (Red)) x 2) Grunt for Player 1 (Red) at DarkPortalSpawn facing Default building facing degrees
       Custom Script:    call RemoveLocation(udg_DarkPortalSpawn)

Oh, and you used JASS tags. They are only for JASS code, use CODE tags for GUI from now on please.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top