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

[Trigger] Is this trigger fine?

Status
Not open for further replies.
Level 15
Joined
Aug 11, 2009
Messages
1,606
Is trigger fine?Any way to improve it?Or any leaks?
  • AddArtifact
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ArtifactInteger = (Random integer number between 1 and 11)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ArtifactInteger Less than or equal to 1
        • Then - Actions
          • Item - Create Ancient Skull at (Random point in ArtifactRegion <gen>)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ArtifactInteger Less than or equal to 3
              • ArtifactInteger Not equal to 0
              • ArtifactInteger Not equal to 1
            • Then - Actions
              • Item - Create Ancient Skull at (Random point in ArtifactRegion1 <gen>)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ArtifactInteger Less than or equal to 5
                  • ArtifactInteger Not equal to 0
                  • ArtifactInteger Not equal to 1
                  • ArtifactInteger Not equal to 2
                  • ArtifactInteger Not equal to 3
                • Then - Actions
                  • Item - Create Ancient Skull at (Random point in ArtifactRegion2 <gen>)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ArtifactInteger Less than or equal to 7
                      • ArtifactInteger Not equal to 0
                      • ArtifactInteger Not equal to 1
                      • ArtifactInteger Not equal to 2
                      • ArtifactInteger Not equal to 3
                      • ArtifactInteger Not equal to 4
                      • ArtifactInteger Not equal to 5
                    • Then - Actions
                      • Item - Create Ancient Skull at (Random point in ArtifactRegion3 <gen>)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ArtifactInteger Less than or equal to 9
                          • ArtifactInteger Not equal to 0
                          • ArtifactInteger Not equal to 1
                          • ArtifactInteger Not equal to 2
                          • ArtifactInteger Not equal to 3
                          • ArtifactInteger Not equal to 4
                          • ArtifactInteger Not equal to 5
                          • ArtifactInteger Not equal to 6
                          • ArtifactInteger Not equal to 7
                        • Then - Actions
                          • Item - Create Ancient Skull at (Random point in ArtifactRegion4 <gen>)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ArtifactInteger Less than or equal to 11
                              • ArtifactInteger Not equal to 0
                              • ArtifactInteger Not equal to 1
                              • ArtifactInteger Not equal to 2
                              • ArtifactInteger Not equal to 3
                              • ArtifactInteger Not equal to 4
                              • ArtifactInteger Not equal to 5
                              • ArtifactInteger Not equal to 6
                              • ArtifactInteger Not equal to 7
                              • ArtifactInteger Not equal to 8
                              • ArtifactInteger Not equal to 9
                            • Then - Actions
                              • Item - Create Ancient Skull at (Random point in ArtifactRegion5 <gen>)
                            • Else - Actions
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
ok,thx i will update it in a sec.
EDIT:eek:k is this one better?
  • AddArtifact
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ArtifactInteger = (Random integer number between 1 and 6)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ArtifactInteger Equal to 1
        • Then - Actions
          • Item - Create Ancient Skull at (Random point in ArtifactRegion <gen>)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ArtifactInteger Equal to 2
            • Then - Actions
              • Item - Create Ancient Skull at (Random point in ArtifactRegion1 <gen>)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ArtifactInteger Equal to 3
                • Then - Actions
                  • Item - Create Ancient Skull at (Random point in ArtifactRegion2 <gen>)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ArtifactInteger Equal to 4
                    • Then - Actions
                      • Item - Create Ancient Skull at (Random point in ArtifactRegion3 <gen>)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ArtifactInteger Equal to 5
                        • Then - Actions
                          • Item - Create Ancient Skull at (Random point in ArtifactRegion4 <gen>)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ArtifactInteger Equal to 6
                            • Then - Actions
                              • Item - Create Ancient Skull at (Random point in ArtifactRegion5 <gen>)
                            • Else - Actions
 
Level 11
Joined
Feb 14, 2009
Messages
884
actually no it is equal to 0 and 10 :p
EDIT:Nice signature...if you can read this you really need to get aid?

You don't need to get aid, you need to get laid :xxd:

Plus, locations leak. You should store them in a variable and destroy them at the end of the trigger.

  • Actions
    • set ItemSpawn = (Random point in (ArtifactRegionX))
    • Custom script: call RemoveLocation(udg_ItemSpawn)
 
Level 5
Joined
Dec 18, 2007
Messages
205
it is better, but you could still improve it by making it this way:

  • AddArtifact
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Integer = (Random integer number between 1 and 6)
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • Integer equalto (Integer A)
            • 'THEN'-Aktionen
              • Set Location = (Random point in Gebiet_Array[(Integer A)])
              • Item - Create ITEM at Location
              • Custom script: call RemoveLocation(udg_Location)
            • 'ELSE'-Aktionen
Gebiet_Array would be set (maybe in the same trigger at the top) to all areas.
e.g.
gebiet_array[1]=ArtifactRegion
gebiet_array[2]=ArtifactRegion1

etc.

greetings
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
You don't need to get aid, you need to get laid :xxd:

Plus, locations leak. You should store them in a variable and destroy them at the end of the trigger.

  • Actions
    • set ItemSpawn = (Random point in (ArtifactRegionX))
    • Custom script: call RemoveLocation(udg_ItemSpawn)

and what is laid supposed to mean?I'm grom greece :/
and bReathl3sS thx about your time but i don't want it this way.
is this trigger now ok?
  • AddArtifact
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ArtifactInteger = (Random integer number between 1 and 6)
      • Set ArtifactPoint = (Center of ArtifactRegion <gen>)
      • Set ArtifactPoint1 = (Center of ArtifactRegion1 <gen>)
      • Set ArtifactPoint2 = (Center of ArtifactRegion2 <gen>)
      • Set ArtifactPoint3 = (Center of ArtifactRegion3 <gen>)
      • Set ArtifactPoint4 = (Center of ArtifactRegion4 <gen>)
      • Set ArtifactPoint5 = (Center of ArtifactRegion5 <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ArtifactInteger Equal to 1
        • Then - Actions
          • Item - Create Ancient Skull at ArtifactPoint
          • Custom script: call RemoveLocation(udg_ArtifactPoint)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ArtifactInteger Equal to 2
            • Then - Actions
              • Item - Create Ancient Skull at ArtifactPoint1
              • Custom script: call RemoveLocation(udg_ArtifactPoint1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ArtifactInteger Equal to 3
                • Then - Actions
                  • Item - Create Ancient Skull at ArtifactPoint2
                  • Custom script: call RemoveLocation(udg_ArtifactPoint2)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ArtifactInteger Equal to 4
                    • Then - Actions
                      • Item - Create Ancient Skull at ArtifactPoint3
                      • Custom script: call RemoveLocation(udg_ArtifactPoint3)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ArtifactInteger Equal to 5
                        • Then - Actions
                          • Item - Create Ancient Skull at ArtifactPoint4
                          • Custom script: call RemoveLocation(udg_ArtifactPoint4)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ArtifactInteger Equal to 6
                            • Then - Actions
                              • Item - Create Ancient Skull at ArtifactPoint5
                              • Custom script: call RemoveLocation(udg_ArtifactPoint5)
                            • Else - Actions
+rep to all.
 
Level 12
Joined
Dec 10, 2008
Messages
850
Well, looking at what you have above, you still leak a location 5 times too.

So basicly, instead of 6 variables for the locations, you copy pasta setting ONE into all the Then - Action parts, changing the region. Then, at the end of your trigger, destroy it, not in the Then - Actions part.
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
ok...now how about this?
  • AddArtifact
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ArtifactInteger = (Random integer number between 1 and 6)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ArtifactInteger Equal to 1
        • Then - Actions
          • Set ArtifactPoint = (Center of ArtifactRegion <gen>)
          • Item - Create Ancient Skull at ArtifactPoint
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ArtifactInteger Equal to 2
            • Then - Actions
              • Set ArtifactPoint = (Center of ArtifactRegion1 <gen>)
              • Item - Create Ancient Skull at ArtifactPoint
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ArtifactInteger Equal to 3
                • Then - Actions
                  • Set ArtifactPoint = (Center of ArtifactRegion2 <gen>)
                  • Item - Create Ancient Skull at ArtifactPoint
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ArtifactInteger Equal to 4
                    • Then - Actions
                      • Set ArtifactPoint = (Center of ArtifactRegion3 <gen>)
                      • Item - Create Ancient Skull at ArtifactPoint
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ArtifactInteger Equal to 5
                        • Then - Actions
                          • Set ArtifactPoint = (Center of ArtifactRegion4 <gen>)
                          • Item - Create Ancient Skull at ArtifactPoint
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ArtifactInteger Equal to 6
                            • Then - Actions
                              • Set ArtifactPoint = (Center of ArtifactRegion5 <gen>)
                              • Item - Create Ancient Skull at ArtifactPoint
                            • Else - Actions
      • Custom script: call RemoveLocation(udg_ArtifactPoint)
 
Level 12
Joined
Dec 10, 2008
Messages
850
Acually it is destroyed. Its just one location, and its only used once. See, he sets it in all of them, then, when the conditions is met in game, it sets the location then. This saves time and room in the variables area. You have to kinda think a little harder and look it over as a whole to understand :p
 
Status
Not open for further replies.
Top