Staredit Network > Forums > SC2 Assistance > Topic: I need help with..to find (Bring Trigger in Sc1 but in SC2)
I need help with..to find (Bring Trigger in Sc1 but in SC2)
Oct 7 2014, 7:02 pm
By: SHANE-009  

Oct 7 2014, 7:02 pm SHANE-009 Post #1



So...I am re-making my 7vs1 Random Computer! in SC2....But..I cannot understand..which trigger is just like bring trigger in Sc1 in to sc2...Map Editor hurts my head. LOL.

But if anyone can help me find it..that be nice..! :)

(I am getting back into Sc2..Now i got a desktop! Although its not gonna be call 7 vs 1 its [8 vs 1 Random Computer Good Luck!] But yea.)

Naw i am gonna re make just 7 vs 1. Just SC2 Way... -.-

New name: 7 vs 1 Random Computer!

Post has been edited 1 time(s), last time on Oct 9 2014, 4:03 am by SHANE-009.



New Username: Cool-Knight !
Please follow me on my site: www.cool-knight.eu.org/

Oct 8 2014, 12:00 am Ahli Post #2

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

Triggers in SC2 are event based meaning that code is executed after something generic happened. For example, a unit entered a location aka region.

In SCBW triggers were all periodically checked for their conditions.


"Bring" is a check for an amount of units of a specified unit type within a location owned by a specified player.

In SC2 you would do the following to execute code per unit in a location:
Code
Unit Group - For each unit UNIT_VARIABLE in (UNIT_TYPE units in LOCATION owned by player OWNER matching Excluded: Missile, Dead, Hidden, with at most Any Amount) do (Actions)
- a list of actions that are executed for each unit that is found and temporarily stored within UNIT_VARIABLE for you to use it


For example, this code heals all Marines owned by player 1 in region1.
Code
       Unit Group - For each unit unitVar in (Marine units in region1 owned by player 1 matching Excluded: Missile, Dead, Hidden, with at most Any Amount) do (Actions)
               Unit - Set unitVar Life (Percent) to 100.0



Bring would be a comparison of an amount of units inside a unit group. The unit group would contain all units in a region matching owner, unit type and filter as used in the code examples:
(UNIT_TYPE units in LOCATION owned by player OWNER matching Excluded: Missile, Dead, Hidden, with at most Any Amount)

I hope that helped a bit.

Anyway, what do you attempt to do?




Oct 8 2014, 12:36 am SHANE-009 Post #3



Thank, you so much! :D

"Anyway, what do you attempt to do?"

Well..re-make what I can like having tons of locations...lol..hopefully...I can just release a..version of this map..some time soon..hope get this map..just like i have in Sc1 :D

Yea..when I can..I'll try to show you. :)



New Username: Cool-Knight !
Please follow me on my site: www.cool-knight.eu.org/

Oct 9 2014, 3:33 am SHANE-009 Post #4



Sorry..I take that back....Ummmm does it look like this?


Ai(Trigger name)

Events
Local Variables
Conditions
Actions
Unit Group - For each unit Unit in (Command Center units in (Region named "P9") owned by player 9 matching Excluded: Missile, Dead, Hidden, with at most 1) do (Actions)
Actions
Unit - Create 2 Ghost for player 9 at Point 003 facing Point 003 (Under Construction)



New Username: Cool-Knight !
Please follow me on my site: www.cool-knight.eu.org/

Oct 9 2014, 7:01 am Ahli Post #5

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

That would work, yes.

Is the point directly at the CC? If yes, you could just create the ghosts next to the CC without checking regions.

Creating ghosts "under construction" won't have any effect, I believe.

Also, your trigger has no event. If you just want to have code that you re-use a couple of times, you can put it into an action definition.

Action definitions are like self-made trigger actions. You can even add parameters to them which act like variables inside the action definition. For example, you could specify the amount of ghosts that are spawned with a parameter of the type integer.




Oct 9 2014, 12:02 pm Roy Post #6

An artist's depiction of an Extended Unit Death

Or if you just want it to run once when the map starts, use the "Game - Map Initialization" event.

If you want something to run repeatedly (like a preserved trigger in SC1), use the "Timer - Periodic Event" event.




Oct 9 2014, 6:29 pm SHANE-009 Post #7



Okay..ummmm I change the trigger's like this (Name of the trigger) [If AI Terran]
  • If AI Terran
    Events
    Game - Map initialization
    Local Variables
    Conditions
    Actions
    Unit Group - For each unit Unit in (Command Center units in (Region named "P9 Main") owned by player 9 matching Excluded: Missile, Dead, Hidden, with at most Any Amount) do (Actions)
    Actions
    Unit - Create 10 SCV for player 9 at Point facing (Random point in Region 001) (Ignore Placement)

But nothing is happening.. :(

Post has been edited 1 time(s), last time on Oct 9 2014, 6:45 pm by SHANE-009.



New Username: Cool-Knight !
Please follow me on my site: www.cool-knight.eu.org/

Oct 9 2014, 9:05 pm Ahli Post #8

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

You have no event. An event is a generic situation that needs to occur for the trigger to be started.

For example, "'Any Unit' enters 'Region 1'" would start, if a unit enters "Region 1".




Oct 9 2014, 9:24 pm Roy Post #9

An artist's depiction of an Extended Unit Death

Quote from Ahli
You have no event.
Looks like he used the Map Initialization event in his most recent example.

Quote from SHANE-009
Unit - Create 10 SCV for player 9 at Point facing (Random point in Region 001) (Ignore Placement)
Did you actually specify a point for the unit to be placed at? This trigger would be automatically disabled if you leave a required field unspecified (you'll see in the trigger list it will have a little mark indicating it's disabled).

Other than that, the only reason it wouldn't do anything is if the unit group is empty.




Oct 9 2014, 11:33 pm SHANE-009 Post #10



Okay, I fixed...it!
It goes like this... ;)
  • If AI Zerg
    Events
    Game - Map initialization
    Local Variables
    Conditions
    (Count of Hatchery units in (Region((Start Location 008 reflected at Start Location 008 with normal facing 270.0), 1.0)) owned by player 8 matching Excluded: Missile, Dead, Hidden, with at most Any Amount) == 1
    Actions
    Unit - Create 10 Drone for player 8 at P9 Workers Spawns using point facing (Under Construction, Ignore Placement)


Post has been edited 1 time(s), last time on Oct 10 2014, 6:03 pm by SHANE-009.



New Username: Cool-Knight !
Please follow me on my site: www.cool-knight.eu.org/

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[10:11 pm]
Ultraviolet -- :P
[10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[2024-4-17. : 1:52 am]
Vrael -- hah do you think I was born yesterday?
Please log in to shout.


Members Online: Roy