• 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.

Do Nothing

Status
Not open for further replies.
Level 22
Joined
Dec 31, 2006
Messages
2,216
The function DoNothing() does nothing else than decreasing the efficiency of your triggers.
Why Blizzard added is a mystery. Some people have found uses of it though, through vJASS they give it a purpose with the hook DoNothing <insert function name here>
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
there is a use, it is called GUI.
In the ROC version of an IF in GUI, you could only set one then-action and one else-action. but you NEEDED to set one, leaving it empty wasnt possible. So they inserted DoNothing() to make sure you could do nothing in such an IF, probably..
 
In some instances in GUI it's hard not too.

Code:
Spawn Hero
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                RandomHero Equal to 1
            Then - Actions
                If ((Player 1 (Red) slot status) Equal to Is playing) then do (Unit - Create 1 Magnate for Player 1 (Red) at (Player 1 (Red) start location) facing Default building facing degrees) else do (Do nothing)
                If ((Player 12 (Brown) slot status) Equal to Is playing) then do (Unit - Create 1 Wolf Rider for Player 12 (Brown) at (Player 12 (Brown) start location) facing Default building facing degrees) else do (Do nothing)
                If ((Player 10 (Light Blue) slot status) Equal to Is playing) then do (Unit - Create 1 Shadow Hunter for Player 10 (Light Blue) at (Player 10 (Light Blue) start location) facing Default building facing degrees) else do (Do nothing)
                If ((Player 2 (Blue) slot status) Equal to Is playing) then do (Unit - Create 1 Lord for Player 2 (Blue) at (Player 2 (Blue) start location) facing Default building facing degrees) else do (Do nothing)
                If ((Player 6 (Orange) slot status) Equal to Is playing) then do (Unit - Create 1 Blood Mage for Player 6 (Orange) at (Player 6 (Orange) start location) facing Default building facing degrees) else do (Do nothing)
                If ((Player 4 (Purple) slot status) Equal to Is playing) then do (Unit - Create 1 Bowmaster for Player 4 (Purple) at (Player 4 (Purple) start location) facing Default building facing degrees) else do (Do nothing)
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        RandomHero Equal to 2
                    Then - Actions
                        If ((Player 1 (Red) slot status) Equal to Is playing) then do (Unit - Create 1 Shadow Hunter for Player 1 (Red) at (Player 1 (Red) start location) facing Default building facing degrees) else do (Do nothing)
                        If ((Player 12 (Brown) slot status) Equal to Is playing) then do (Unit - Create 1 Magnate for Player 12 (Brown) at (Player 12 (Brown) start location) facing Default building facing degrees) else do (Do nothing)
                        If ((Player 10 (Light Blue) slot status) Equal to Is playing) then do (Unit - Create 1 Wolf Rider for Player 10 (Light Blue) at (Player 10 (Light Blue) start location) facing Default building facing degrees) else do (Do nothing)
                        If ((Player 2 (Blue) slot status) Equal to Is playing) then do (Unit - Create 1 Bowmaster for Player 2 (Blue) at (Player 2 (Blue) start location) facing Default building facing degrees) else do (Do nothing)
                        If ((Player 6 (Orange) slot status) Equal to Is playing) then do (Unit - Create 1 Lord for Player 6 (Orange) at (Player 6 (Orange) start location) facing Default building facing degrees) else do (Do nothing)
                        If ((Player 4 (Purple) slot status) Equal to Is playing) then do (Unit - Create 1 Blood Mage for Player 4 (Purple) at (Player 4 (Purple) start location) facing Default building facing degrees) else do (Do nothing)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                RandomHero Equal to 3
                            Then - Actions
                                If ((Player 1 (Red) slot status) Equal to Is playing) then do (Unit - Create 1 Wolf Rider for Player 1 (Red) at (Player 1 (Red) start location) facing Default building facing degrees) else do (Do nothing)
                                If ((Player 12 (Brown) slot status) Equal to Is playing) then do (Unit - Create 1 Shadow Hunter for Player 12 (Brown) at (Player 12 (Brown) start location) facing Default building facing degrees) else do (Do nothing)
                                If ((Player 10 (Light Blue) slot status) Equal to Is playing) then do (Unit - Create 1 Magnate for Player 10 (Light Blue) at (Player 10 (Light Blue) start location) facing Default building facing degrees) else do (Do nothing)
                                If ((Player 2 (Blue) slot status) Equal to Is playing) then do (Unit - Create 1 Blood Mage for Player 2 (Blue) at (Player 2 (Blue) start location) facing Default building facing degrees) else do (Do nothing)
                                If ((Player 6 (Orange) slot status) Equal to Is playing) then do (Unit - Create 1 Bowmaster for Player 6 (Orange) at (Player 6 (Orange) start location) facing Default building facing degrees) else do (Do nothing)
                                If ((Player 4 (Purple) slot status) Equal to Is playing) then do (Unit - Create 1 Lord for Player 4 (Purple) at (Player 4 (Purple) start location) facing Default building facing degrees) else do (Do nothing)
                            Else - Actions
        Trigger - Turn off (This trigger)
 
Status
Not open for further replies.
Top