Trigger happy
Apr 3 2008, 7:30 pm
By: Asuka22dk  

Apr 3 2008, 7:30 pm Asuka22dk Post #1



Hey everyone, I am seeking some help with some trigger for a new specil map I am working on
I need a way to count unit going over a location so I am can move them away after 3 times they move over the location
I also would like a easy way to edit what a scv can build so I can limit it to only turrent
Any help would be realy loved and you will get credit for it on the map



None.

Apr 3 2008, 8:24 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

To limit what a worker can build go into unit settings and choose the unit/building you want to disable. Then look for a checkmark saying "Enabled by default" and uncheck it.

When you want to count how often a unit enters a location using death counters (dcs) would be very helpful because they can be used as variables.
If you don't understand how to use dcs from the tutorial, just ask, I can explain it a little more.

2 triggers should do the trick:

Conditions:
Current player brings at least 1 <unit> to 'Loc A'
Current player has suffered at most 9999 deaths of 'dc'
Actions:
Add 10001 to death counts of 'dc' for current player
preserve trigger

Conditions:
Current player brings at most 0 <unit> to 'Loc A'
Current player has suffered at least 10000 deaths of 'dc'
Actions:
Subtract 10000 from death counts of 'dc' for current player
preserve trigger

Then you can do whatever actions you want in a 3rd trigger that checks either for "at least 10003 deaths" or "exactly 3 deaths", depending on if you want it to fire when it enters the location the 3rd time or it exits it the 3rd time.

What it does is add 1 to the death count when the unit enters the location, PLUS it adds 10k to make the condition untrue, so it only fires once inside the location.
When the unit exits those extra 10k counts are subtracted, making the condition for the 2nd trigger untrue, so it fires only once . So in effect it has only added 1 to the dc.




Apr 3 2008, 9:28 pm Asuka22dk Post #3



Thanks I try this and post how it went :D
I didnt get it to work
I cant get the counter to work, or if it work it count to much, I have tryed to use wait
I want 4 overlords to move around from 1 to 4, 3 times and if they do then teleport them to a new location
I use scmdraft for making it, please help :crazy:

Attachments:
trigger.JPG
Hits: 5 Size: 8.4kb

Post has been edited 4 time(s), last time on Apr 4 2008, 12:05 am by Asuka22dk.



None.

Apr 4 2008, 8:42 am NudeRaider Post #4

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

If you have 4x the same unit you will have to multiply the condition in the 3rd trigger by 4. Because every time ANY Overlords enters the location it will add 1 to the dc. In your case check for the dc to have exactly 12 counts (or at least 10012).
I suppose your 3rd trigger fired as soon as the 3rd overlord entered the location where the 1st overlord started, right?

Don't use waits. They can cause wait blocks. You can use dcs for timing. Once you understood the dc concept you'll find it very easy and powerful.




Apr 4 2008, 12:06 pm Asuka22dk Post #5



Here is my code, I hope you can see why it wont work my friend
Trigger("Player 6"){
Conditions:
Always();

Actions:
Create Unit("Player 6", "Zerg Overlord", 1, "Location 5");
Wait(300);
Create Unit("Player 6", "Zerg Overlord", 1, "Location 5");
Wait(300);
Create Unit("Player 6", "Zerg Overlord", 1, "Location 5");
Wait(300);
Create Unit("Player 6", "Zerg Overlord", 1, "Location 5");
}

//-----------------------------------------------------------------//

Trigger("Player 6"){
Conditions:
Bring("Player 6", "Any unit", "Location 5", At least, 1);
Deaths("Player 5", "Any unit", At most, 9999);

Actions:
Set Deaths("Player 5", "Any unit", Add, 10001);
Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 6"){
Conditions:
Bring("Current Player", "Any unit", "Location 5", At least, 0);
Deaths("Player 5", "Any unit", At least, 10000);

Actions:
Set Deaths("Player 5", "Any unit", Subtract, 10000);
Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 6"){
Conditions:
Deaths("Player 5", "Any unit", At least, 10012);

Actions:
Move Unit("Player 6", "Any unit", All, "Location 5", "Location 4");
Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 6"){
Conditions:
Bring("Player 6", "Any unit", "Location 5", At least, 1);

Actions:
Order("Player 6", "Any unit", "Location 5", "Location 6", move);
Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 6"){
Conditions:
Bring("Player 6", "Any unit", "Location 6", At least, 1);

Actions:
Order("Player 6", "Any unit", "Location 6", "Location 7", move);
Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 6"){
Conditions:
Bring("Player 6", "Any unit", "Location 7", At least, 1);

Actions:
Order("Player 6", "Any unit", "Location 7", "Location 8", move);
Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 6"){
Conditions:
Bring("Player 6", "Any unit", "Location 8", At least, 1);

Actions:
Order("Player 6", "Any unit", "Location 8", "Location 5", move);
Preserve Trigger();
}



None.

Apr 4 2008, 4:36 pm NudeRaider Post #6

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

Rofl yeah i see it. You use [any unit] whenever I wrote <unit> or 'dc'.
for <unit> use Zerg Overlord
You CAN keep [any unit] for the move/order triggers, but using the actual unit is considered cleaner.

For 'dc' I'm gonna give you a quick info on how to set up a death counter:
Death counters in their original use are keeping track how many times a unit died for each player.
But Blizzard gave us actions that allow us to modify these death counts and conditions that allow us to check for them.
That makes them ideal variables for us because we can control their value.
Go into the unit properties menu and choose an unused unit and rename it to something sensible (like 'Overlord loop count'). Unused means that it will NOT actually die in your map, because you want a clean variable that you only control by triggers and which is not modified unwantedly by other events.
A good unused unit is neutral -> neutral -> cantina, because it cannot even exist in the map. So, rename 'Cantina' to 'Overlord loop count'.
Then go into your triggers and replace all [any unit] instances you set for the dc to 'Overlord loop count'.




Apr 5 2008, 8:26 am Asuka22dk Post #7



I thank you very much for your help, I finaly got it working



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:06 pm]
Zoan -- how do i get minerals
[11:45 pm]
ClansAreForGays -- Anyone wanna played Skewed StarCraft?
[2026-4-14. : 12:07 am]
Vrael -- NudeRaider
NudeRaider shouted: Vrael ranting still is though
you're a gentleman and a scholar, thank you
[2026-4-13. : 10:07 pm]
NudeRaider -- ya why phone people when you can just write letters
[2026-4-13. : 9:37 pm]
IskatuMesk -- I have never and will never own a phone
[2026-4-13. : 9:15 pm]
NudeRaider -- Vrael ranting still is though
[2026-4-13. : 9:14 pm]
ClansAreForGays -- anticapitalism isnt edgy anymore
[2026-4-13. : 3:31 pm]
Vrael -- it only costs 50% of my post-tax salary for life and in return I get to also become a drone whose sole purpose is CAPITALISM
[2026-4-13. : 3:30 pm]
Vrael -- pssht, you're still using a phone? I just record 100% of my life using my ElonBrainChip
[2026-4-13. : 2:13 pm]
NudeRaider -- bro I don't go anywhere without my phone to record anything significant
Please log in to shout.


Members Online: NimoStar, Prankenstein