Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Need help with making this specific trigger
Need help with making this specific trigger
Apr 18 2011, 7:16 am
By: m.0.n.3.y  

Apr 18 2011, 7:16 am m.0.n.3.y Post #1



So I want to double the amount of zerg units that a computer player controls when a human player builds an evolution chamber.
(the computer player controls zerg, terran and toss units)

Conditions: The human player has "unlocked" the ability to build an evolution chamber (suffered one death of 'Unlock')
Actions: The evolution chamber dies _ 5 computer player zerglings die and turn into 10 _ 5 computer player hydras die and turn into 10 _ etc. with all zerg units.


How do I make this scenario happen? That when a human player builds an evolution chamber, the zerg units of a computer controlled player essentially double or are created into other units.

I've tried multiple times to figure this out but it just doesn't work. Any ideas?

Thanks :)



None.

Apr 18 2011, 7:22 am DevliN Post #2

OVERWATCH STATUS GO

Theoretically if you have a free player slot open, you can make it another computer, and use that to help change all the units. Basically when the condition is met, have a location center on 1 Zergling owned by the original computer, create 1 Zergling at that location for the secondary computer player, and give 1 Zergling at the location to the secondary computer from the original computer. As long as you have a condition that is something like "Original computer brings at least 1 Zergling to anywhere" and "Suffered death of unlock" it will change add 1 Zergling to each existing one, and when there are none left owned by the original computer player, give all the Zerglings back to it from the secondary computer.

You could then do that for each other unit type as well.



\:devlin\: Currently Working On: \:devlin\:
My Overwatch addiction.

Apr 18 2011, 7:56 am m.0.n.3.y Post #3



Quote from DevliN
Theoretically if you have a free player slot open, you can make it another computer, and use that to help change all the units. Basically when the condition is met, have a location center on 1 Zergling owned by the original computer, create 1 Zergling at that location for the secondary computer player, and give 1 Zergling at the location to the secondary computer from the original computer. As long as you have a condition that is something like "Original computer brings at least 1 Zergling to anywhere" and "Suffered death of unlock" it will change add 1 Zergling to each existing one, and when there are none left owned by the original computer player, give all the Zerglings back to it from the secondary computer.

You could then do that for each other unit type as well.

Hmm, I think i understand what you're saying so I threw together a quick trigger to kind of test it and it didn't work. :( BTW, all players are being used, so for the "other computer player" I used player 9, will that work? I'm really tired right now so I'll read over this again tomorrow and try to make it work. But in the mean time, here's one of the other sets of triggers I tried to do to make this work before (in the order they are in, in scm draft). How does this look?

Trigger
Players
  • Player 3
  • Player 4
  • Player 5
  • Conditions
  • Current Player brings atleast 1 evolution chamber to Team 1
  • Current Player has suffered exactly 1 death of Unlock Ability
  • Actions
  • Kill all evolution chamber for current player at Team 1
  • Modify death counts for player 1 add 1 for DC Zerg
  • Preserve


  • Trigger
    Players
  • Player 1
  • Conditions
  • Current player has suffered atleast 1 deaths of DC Zerg
  • Zerg SwitchLings is Cleared
  • Zerg SwitchHydras is Cleared
  • Actions
  • Set Zerg SwitchLings
  • Set Zerg SwitchHydras
  • Preserve


  • Trigger
    Players
  • Player 1
  • Conditions
  • Current Player has suffered atleast 1 deaths of DC Zerg
  • Zerg SwitchLings is Set
  • Current Player brings atleast 5 Zergling to Battlefield
  • Actions
  • Create 10 Zergling at Holding for Current Player
  • Give 5 Zergling owned by Current Player at Battlefield to Player 9
  • Center location labeled Special Zerg on Zergling owned by Player 9 at Battlefield
  • Kill 1 zergling for Player 9 at Special Zerg
  • Move 2 Zergling for Current Player at Holding to Special Zerg
  • [Repeate the above 3 actions 5 times]
  • Clear Zerg SwitchLings
  • Preserve


  • The above trigger is repeated in basically the same way to accommodate for hydras. The changes are in the switch it uses, it uses: Zerg SwitchHydras instead of Zerg SwitchLings and in the actions it not only Clear Zerg SwitchHydras but it also does: Modify death counts for current player set to 0 for DC Zerg



    None.

    Apr 18 2011, 8:11 am DevliN Post #4

    OVERWATCH STATUS GO

    The idea is that you want the trigger to cycle through all the computer's units until it adds a unit for each one.

    Assuming Player 1 is the human player and Player 8 is the computer.

    Trigger
    Players
  • Player 1
  • Conditions
  • Player 1 commands 1 Evolution Chamber.
  • Actions
  • Modify death count for Player 8: Set to 1 for DC Zerg.
  • Remove 1 Evolution Chamber owned by Player 1 at Anywhere.


  • Trigger
    Players

  • Player 8
  • Conditions

  • Player 8 has suffered atleast 1 deaths of DC Zerg
  • Zerg SwitchLings is Cleared
  • Zerg SwitchHydras is Cleared
  • Actions

  • Set Zerg SwitchLings
  • Set Zerg SwitchHydras
  • Preserve


  • Create a 2x2 location for the next part (in this example, I'm calling it Zerg Multiply).
    Trigger
    Players

  • Player 8
  • Conditions

  • Zerg SwitchLings is Set
  • Player 8 commands at least 1 Zerg Zergling.
  • Actions

  • Center "Zerg Multiply" on 1 Zerg Zergling owned by Player 8.
  • Create 1 Zerg Zergling at "Zerg Multiply" for Player 12.
  • Give 1 Zerg Zergling at "Zerg Mutiply" to Player 12 from Player 8.
  • Preserve.

  • The above trigger will then locate each Zergling owned by the computer, create a copy and give the Zergling to Player 12.

    Once all the Zerglings are copied (and given to Player 12), the following happens:
    Trigger
    Players

  • Player 8
  • Conditions

  • Zerg SwitchLings is Set
  • Player 8 commands exactly 0 Zerg Zergling.
  • Actions

  • Give all Zerg Zerglings at Anywhere to Player 8 from Player 12.
  • Clear Zerg SwitchLings.
  • Preserve.
  • Preserve.




  • \:devlin\: Currently Working On: \:devlin\:
    My Overwatch addiction.

    Apr 18 2011, 12:08 pm 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

    I don't recommend cycling because it usually takes many trigger cycles which can cause conflicts leading to bugs.
    Use binary countoffs to double every single unit the computer controls. Like that:

    C: If P1 (computer) brings at least 512 zerglings to anywhere
    C: If Force 2 (humans) has suffered at least 1 death of unlocked
    A: create 512 zerglings for P1
    A: give 1024 zerglings to P11

    C: If P1 (computer) brings at least 256 zerglings to anywhere
    C: If Force 2 (humans) has suffered at least 1 death of unlocked
    A: create 256 zerglings for P1
    A: give 512 zerglings to P11

    ... etc. for 128, 64, 32, 16, 8, 4, 2, 1 zerglings

    And make the same trigger for every unit P1 can control that should get doubled.
    This requires a lot of repeated/similar triggers, so maybe you want to use a trigger duplicator.

    End the duplication process with this trigger
    C: If P1 controls at most 0 men
    C: If Force 2 (humans) has suffered at least 1 death of unlocked
    A: Give all men from P11 to P1
    A: Set deaths of unlocked for Force 2 to 0

    All this happens within a single trigger loop so you don't have to fear many side effects.

    ---

    However my personal recommendation is to keep it simple. Instead of trying to dynamically accurately double all unit counts (no player is looking at the replay and counting unit numbers) do it statically.
    Play a few games and estimate the point in time when players unlock their tech and then estimate unit numbers and then have 1 simple trigger (condition is still unlocked) that creates a flat amount of zerglings, hydras, mutas, etc.

    Post has been edited 1 time(s), last time on Apr 18 2011, 12:13 pm by NudeRaider.




    Apr 18 2011, 12:13 pm Lanthanide Post #6



    Whenever you do any giving of units between CPU players, make sure you use P1-8 or P12. Don't give between CPU players and P9-11, as it's possible that the unit AI will eventually bug up: http://www.staredit.net/topic/5902/



    None.

    Apr 18 2011, 5:33 pm m.0.n.3.y Post #7



    Quote from NudeRaider

    End the duplication process with this trigger
    C: If P1 controls at most 0 men
    C: If Force 2 (humans) has suffered at least 1 death of unlocked
    A: Give all men from P11 to P1
    A: Set deaths of unlocked for Force 2 to 0

    Alright, I like all this, but there are just a couple issues. I can't end it with "If p1 controls at most 0 men" because the computer will also be controlling toss and terran units as well. So maybe I could end it with: "If p1 controls at most 0 zerglings" & "If p1 controls at most 0 hydras" adding a condition for every unit?

    Quote from NudeRaider
    However my personal recommendation is to keep it simple. Instead of trying to dynamically accurately double all unit counts (no player is looking at the replay and counting unit numbers) do it statically.
    Play a few games and estimate the point in time when players unlock their tech and then estimate unit numbers and then have 1 simple trigger (condition is still unlocked) that creates a flat amount of zerglings, hydras, mutas, etc.
    Another question, I want to make it look like the units are actually doubling individually, so when I create the extra units should I create them in a far off part of the map and then center a location on each individual ling owned by p12 at the battlefield and then move a ling from the far off part of the map next to a ling on the battlefield?


    So basically, I need a trigger that will more or less double the zerg units that the computer player controls. Not REALLY double because I need to control the amount of units on the map for balancing etc. The computer player is also in a set portion of the map and is fighting another computer player, so i need to make it look pretty cool and like each unit is more or less duplicated individually.
    :devlin:

    Post has been edited 1 time(s), last time on Apr 18 2011, 6:05 pm by m.0.n.3.y.



    None.

    Apr 18 2011, 6:05 pm NudeRaider Post #8

    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

    men is independent from race. So if you want to duplicate only 1 race then add every unit of that race to the condition, as you suggested. It's only like 10, which isn't much.
    Alternatively you could give all remaining men to P11 after the binary count-off doubled all the units you want.

    If you want to create/move them next to existing units you'll have to take the cycling route. Mine won't work.




    Apr 18 2011, 7:25 pm jjf28 Post #9

    Cartography Artisan

    randomely saw you in KHD yesterday ;)

    if you have 2 intermitant spawn location (where they spawn at before being moved to the field, like in queen/night) this will work nicely

    So in your spawn triggers,
    - first make sure the units spawn as invincible
    - next have the units spawn for the first teams player, and the other teams player, at current teams spawn location (doubling each spawn)

    Now in separate triggers
    - If current player has suffered one death of "double spawn" give all units at "current teams spawning location" to current team... (if your move (to field) triggers are separate simply have them run after this, otherwise move them with your next action)
    - if current player has suffered 0 death of "double spawn" remove all units for "opposite team" at current teams spawn loaction

    Edit: CCMU could be an issue with this method, best of luck



    TheNitesWhoSay - Clan Aura - github

    Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

    Apr 18 2011, 7:29 pm m.0.n.3.y Post #10



    Quote from DevliN
    The idea is that you want the trigger to cycle through all the computer's units until it adds a unit for each one.

    Assuming Player 1 is the human player and Player 8 is the computer.

    .......

    So I tried doing this and set up the triggers to do just lings for now....but it doesn't work.
    I think it changes the lings to the neutral player by looking at the mini map but it's hard to tell cause it goes so fast.
    The problem is that it doesn't create more zerglings for some reason. Everything just stays the same :(
    It would probably be easier if you just looked at the triggers yourself.

    Quote from NudeRaider
    If you want to create/move them next to existing units you'll have to take the cycling route. Mine won't work.

    What about your infestation special in d strike. It seems like that creates a broodling at an existing unit, so wouldn't I just have to set my thing up in the same manner except have it detect which unit it is affecting and then have it create a specific unit, rather than a broodling?



    None.

    Apr 18 2011, 7:30 pm DevliN Post #11

    OVERWATCH STATUS GO

    Quote from m.0.n.3.y
    Quote from DevliN
    The idea is that you want the trigger to cycle through all the computer's units until it adds a unit for each one.

    Assuming Player 1 is the human player and Player 8 is the computer.

    .......

    So I tried doing this and set up the triggers to do just lings for now....but it doesn't work.
    I think it changes the lings to the neutral player by looking at the mini map but it's hard to tell cause it goes so fast.
    The problem is that it doesn't create more zerglings for some reason. Everything just stays the same :(
    It would probably be easier if you just looked at the triggers yourself.

    Quote from NudeRaider
    If you want to create/move them next to existing units you'll have to take the cycling route. Mine won't work.

    What about your infestation special in d strike. It seems like that creates a broodling at an existing unit, so wouldn't I just have to set my thing up in the same manner except have it detect which unit it is affecting and then have it create a specific unit, rather than a broodling?
    It may not work because I can't remember if triggers can create units for Player 12 or if they have to be preplaced. My method would therefore only work if you had an open player slot.



    \:devlin\: Currently Working On: \:devlin\:
    My Overwatch addiction.

    Apr 18 2011, 7:45 pm m.0.n.3.y Post #12



    Quote from DevliN
    Quote from m.0.n.3.y
    Quote from DevliN
    The idea is that you want the trigger to cycle through all the computer's units until it adds a unit for each one.

    Assuming Player 1 is the human player and Player 8 is the computer.

    .......

    So I tried doing this and set up the triggers to do just lings for now....but it doesn't work.
    I think it changes the lings to the neutral player by looking at the mini map but it's hard to tell cause it goes so fast.
    The problem is that it doesn't create more zerglings for some reason. Everything just stays the same :(
    It would probably be easier if you just looked at the triggers yourself.

    Quote from NudeRaider
    If you want to create/move them next to existing units you'll have to take the cycling route. Mine won't work.

    What about your infestation special in d strike. It seems like that creates a broodling at an existing unit, so wouldn't I just have to set my thing up in the same manner except have it detect which unit it is affecting and then have it create a specific unit, rather than a broodling?
    It may not work because I can't remember if triggers can create units for Player 12 or if they have to be preplaced. My method would therefore only work if you had an open player slot.

    Unless..I simply created 1 zergling for the computer player and then gave both of the zerglings to neutral..
    There's really no difference between creating 1 zergling for the neutral or the computer player, because the both get turned into neutral like .000000000000001 seconds later.



    None.

    Apr 18 2011, 7:48 pm DevliN Post #13

    OVERWATCH STATUS GO

    If you create 1 Zergling for the computer player, there's a chance the trigger will think that is another Zergling to focus on and therefore add an endless amount of Zerglings. Its a slim chance, but still possible I think. A better solution would be to give all the Computer units to Player 12 when the death count is 1, then have my above trigger center the location on Zerglings owned by Player 12, create 1 for the Computer and give the Zergling to the Computer. The trigger would end when Player 12 commands exactly 0 Zerglings.



    \:devlin\: Currently Working On: \:devlin\:
    My Overwatch addiction.

    Apr 18 2011, 7:53 pm m.0.n.3.y Post #14



    Quote from DevliN
    If you create 1 Zergling for the computer player, there's a chance the trigger will think that is another Zergling to focus on and therefore add an endless amount of Zerglings. Its a slim chance, but still possible I think. A better solution would be to give all the Computer units to Player 12 when the death count is 1, then have my above trigger center the location on Zerglings owned by Player 12, create 1 for the Computer and give the Zergling to the Computer. The trigger would end when Player 12 commands exactly 0 Zerglings.
    Not necessarily. I just tested it and it seems to work with the lings.

    Trigger
    Players
  • Player 1
  • Conditions
  • Current Player has suffered atleast 1 death of Unlock Zerg
  • Zerg SwitchLings is Set
  • Current Player brings atleast 1 Zergling to Battlefield
  • Actions
  • Center location Special Zerg on 1 Zergling owned by Current Player at Battlefield
  • Create 1 Zergling at Special Zerg for Current Player
  • Give 2 Zergling owned by Current Player at Special Zerg to Neutral
  • Preserve


  • I think the reason it doesn't continue endlessly is because it gives both of the lings to neutral before the trigger has time to detect the lings again. Yeah? :)



    None.

    Apr 18 2011, 7:55 pm DevliN Post #15

    OVERWATCH STATUS GO

    Ah, I misunderstood. That makes sense, yes. :D



    \:devlin\: Currently Working On: \:devlin\:
    My Overwatch addiction.

    Apr 18 2011, 8:02 pm m.0.n.3.y Post #16



    Cool! I think I finally got this! Thanks so much guys! But don't lock this topic just yet please :)

    1 more simply question
    if you use the kill trigger to kill an infested terran, does it's attack still go off, like can it hurt other things?



    None.

    Apr 18 2011, 8:17 pm m.0.n.3.y Post #17



    And yet, the problems never seem to go away. Once I added in the same exact triggers for the hydras (duplicate the hydras) it broke. They did like you said and duplicated endlessly. I think there are just too many triggers to go through for the system and it has trouble converting all the units to neutral player in time...

    now wtf...lol

    any way around this :flamer:



    None.

    Apr 18 2011, 8:20 pm DevliN Post #18

    OVERWATCH STATUS GO

    Try my other suggestion. Give all the units to P12 first.



    \:devlin\: Currently Working On: \:devlin\:
    My Overwatch addiction.

    Apr 18 2011, 11:17 pm m.0.n.3.y Post #19



    Quote from DevliN
    Try my other suggestion. Give all the units to P12 first.
    Nope, still doesn't work
    It works when there are just the 2 triggers for the lings, but when I add in the triggers to convert the hydras as well it creates units infinitely.

    .......
    The triggers for the effects are under player one at the very bottom under Abilities - Zerg Abilities

    The triggers that occur when the evolution chamber is created (destroy the evolution chamber etc.) are under players 3,4,5 - and are the first 2 triggers under Abilities

    Attachments:
    !rvb.scx
    Hits: 1 Size: 63.53kb



    None.

    Apr 18 2011, 11:19 pm DevliN Post #20

    OVERWATCH STATUS GO

    I can't check it now since I'm at work, but the only thing I can think of is that you're using the same location for both types of units, or that the condition still says Zergling for the Hydralisk triggers.

    I can check it tonight if you don't figure it out by then.



    \:devlin\: Currently Working On: \:devlin\:
    My Overwatch addiction.

    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [06:51 pm]
    Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
    [06:50 pm]
    NudeRaider -- Vrael
    Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
    sounds like moisture control is often a pressing concern in your city
    [06:50 pm]
    Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
    [06:49 pm]
    Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
    [06:48 pm]
    Vrael -- On this Topic, I could definitely use some Introductions.
    [06:48 pm]
    Vrael -- Perhaps that utilizes cutting-edge technology and eco-friendly cleaning products?
    [06:47 pm]
    Vrael -- Do you know anyone with a deep understanding of the unique characteristics of your carpets, ensuring they receive the specialized care they deserve?
    [06:45 pm]
    NudeRaider -- Vrael
    Vrael shouted: I've also recently becoming interested in Carpet Cleaning, but I'd like to find someone with a reputation for unparalleled quality and attention to detail.
    beats me, but I'd make sure to pick the epitome of excellence and nothing less.
    [06:41 pm]
    Vrael -- It seems like I may need Introductions to multiple companies for the Topics that I care deeply about, even as early as Today, 6:03 am.
    [06:38 pm]
    Vrael -- I need a go-to solution and someone who understands that Carpets are more than just decorative elements in my home.
    Please log in to shout.


    Members Online: lil-Inferno, Vrael, Roy