SC2Mapster Forums

Development > Triggers

Structure loop help

  • 2 posts
    #1 Nov 02, 2012 at 19:42 UTC - 0 likes

    I have no experience with functions that deal with units, so this is basically going to be a request for a completed trigger that I can use as a starting point and to learn from.

    So, can someone post a trigger that would loop through all buildings owned by a given player, totalling up the mineral cost of each building and printing the total amount to the screen?

    I am new to the SC2 Editor, but I have years of C programming experience (relevant to galaxy script).
    Send me a message if you need help with programming concepts or galaxy script syntax.
    Do not ask me how to do something specifically related to SC2 as I am not fluent with the galaxy API yet.

    #2 Nov 03, 2012 at 05:21 UTC - 0 likes

    You should really learn how to do some of this yourself as its really quite simple but here is a starting point. You'll need a local variable. Use a pick each units loop with matchings conditions in regions; conditions being structures. Within the loop add the modify variable action which is set to cost of picked unit. Outside of the loop at the end just a text message converting the number of the variable to text.

    When I want your opinion...I'll give it to you!

    http://www.sc2pod.com/achievement.php?id=13361

  • 2 posts

You must login to post a comment. Don't have an account? Register to get one!