Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Detecting Units Inside A Bunker
Detecting Units Inside A Bunker
Apr 6 2008, 4:37 am
By: KilaByte  

Apr 6 2008, 4:37 am KilaByte Post #1



In my map, I am trying to detect if a bunker needs more units in it. During this process I have discovered the following:

If you use a trigger to detect units in a bunker assuming that location BUNKER is directly over the bunker, if the condition is:
Current Player Brings EXACTLY 1 of Terran Marine To Location BUNKER

This works fine. It only executes when there is exactly 1 unit in the bunker. However if you use this:

Current Player Brings AT MOST 1 of Terran Marine To Location BUNKER
The trigger seems to fire regardless of how many units are in the bunker.

The trigger in my map is something like this:

Conditions:
Current Player Brings AT MOST 3 of Terran Marine To Location BUNKER

Actions:
Order Unit To Move To Location Bunker
Run AI Script "Enter Closest Bunker" at location BUNKER
Preserve Trigger

The problem with this is that even when there are 4 units in the bunker, the trigger still fires and units still try to get into a bunker that is full. I can't have that.

Here is an example map.
If anyone finds a way around this, or finds that I am doing something wrong then please let me know. This isn't a hugely important part to my map but it is kind of a big deal. And I can't do it any other way in my map, I have to be able to detect if the bunker is less than full or it won't work.

Post has been edited 1 time(s), last time on Apr 6 2008, 4:42 am by KilaByte.



None.

Apr 6 2008, 5:54 am 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

You will have to make 4 triggers, 1 for each number of marines inside (0-3).




Apr 6 2008, 6:16 am KilaByte Post #3



Lets say my map has over 60 bunkers that would need these 4 triggers.

Thats 240 triggers. I can't do that, and I'm guessing that since it would be 240 triggers all relating to unit movement it would cause a bit of lag.

Any other ideas?

Anyone know why the hell AT MOST doesn't work. Because AT LEAST and EXACTLY work fine.



None.

Apr 6 2008, 7:32 am The Starport Post #4



Because Blizzard has a fun sense of humor.



None.

Apr 6 2008, 8:21 am pneumatic Post #5



Have a trigger that loads marines into the bunker for location "Bunker". Recycle this location among the 60 bunkers. One way to do this is have a death count with each value corresponding to a different bunker. In the Load trigger, add one to this death count.

You could also have a "Number" Death Count that cycles between all the copies of the Load trigger -- exactly 0 marines, exactly 1 marine, exactly 2 marines, and exactly 3 marines. Then when it's done, add one to the "Location" death count, which causes the location "Bunker" to switch to the next bunker.



None.

Apr 6 2008, 8:32 am rockz Post #6

ᴄʜᴇᴇsᴇ ɪᴛ!

Quote from KilaByte
Lets say my map has over 60 bunkers that would need these 4 triggers.

Thats 240 triggers. I can't do that, and I'm guessing that since it would be 240 triggers all relating to unit movement it would cause a bit of lag.

Any other ideas?

Anyone know why the hell AT MOST doesn't work. Because AT LEAST and EXACTLY work fine.
It's called trigger duplicator. A trigger doesn't lag when it doesn't fire. You could probably get away with centering a location and only using 5 triggers.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Apr 6 2008, 2:01 pm NudeRaider Post #7

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

Welcome to Starcraft mapping.
However, you can optimize what I said by using binaries:
First check for exactly 0 (--> create 4)
Then DON'T make a trigger for exactly 1
Because exactly 2 & 3 will also create 3 marines in total.

If these triggers really fire so often that you experience lag you should not leave out exactly 1 as in 25% of the cases you cut the lag caused by these triggers by half. ==> 1/8 less laggy if not less... O.o

Btw. having a number dc for the copies of the load trigger doesn't help, because you cannot use dc's as arguments in other conditions as "Death".
For the location cycling you should use burrowed lings given from P11 to P12 under the bunkers:
#1
Always
center 'Bunker' on on P11's lings

#2-4
Check for exactly 0,2,3 rines
<load bunker>
give ling at "Bunker" to P12

#5
P11 has at most 0 lings
give all lings of P12 to P11

Here is also no dc needed.




Apr 6 2008, 2:27 pm KilaByte Post #8



Quote from rockz
It's called trigger duplicator. A trigger doesn't lag when it doesn't fire. You could probably get away with centering a location and only using 5 triggers.

Sorry I was under the impression that having 240 conditions being tested caused more lag (And Map Size) than having say... 60 conditions tested.

My map does not create the units at the bunker. Instead if a bunker needs units in it, Units are sent to that bunker (1-60) from a different location.
Regardless, I have figured it out by giving certain bunkers priority over others and getting units to enter the highest priority bunker first, then the remaining units (I.E. Units not inside that bunker) move to the next bunker in the priority list.

I have manage to do this using 120 Triggers, which is good enough for me.

Thanks anyway.



None.

Apr 6 2008, 3:59 pm NudeRaider Post #9

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

Quote from KilaByte
My map does not create the units at the bunker. Instead if a bunker needs units in it, Units are sent to that bunker (1-60) from a different location.
Regardless, I have figured it out by giving certain bunkers priority over others and getting units to enter the highest priority bunker first, then the remaining units (I.E. Units not inside that bunker) move to the next bunker in the priority list.

I have manage to do this using 120 Triggers, which is good enough for me.

Thanks anyway.
In this case you can place burrowed hyds at the creation locations as well and cycle them too.
Cycling usually > Trigger duplication




Apr 6 2008, 4:39 pm Falkoner Post #10



At Most doesn't work because it doesn't detect units in bunkers(don't ask me why).



None.

Apr 7 2008, 4:08 pm fritfrat Post #11



At Most not detecting units in bunkers is a nice feature more often than it is a downside, which is probably why blizzard changed the requirements for it sometime during their own scenario development. It's especially with disabled bunkers where you can't remove the men inside anyways.



None.

Apr 7 2008, 6:56 pm Brontobyte Post #12



http://www.staredit.net/?file=191

Here you go. This shows how to use a small location ( 1 pixel ) to detect when, in this case 1, a unit enters a bunker. This could be done with 1-4 units.

Is there a way to change the amount of units that are able to enter a bunker via EUD triggers?



None.

Apr 7 2008, 7:02 pm who Post #13



You should've just had burrowed units under the bunkers and cycled through them.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[09:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[07:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[06:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[03:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[01:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6: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.
[2024-4-26. : 6: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
[2024-4-26. : 6: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?
[2024-4-26. : 6:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[2024-4-26. : 6:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
Please log in to shout.


Members Online: Ultraviolet