Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Question of automatically creating large numbers of triggers
Question of automatically creating large numbers of triggers
Sep 26 2017, 6:11 pm
By: m.0.n.3.y  

Sep 26 2017, 6:11 pm m.0.n.3.y Post #1



Question of automatically creating large numbers of triggers

I have 1,380 fairly linear triggers I need to implement, and I'm wondering if there's a program or way to generate these automatically so I don't spend 10+ hours (or more) doing this. I have only used the "Classic Map Triggers" editor in SCM Draft.



This is in relation to my last post, and the situation is this: P1, P2, and P3 (Team Warm) are all on a team against P4, p5, and P6 (Team Cool). Each player controls 1 zergling throughout the game. For each player on Team Warm, I would like to track which player's zergling from Team Cool is in closest proximity to that Team Warm player's zergling. I would also like to do this for Team Cool to Team Warm.

So, I have created 10 locations for each player that center on that player's zergling. They are organized like this:


For each location 10, 9, 8, etc. there are 23 possibilities of who is closest. This is because if P4 and P5 are both in location "10" and P6 is nowhere to be found, then I randomize two switches for the game to determine who is closest between P4 and P5. So half of the time P4 will be set as the closest and half of time P5 will be (if they are both equally close). The same holds true for combinations P4 and P6; P5 and P6; and P4, P5, and P6 all being equally close.

Here's an example of some of the triggers: (a note on my organization: i use "DC" to stand for Death Counter)

P4 Is Closest To P1 So Set P4 As The Target
Players

  • Player 1
  • Conditions

  • Current Player suffered exactly 1 deaths of DC AutoTarget Initiate
  • Current Player brings exactly 1 zergling to "Field"
  • Player 4 bring exactly 1 zergling to "AutoTarget p1 10"
  • Player 5 bring exactly 0 zergling to "AutoTarget p1 9"
  • Player 6 bring exactly 0 zergling to "AutoTarget p1 9"
  • Actions

  • Modify death counts for Current Player set to 4 for DC Targeting
  • Preserve Trigger


  • P5 Is Closest To P1 So Set P5 As The Target
    Players

  • Player 1
  • Conditions

  • Current Player suffered exactly 1 deaths of DC AutoTarget Initiate
  • Current Player brings exactly 1 zergling to "Field"
  • Player 4 bring exactly 0 zergling to "AutoTarget p1 9"
  • Player 5 bring exactly 1 zergling to "AutoTarget p1 10"
  • Player 6 bring exactly 0 zergling to "AutoTarget p1 9"
  • Actions

  • Modify death counts for Current Player set to 5 for DC Targeting
  • Preserve Trigger


  • P6 Is Closest To P1 So Set P6 As The Target
    Players

  • Player 1
  • Conditions

  • Current Player suffered exactly 1 deaths of DC AutoTarget Initiate
  • Current Player brings exactly 1 zergling to "Field"
  • Player 4 bring exactly 0 zergling to "AutoTarget p1 9"
  • Player 5 bring exactly 0 zergling to "AutoTarget p1 9"
  • Player 6 bring exactly 1 zergling to "AutoTarget p1 10"
  • Actions

  • Modify death counts for Current Player set to 6 for DC Targeting
  • Preserve Trigger


  • P4 & P5 are Equidistant So Randomize
    Players

  • Player 1
  • Conditions

  • Current Player suffered exactly 1 deaths of DC AutoTarget Initiate
  • Current Player brings exactly 1 zergling to "Field"
  • Player 4 bring exactly 1 zergling to "AutoTarget p1 10"
  • Player 5 bring exactly 1 zergling to "AutoTarget p1 10"
  • Player 6 bring exactly 0 zergling to "AutoTarget p1 9"
  • Actions

  • Randomize Switch "Auto Targeting Rando 1"
  • Randomize Switch "Auto Targeting Rando 2"
  • Preserve Trigger


  • Randomization Says P4 is Closest
    Players

  • Player 1
  • Conditions

  • Current Player suffered exactly 1 deaths of DC AutoTarget Initiate
  • Current Player brings exactly 1 zergling to "Field"
  • Player 4 bring exactly 1 zergling to "AutoTarget p1 10"
  • Player 5 bring exactly 1 zergling to "AutoTarget p1 10"
  • Player 6 bring exactly 0 zergling to "AutoTarget p1 9"
  • Switch "Auto Targeting Rando 1" is Set
  • Switch "Auto Targeting Rando 2" is Set
  • Actions

  • Modify death counts for Current Player set to 4 for DC Targeting
  • Preserve Trigger



  • ....
    ....
    ....

    And so on and so on. I think you get the idea.

    In total it takes 23 triggers for each location 10, 9, 8, 7, 6, 5....etc. for a total of 230 per player. Times this by 6 players and I have 1,380 triggers and a lot of monotonous work using "Classic Map Triggers". I've heard of programs that can auto generate triggers and I thought this would be a perfect time. The triggers are pretty straight forward and predictable/programable I think.

    So can anyone help me? Is there a way to do this without spending hours of my life?

    Thanks a lot guys, and thanks for all your help so far :D



    None.

    Sep 26 2017, 7:30 pm NudeRaider Post #2

    We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

    http://www.staredit.net/sc1db/file/2989/ ... if you like lua
    http://www.staredit.net/sc1db/file/383/ ... if you like a quick and simple tool from the olden days
    http://www.staredit.net/topic/17244/ ... if you like python
    http://www.staredit.net/topic/15156/ ... if you like sweets php
    http://www.staredit.net/topic/17289/ ... if you need even more abstraction
    http://www.staredit.net/topic/16432/ ... if you like lua, chkdraft AND programming languages
    http://www.staredit.net/topic/2970/ ... if you like java
    http://www.staredit.net/topic/9581/ ... if you like to code with style




    Sep 26 2017, 9:32 pm m.0.n.3.y Post #3



    Quote from NudeRaider
    http://www.staredit.net/sc1db/file/2989/ ... if you like lua
    http://www.staredit.net/sc1db/file/383/ ... if you like a quick and simple tool from the olden days
    http://www.staredit.net/topic/17244/ ... if you like python
    http://www.staredit.net/topic/15156/ ... if you like sweets php
    http://www.staredit.net/topic/17289/ ... if you need even more abstraction
    http://www.staredit.net/topic/16432/ ... if you like lua, chkdraft AND programming languages
    http://www.staredit.net/topic/2970/ ... if you like java
    http://www.staredit.net/topic/9581/ ... if you like to code with style

    I have no programming/coding experience or knowledge, so I'm guessing this is the best one?
    ---> http://www.staredit.net/sc1db/file/383/ .



    None.

    Sep 27 2017, 1:54 am m.0.n.3.y Post #4



    Quote from NudeRaider
    http://www.staredit.net/sc1db/file/2989/ ... if you like lua
    http://www.staredit.net/sc1db/file/383/ ... if you like a quick and simple tool from the olden days
    http://www.staredit.net/topic/17244/ ... if you like python
    http://www.staredit.net/topic/15156/ ... if you like sweets php
    http://www.staredit.net/topic/17289/ ... if you need even more abstraction
    http://www.staredit.net/topic/16432/ ... if you like lua, chkdraft AND programming languages
    http://www.staredit.net/topic/2970/ ... if you like java
    http://www.staredit.net/topic/9581/ ... if you like to code with style
    Eh never mind I get a runtime error: http://www.staredit.net/sc1db/file/383/

    Thanks for the help Nude but these are all too complicated for me to use...

    Guess I'll just have to suck it up and spend the hours inputting them manually haha



    None.

    Sep 27 2017, 6:02 am NudeRaider Post #5

    We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

    There's always excel/calc. Easy to use, but a bit unwieldy when you need it to create multiple lines of text. Maybe use that for the number generation, and replace the text that's always the same with letters and use farlap to add it in later.

    Then again, TrigEditPlus (1st link) seems easy enough to learn, judging from the example.




    Sep 27 2017, 8:25 am DarkenedFantasies Post #6

    Roy's Secret Service

    If you're not using custom score, I think I have a very simplified alternative for you to try out.

    This constantly sets the player's score back to 0 at the beginning of the player's trigger cycle. A simple alternative to decreasing their score individually for each location that they leave.
    Players

  • Player 4, 5, 6
  • Conditions

  • Current Player custom score is at least 1.
  • Actions

  • Modify score for Current Player: Set to 0 custom.
  • Preserve Trigger

  • Sets the DC (that flags them as P1's target) to 0 when they leave the location if they happen to be the last/only one to leave P1's locations.
    Players

  • Player 4, 5, 6
  • Conditions

  • Current Player brings exactly 0 Zerg Zergling to 'AutoTarget p1 10'.
  • Current Player has suffered exactly 1 deaths of P1 Target Me.
  • Actions

  • Modify death counts for Current Player: Set to 0 for P1 Target Me.
  • Preserve Trigger

  • Sets score to 1 when they enter location 10
    Players

  • Player 4, 5, 6
  • Conditions

  • Current Player brings exactly 1 Zerg Zergling to 'AutoTarget p1 10'.
  • Current Player custom score is exactly 0.
  • Actions

  • Modify score for Current Player: Set to 1 custom.
  • Preserve Trigger

  • Sets score to 2 when they enter location 9
    Players

  • Player 4, 5, 6
  • Conditions

  • Current Player brings exactly 1 Zerg Zergling to 'AutoTarget p1 9'.
  • Current Player custom score is at most 1.
  • Actions

  • Modify score for Current Player: Set to 2 custom.
  • Preserve Trigger

  • and so on...
    Finally sets score to 10 when they enter location 1
    Players

  • Player 4, 5, 6
  • Conditions

  • Current Player brings exactly 1 Zerg Zergling to 'AutoTarget p1 1'.
  • Current Player custom score is at most 9.
  • Actions

  • Modify score for Current Player: Set to 10 custom.
  • Preserve Trigger

  • Sets their DC counter to 1, flagging them as P1's target, after having set allies' to 0. I suspect this will cause randomization.
    Players

  • Player 4, 5, 6
  • Conditions

  • Current Player has highest score custom.
  • Actions

  • Modify death counts for Allies: Set to 0 for P1 Target Me.
  • Modify death counts for Current Player: Set to 1 for P1 Target Me.
  • Preserve Trigger


  • In that specific order. Copy the triggers and change the locations & death counters to cover the other 2 opponents, and then ditto for the other team. The player with 1 "P1 Target Me" = the one that will be targeted by Player 1. I haven't tested it myself, but I think it should work, and I believe the way the triggers are made and ordered, it will be inherently randomized.

    Let me know what you think or how it works out for you.

    Post has been edited 3 time(s), last time on Oct 2 2017, 10:20 pm by DarkenedFantasies.




    Oct 2 2017, 1:22 pm m.0.n.3.y Post #7



    If you're not using custom score, I think I have a very simplified alternative for you to try out.

    Players

  • Player 4, 5, 6
  • Conditions

  • Current Player custom score is at least 1.
  • Actions

  • Modify score for Current Player: Set to 0 custom.
  • Preserve Trigger

  • Players

  • Player 4, 5, 6
  • Conditions

  • Current Player brings exactly 0 Zerg Zergling to 'AutoTarget p1 10'.
  • Current Player has suffered exactly 1 deaths of P1 Target Me.
  • Actions

  • Modify death counts for Current Player: Set to 0 for P1 Target Me.
  • Preserve Trigger

  • Players

  • Player 4, 5, 6
  • Conditions

  • Current Player brings exactly 1 Zerg Zergling to 'AutoTarget p1 10'.
  • Current Player custom score is exactly 0.
  • Actions

  • Modify score for Current Player: Set to 1 custom.
  • Preserve Trigger

  • Players

  • Player 4, 5, 6
  • Conditions

  • Current Player brings exactly 1 Zerg Zergling to 'AutoTarget p1 9'.
  • Current Player custom score is at most 1.
  • Actions

  • Modify score for Current Player: Set to 2 custom.
  • Preserve Trigger

  • ...
    Players

  • Player 4, 5, 6
  • Conditions

  • Current Player brings exactly 1 Zerg Zergling to 'AutoTarget p1 1'.
  • Current Player custom score is at most 9.
  • Actions

  • Modify score for Current Player: Set to 10 custom.
  • Preserve Trigger

  • Players

  • Player 4, 5, 6
  • Conditions

  • Current Player has highest score custom.
  • Actions

  • Modify death counts for Allies: Set to 0 for P1 Target Me.
  • Modify death counts for Current Player: Set to 1 for P1 Target Me.
  • Preserve Trigger


  • In that specific order. Copy the triggers and change the locations & death counters to cover the other 2 opponents, and then ditto for the other team. The player with 1 "P1 Target Me" = the one that will be targeted by Player 1. I haven't tested it myself, but I think it should work, and I believe the way the triggers are made and ordered, it will be inherently randomized.

    Let me know what you think or how it works out for you.
    Would you mind explaining to me exactly what is going on here? I don't quite understand how it works



    None.

    Oct 2 2017, 10:08 pm DarkenedFantasies Post #8

    Roy's Secret Service

    When someone from Team Cool brings their Zergling to one of Player 1's centered locations, their 'score' is modified accordingly; increasing their score as they enter the smaller locations towards Player 1 or decreasing it as they leave them, through the very first trigger.

    The player with the highest score is the one that is nearest to Player 1, so they will be targeted by Player 1 by giving them 1 death count value to use as a flag for P1's targeting triggers.

    "Highest score" condition is tied with multiple players having the same score, so depending on when Player 1 attacks, the targeting will be randomized through P4-6 constantly setting their allies DC to 0 and their own to 1, for as long as they are tied with each other in their proximity to P1.

    Duplicate these triggers for Team Cool to cover Player 2 and 3, and then repeat the process for Team Warm.

    I will edit my previous post to caption the trigger blocks, saying which does what...




    Oct 3 2017, 2:08 pm m.0.n.3.y Post #9



    When someone from Team Cool brings their Zergling to one of Player 1's centered locations, their 'score' is modified accordingly; increasing their score as they enter the smaller locations towards Player 1 or decreasing it as they leave them, through the very first trigger.

    The player with the highest score is the one that is nearest to Player 1, so they will be targeted by Player 1 by giving them 1 death count value to use as a flag for P1's targeting triggers.

    "Highest score" condition is tied with multiple players having the same score, so depending on when Player 1 attacks, the targeting will be randomized through P4-6 constantly setting their allies DC to 0 and their own to 1, for as long as they are tied with each other in their proximity to P1.

    Duplicate these triggers for Team Cool to cover Player 2 and 3, and then repeat the process for Team Warm.

    I will edit my previous post to caption the trigger blocks, saying which does what...
    Thanks man I appreciate that!

    And woah that's a pretty nifty trick regarding scores. How did you ever discover this?



    None.

    Oct 3 2017, 9:23 pm DarkenedFantasies Post #10

    Roy's Secret Service

    Well it's not really a discovery... it's simply using the score system in the same fashion as death counters, taking advantage of the "highest score" condition that is sitting in plain sight. It's just that since I'm a lazy bastard, and having a pretty much neurotic obsession with being as efficient as possible, I like to put a lot of effort into thinking how to do triggers in the most "cost-effective" way I can. :sly:




    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [12:21 am]
    Oh_Man -- Wat precisely is wrong with spellsword now?
    [12:19 am]
    Oh_Man -- Did martiss' link not work?
    [08:11 pm]
    Zoan -- Also my KOTK maps all have the nooks and crannies issue when they didn't before; what changed?
    [08:11 pm]
    Zoan -- Hey why does Spellsword not work on remastered anytmore?
    [05:53 pm]
    Ahli -- just watch a youtube video summarizing most of it, e.g. Rhykker
    [2022-5-22. : 6:04 am]
    Oh_Man -- But omg I hate Twitter so much why not use a different platform that actually has a proper word limit for these kind of discussions....... #fail
    [2022-5-22. : 6:02 am]
    Oh_Man -- Anyone who is interested in ARPG game design this is a must read. Wyatt Cheng from Blizzard went into some juicy gos on the game design decisions of D3 including scrapped mechanics and post launch. Very interesting.
    [2022-5-22. : 12:54 am]
    NudeRaider -- I'm more impressed by the on-the-fly OCR and translate
    [2022-5-21. : 4:26 pm]
    Oh_Man -- https://youtu.be/4xURBjHkRCE <- atia world is awesome
    Please log in to shout.


    Members Online: NudeRaider, Roy, lil-Inferno, jun3hong