1. Head to the 33rd Modeling Contest Poll and drink to your heart's desire.
    Dismiss Notice
  2. Choose your means of doom in the 17th Mini Mapping Contest Poll.
    Dismiss Notice
  3. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  4. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  5. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  6. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  7. 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
    when i put that map wont even start. it shows game interface
    when i saved it it showed me syntax error
     
  2. Doomlord

    Doomlord

    Joined:
    Dec 15, 2011
    Messages:
    1,150
    Resources:
    14
    Spells:
    12
    JASS:
    2
    Resources:
    14
    I am sorry, it is supposed to be exitwhen == true
     
  3. Crepuscular

    Crepuscular

    Joined:
    May 31, 2013
    Messages:
    19
    Resources:
    0
    Resources:
    0
    again syntax error
    • Custom script: exitwhen == true
     
  4. Doomlord

    Doomlord

    Joined:
    Dec 15, 2011
    Messages:
    1,150
    Resources:
    14
    Spells:
    12
    JASS:
    2
    Resources:
    14
    Well, I give up. If only there is a computer so I can work out the code for you. I am on a phone right now so I don't have access to WE.

    My apologies for not being able to help.
     
  5. Crepuscular

    Crepuscular

    Joined:
    May 31, 2013
    Messages:
    19
    Resources:
    0
    Resources:
    0
    well either way - thx for trying
     
  6. MasterTrainer

    MasterTrainer

    Joined:
    Apr 14, 2012
    Messages:
    2,769
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Spells:
    1
    Resources:
    3
    It will of course be a syntax error because you don'y check any value.
     
  7. Crepuscular

    Crepuscular

    Joined:
    May 31, 2013
    Messages:
    19
    Resources:
    0
    Resources:
    0
    so... what can i do with that ?
     
  8. MasterTrainer

    MasterTrainer

    Joined:
    Apr 14, 2012
    Messages:
    2,769
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Spells:
    1
    Resources:
    3
    You can check if an integer variable is equal to a specific value; also you return function does not return anything; put in a specific value or remove it. In this case the value I think should be a player.
     
  9. Crepuscular

    Crepuscular

    Joined:
    May 31, 2013
    Messages:
    19
    Resources:
    0
    Resources:
    0
    i never did any custom scripts so i kinda dont have an idea what are you talking about ;P as to the integr value i cant put it to specific number because it depends on supply used
     
  10. MasterTrainer

    MasterTrainer

    Joined:
    Apr 14, 2012
    Messages:
    2,769
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Spells:
    1
    Resources:
    3
    Never mind. Remove that custom script.

    Tell me, what is your current problem right now?
     
  11. Crepuscular

    Crepuscular

    Joined:
    May 31, 2013
    Messages:
    19
    Resources:
    0
    Resources:
    0
    the same as before it is written in first post.
     
    Last edited: May 31, 2013
  12. MasterTrainer

    MasterTrainer

    Joined:
    Apr 14, 2012
    Messages:
    2,769
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Spells:
    1
    Resources:
    3
    Post a test map.
     
  13. Crepuscular

    Crepuscular

    Joined:
    May 31, 2013
    Messages:
    19
    Resources:
    0
    Resources:
    0
    why would you need that ? the trigger is obvious my map is huge and have more than 130 triggers you woudnt know wth is going on either way ;P + i dont really wanna post unproteced maps.
     
  14. MasterTrainer

    MasterTrainer

    Joined:
    Apr 14, 2012
    Messages:
    2,769
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Spells:
    1
    Resources:
    3
    No I mean put the trigger in a completely unrelated map. Then post that map.
     
  15. Legal_Ease

    Legal_Ease

    Joined:
    Feb 8, 2013
    Messages:
    1,453
    Resources:
    28
    Icons:
    11
    Packs:
    1
    Skins:
    2
    Maps:
    10
    Template:
    1
    Tutorials:
    3
    Resources:
    28
    Create a new trigger that is initially off.

    Turn it on with the trigger you are using to select the unit group. Turn that trigger off at the end.

    The new trigger will do your action. I'm assuming this is some type of starve damage. (Please explain exactly what the system is supposed to do. You first post is helpful but still not completely clear.)

    Then have the new trigger turn off at the end and turn the first trigger back on.

    This will create a loop and separate your actions into two triggers so that you can work with them in a more organized way.

    There are many ways to do this, but this is one I like to use. You can also loop actions with "multiple functions." There maybe many more solutions as well. This seems like a fairly simple system with a really cool effect. +1 rep to you. I think part of your problem is that you are stuck in the structure of your trigger. You are counting units and then doing the action that many times...?? I think what you want is to have it select all units in the unit group. Count the units and compare it to the food supply. There now set the variables "hungry men" (or whatever) and "little cake." Then in the other periodic event trigger and a condition, if hungry men is greater than little cake - do your action "make them starve a little." I'm sorry I'm at work and I can't test it or write it out for you. Hope this helps.

    Did you look at this?
     
    Last edited: May 31, 2013
  16. Crepuscular

    Crepuscular

    Joined:
    May 31, 2013
    Messages:
    19
    Resources:
    0
    Resources:
    0
    hmm

    ok now... the trigger works perfect but! not on my map suddenly when i was working on this trigger sth happened and killed a lot of my triggers its like they dont want to go... everything looks fine its just they are not running... eh... i backed up older ver put that trigger in it and now it doesnt work proper.
     

    Attached Files:

    Last edited: Jun 1, 2013
  17. MasterTrainer

    MasterTrainer

    Joined:
    Apr 14, 2012
    Messages:
    2,769
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Spells:
    1
    Resources:
    3
    Hmm... if in the test map it works then maybe something that is in your other triggers are messing it up. Maybe there was a system you imported or maybe something is leaking; check every trigger.
     
  18. Hell_Master

    Hell_Master

    Joined:
    Nov 29, 2012
    Messages:
    5,506
    Resources:
    4
    Maps:
    3
    Template:
    1
    Resources:
    4
    Not on your map? So you used another map to based the triggers and paste it in into your map? Is that what you mean?

    If yes, check your triggers and if there are alterations that happen such as ability that has been changed in the process of CnP. Also dont forget to CnP all possible triggers and custom objects used in Object Editor to your map.

    Warcraft has this issues that if you CnP triggers into the your map from test map, it will alter some triggers that is possibly doesnt have the required Variables or such to execute trigger.
     
  19. MasterTrainer

    MasterTrainer

    Joined:
    Apr 14, 2012
    Messages:
    2,769
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Spells:
    1
    Resources:
    3
    ^ For example, when you import an ability that has a trigger that checks if the cast ability is the desired ability. If ability A is not stored into a variable, then that value may easily change when imported into another map with multiple other abilities.
     
  20. Hell_Master

    Hell_Master

    Joined:
    Nov 29, 2012
    Messages:
    5,506
    Resources:
    4
    Maps:
    3
    Template:
    1
    Resources:
    4
    Exactly, thanks for the additional info you are adding to my infos. Much obliged!