1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Solved] Pick Every Unit And Do Action

Discussion in 'Triggers & Scripts' started by Crepuscular, May 31, 2013.

  1. Crepuscular

    Crepuscular

    Joined:
    May 31, 2013
    Messages:
    19
    Resources:
    0
    Resources:
    0
    Hello. I got this problem...
    i Made this trigger but the problem is that i want an action to be performed only ONCE not once every picked unit. as a result of this trigger depending on how many units are picked that amount of messages and damages are done. To be clear - i want that if supply used by picked units is higher than supply limit then do damage(ONCE) to all living units and show message (ONCE).

    • Events
      • Time - Every 10.00 seconds of game time
      • Conditions
      • Actions
        • Player Group - Pick every player in Player Group - Player 1 (Red) and do (Actions)
          • Actions -
            • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
              • Actions -
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Number of units in (Units owned by (Picked player) matching ((Supply used by (Picked unit)) Higher Than (>) 0))) Higher Than (>) ((Picked player) Food Limit)
                  • Then - Actions
                    • Game - Display to (Player group((Picked player))) for 20.00 seconds the text: |cffff0000Food Shor...
                    • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
                      • Actions -
                        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditionsi
                            • ((Picked unit) is Building) Equal to (==) NO
                          • Then - Actions
                            • Unit - Cause Stone Wall (V) 0746 <gen> to damage circular area after 0.00 seconds of radius 5.00 at (Position of (Picked unit)), dealing 10.00 damage of attack type Magic and damage type Normal
                          • Else - Actions
                  • Else - Actions
     
    Last edited: May 31, 2013
  2. Hell_Master

    Hell_Master

    Joined:
    Nov 29, 2012
    Messages:
    5,512
    Resources:
    4
    Maps:
    3
    Template:
    1
    Resources:
    4
    Turn off Trigger. through this:

    • Trigger - Turn off (This trigger)

    Just put it maybe in the ITEs or should we say If/Then/Else. If it bugs try putting it at the end of the trigger.
     
  3. Crepuscular

    Crepuscular

    Joined:
    May 31, 2013
    Messages:
    19
    Resources:
    0
    Resources:
    0
    it doesnt solve the problem because! it runs once then it turns off and i want it to be periodic event plus it still shows messages and does damages based on the number of picked units
     
  4. Hell_Master

    Hell_Master

    Joined:
    Nov 29, 2012
    Messages:
    5,512
    Resources:
    4
    Maps:
    3
    Template:
    1
    Resources:
    4
    Wrap it in TRIGGER tags.
     
  5. Crepuscular

    Crepuscular

    Joined:
    May 31, 2013
    Messages:
    19
    Resources:
    0
    Resources:
    0
    This is the trigger:
    food shortage
    • Event
    • Time - Every 10.00 seconds of game time
    • Condition
    • Action
    • Player Group - Pick every player in Player Group - Player 1 (red) and do (Actions)
    • Actions -
    • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
    • Actions -
    • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Condition
    • (Number of units in (Units owned by (Picked player) matching ((Supply used by (Picked unit)) Higher than (>) 0))) Higher Than(>) ((Picked player) Food Limit)
    • Then - Action
      • Game - Display to (Player group((Picked player))) for 20.00 seconds the text: |cffff0000Food Shor...
      • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
        • Actions -
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is Budynek) Equal to (==) NIE
            • Then - Actions
              • Unit - Cause Stone Wall (V) 0746 <gen> to damage circular area after 0.00 seconds of radius 5.00 at (Position of (Picked unit)), dealing 10.00 damage of attack type Magic and damage type Normal
            • Else - Actions
      • Else - Actions
     
  6. Hell_Master

    Hell_Master

    Joined:
    Nov 29, 2012
    Messages:
    5,512
    Resources:
    4
    Maps:
    3
    Template:
    1
    Resources:
    4
    Hmmm try turning off trigger and put it at the END. Just try if it does not work, well I cant find more solution...
     
  7. Crepuscular

    Crepuscular

    Joined:
    May 31, 2013
    Messages:
    19
    Resources:
    0
    Resources:
    0
    i tired that it didnt helped with the problem + trigger runned only once
     
  8. Hell_Master

    Hell_Master

    Joined:
    Nov 29, 2012
    Messages:
    5,512
    Resources:
    4
    Maps:
    3
    Template:
    1
    Resources:
    4
    And I think your trigger is quite mess up: Please do go to your trigger, right click it and Convert to Custom Text and paste it here so the triggers will be more understandable.

    I might help you more. =)
     
  9. Crepuscular

    Crepuscular

    Joined:
    May 31, 2013
    Messages:
    19
    Resources:
    0
    Resources:
    0
    The problem is my UMSWE is in mixed languages
    • food shortage
      • Wydarzenia
        • Czas - Every 10.00 seconds of game time
      • Warunki
      • Akcje
        • Grupa graczy - Pick every player in Grupa gracza - Gracz 1 (Czerwony) and do (Actions)
          • PÄ™tla - Akcje
            • Grupa jednostek - Pick every unit in (Units owned by (Picked player)) and do (Actions)
              • PÄ™tla - Akcje
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • JeĹ›li - Warunki
                    • (Number of units in (Units owned by (Picked player) matching ((Supply used by (Picked unit)) WiÄ™ksze niĹĽ (>) 0))) WiÄ™ksze niĹĽ (>) ((Picked player) Ograniczenie ĹĽywnoĹ›ci)
                  • To - Akcje
                    • Gra - Display to (Player group((Picked player))) for 20.00 seconds the text: |cffff0000Food Shor...
                    • Grupa jednostek - Pick every unit in (Units owned by (Picked player)) and do (Actions)
                      • PÄ™tla - Akcje
                        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • JeĹ›li - Warunki
                            • ((Picked unit) is Budynek) RĂłwna siÄ™ (==) NIE
                          • To - Akcje
                            • Jednostka - Cause Stone Wall (V) 0746 <gen> to damage circular area after 0.00 seconds of radius 5.00 at (Position of (Picked unit)), dealing 10.00 damage of attack type ZaklÄ™cia and damage type Normalny
                          • Albo - Akcje
                            • Do nothing
                  • Albo - Akcje
     
  10. Hell_Master

    Hell_Master

    Joined:
    Nov 29, 2012
    Messages:
    5,512
    Resources:
    4
    Maps:
    3
    Template:
    1
    Resources:
    4
    Awww, I can only understand some, maybe just wait for someone to help you... my knowledge is quite limited in triggers.
     
  11. MasterTrainer

    MasterTrainer

    Joined:
    Apr 14, 2012
    Messages:
    2,768
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Spells:
    1
    Resources:
    3
    Why are you using a Player Group action when you only use Player 1 (Red)?
     
  12. Hell_Master

    Hell_Master

    Joined:
    Nov 29, 2012
    Messages:
    5,512
    Resources:
    4
    Maps:
    3
    Template:
    1
    Resources:
    4
    Good eye. I will ask also the same question.... There is no more player in a player... XD
     
  13. MasterTrainer

    MasterTrainer

    Joined:
    Apr 14, 2012
    Messages:
    2,768
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Spells:
    1
    Resources:
    3
    Also, if you want it to show the message once, why use it in a periodic trigger?
     
  14. Doomlord

    Doomlord

    Joined:
    Dec 15, 2011
    Messages:
    1,150
    Resources:
    14
    Spells:
    12
    JASS:
    2
    Resources:
    14
    Try and put this right after the damage dealing line.

    • Custom script: return


    Get rid of the Do Nothing too. It is the most wasteful thing ever. The best troll pulled by Blizzard.
     
  15. MasterTrainer

    MasterTrainer

    Joined:
    Apr 14, 2012
    Messages:
    2,768
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Spells:
    1
    Resources:
    3
    Also, UMSWE is bugged. Very bugged. Also WEU. I recommend you use the JassNewGenPack, or the normal World Editor.
     
  16. Crepuscular

    Crepuscular

    Joined:
    May 31, 2013
    Messages:
    19
    Resources:
    0
    Resources:
    0
    umswe is included in jassnewgenpack -_- i have it btw. i use only one player because im testing it on one then ill make it up to 10. just gonna change the player numbers. i use player group action because if i use pick every player in all players it produces some leaks and random stuff happen so instead i use player group for every player ;P works perfect for me.

    Doomlord - still nth changed

    oh sry i used to work on umswe like couple years ago it seems its New Gen World Editor but its from jassnewgenpack ;P
     
  17. Doomlord

    Doomlord

    Joined:
    Dec 15, 2011
    Messages:
    1,150
    Resources:
    14
    Spells:
    12
    JASS:
    2
    Resources:
    14
    Could you show me the new code?
     
  18. Crepuscular

    Crepuscular

    Joined:
    May 31, 2013
    Messages:
    19
    Resources:
    0
    Resources:
    0
    food shortage - btw i did got rid of do nothing xD i dont know why its there xD i might have tried to use it and see if it solves but then forgot to delete ;P
    • Events
      • Time - Every 10.00 seconds of game time
      • Conditions
      • Actions
        • Player Group - Pick every player in Player Group - Player 1 (Red) and do (Actions)
          • Actions -
            • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
              • Actions -
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Number of units in (Units owned by (Picked player) matching ((Supply used by (Picked unit)) Higher Than (>) 0))) Higher Than (>) ((Picked player) Food Limit)
                  • Then - Actions
                    • Game - Display to (Player group((Picked player))) for 20.00 seconds the text: |cffff0000Food Shor...
                    • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
                      • Actions -
                        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditionsi
                            • ((Picked unit) is Building) Equal to (==) NO
                          • Then - Actions
                            • Unit - Cause Stone Wall (V) 0746 <gen> to damage circular area after 0.00 seconds of radius 5.00 at (Position of (Picked unit)), dealing 10.00 damage of attack type Magic and damage type Normal
                            • Custom script: return
                          • Else - Actions
                  • Else - Actions


    i try to translate triggers... takes damn time.
     
    Last edited: May 31, 2013
  19. MasterTrainer

    MasterTrainer

    Joined:
    Apr 14, 2012
    Messages:
    2,768
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Spells:
    1
    Resources:
    3
    Don't use UMSWE still. Maybe your jassnewgenpack is outdated; rally outdated. Anyways try a trigger for all 10 players.

    Please be reminded that not all of us can understand that language.
     
  20. Doomlord

    Doomlord

    Joined:
    Dec 15, 2011
    Messages:
    1,150
    Resources:
    14
    Spells:
    12
    JASS:
    2
    Resources:
    14
    Get rid of the return and try this instead.

    Custom script: exitwhen true