Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: move units only when they stop
move units only when they stop
Mar 27 2008, 1:26 pm
By: okeee  

Mar 27 2008, 1:26 pm okeee Post #1



I have made a trigger that if any unit is in location x, the unit will be moved to another location. But I want the units only to be moved when they specifically stop at location x, not when moving. So when units are moving through location x, they shouldnt be moved at all.



None.

Mar 27 2008, 1:30 pm candle12345 Post #2



Okay, are you working with 1 unit, or multiples, because I can set it up for one unit.

Make a teeny ass location, 1 pixel.
Make it continually jump to the unit in question [you can also make this work if only a single unit can be in the location, even if there are multiple units.

Now, add the following condition to your trigger
If player brings exactly 1 units to [1 pixel location]
If player brings at most 1 units to [Teleport]
If the unit is moving, it will exit the location, and the teleport won't fire.

This will not work on a map where you have many units entering the teleport at once. No exceptions.

Example map in a sec.

Okay, I'm having trouble, working out the kinks.

Post has been edited 1 time(s), last time on Mar 27 2008, 1:50 pm by candle12345.



None.

Mar 27 2008, 1:39 pm okeee Post #3



Ok, when using this method, you need to specify the unit beforehand right?
what you mean is, if you move a location to a moving unit, there is a delay of the location, so that it won't be detected by location x?
Actually, it should be any unit that moves to location x (and also when multiple units are entering location x).

Post has been edited 1 time(s), last time on Mar 27 2008, 1:46 pm by okeee.



None.

Mar 27 2008, 1:51 pm candle12345 Post #4



It can only be set up for one unit on the beacon at any one time.

Okay, my method there, it doesn't work. Im getting there, but the end result will probably use a switch.

Tis close, just ironing out the last kinks.

Post has been edited 2 time(s), last time on Mar 27 2008, 2:13 pm by candle12345.



None.

Mar 27 2008, 2:15 pm candle12345 Post #5



Done.

That's the best I can do, it can be screwed up though, dancing marines will be classed as standing.
The hallucinations signify that it is moving, I added htem so you can see how fast it updates.

Attachments:
beacontest.scm
Hits: 1 Size: 35.21kb



None.

Mar 27 2008, 2:46 pm okeee Post #6



there were some errors, but i tried to open it. i'll check how you have done it.



None.

Mar 27 2008, 2:56 pm candle12345 Post #7



Some errors, what do you mean?
As in, it made a mistake?
That's a pretty hard bug to iron out, but there is a way to make it more precise.
In the trigger: 'If rine on beacon, centre 1pix on marine, set switch'
Ther is a wait action. The lower the wait, the more likely it will screw up, so set it higher if it isn't precise enough. Setting it too high however, wil also cause problems, setting it way too high may make it miss the marine entirely. So be gentle.

I put in 2 marines to show you how it can and will screw up with more than one unit corssing at once.



None.

Mar 27 2008, 3:12 pm okeee Post #8



Im not sure, some error about unit placement. but i can open the file.
i checked the scripts, maybe i can only use part of it, but it seems helpful!



None.

Mar 27 2008, 3:14 pm candle12345 Post #9



Seems odd that it's telling you there's an unplaceable.
I'll recheck it.
Works fine on my end, but I haven't bothered to reupdate to v15.2
Gimme a sec

Nup. A-OK.

Post has been edited 2 time(s), last time on Mar 27 2008, 3:22 pm by candle12345.



None.

Mar 28 2008, 1:12 am okeee Post #10



it's ok, i'll try to figure out how the triggers work, and may use some.



None.

Mar 28 2008, 8:46 pm okeee Post #11



some other similar thing i'm trying: when any unit is in location y, they should be moved, except for 1 unit for example, hydralisks. So only hydralisks should stay in location y when theyre in that location.



None.

Mar 28 2008, 9:20 pm NudeRaider Post #12

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 3 approaches:
1. the hard one:
Trigger1:
if brings 1 marine to y
then teleport all rines at y to x

Trigger2:
if brings 1 fbat to y
then teleport all fbat at y to x

Trigger3:
if brings 1 ghost to y
then teleport all ghost at y to x

Trigger4:
etc. until you covered all units

2. the cheap one:
Always
teleport all men at y to x
teleport all hyds at x to y

3. combination:
Always
teleport all rines at y to x
teleport all fbats at y to x
teleport all ghost at y to x
... etc. until you listed all units that should get teleported

Post has been edited 1 time(s), last time on Mar 29 2008, 5:46 pm by NudeRaider.




Mar 29 2008, 6:21 am okeee Post #13



all units have to be in the same location, so does that mean that i have to set it up one by one for all units?



None.

Mar 29 2008, 7:10 am NudeRaider Post #14

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

uhm no? did you check and understand my triggers?




Mar 29 2008, 3:43 pm okeee Post #15



Quote from NudeRaider
2. the cheap one:
Always
teleport all men at y to x
teleport all hyds at x to y

i meant this one. i can't use this one, if i want all units, except hydralisks, to move when they are at y, right?



None.

Mar 29 2008, 5:18 pm fm47 Post #16



Hey everyone, computer died, at the university right now xD

Just at the top of my head, depending on the amount of units you have, you could have a location with a lot of a unit that can burrow. Let's use the Zergling. Have the computer that owns the unit allied to the players. Create 3 locations: Burrowed, Unit, Cleanup. Have 1 over the burrowed units, 2 very small ones, perhaps 1x1 pixel for Unit and Cleanup. At a certain interval, say, 1000ms (via death counter), have the triggers:

... I'll just write down the concept -_-

Have one location constantly checking to see if a unit has a zergling underneath. If it doesn't, the trig will move one from the Burrowed location. If the unit already has a zergling underneath, then the unit hasn't moved. You'll have to set up how often each unit will be checked. After deciding what happens if the unit is considered moving or not, you'll have to make sure the burrowed units that you don't use anymore on the field are removed before checking again.

Immediate problem I recognize with this is that if you have, say, 12 units in a formation of 3x4 with all the units moving up, like so:

xxxx
oooo
xxxx

Problem here is that when they're all moving upwards, the O units will run into the X units' burrowed zerglings, therefore detected as not moving and teleported.

I'm sure there are a bunch of problems with this, but if anyone sees anything worthwhile in this though, feel free to expand it

EDIT
Also, wouldn't

Always
move all men from x to y
move all hydra from y to x

make the hydra be in a constant teleportation of x and y?



None.

Mar 29 2008, 5:44 pm NudeRaider Post #17

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

Uhm... depends... you would have to tell us more specifics of your map / the purpose of the teleporting (or block of it).
The teleporting forth and back takes place instantly so the hyd is at all times at the right location, but when the trigger fires the first time for a given hyd you may see it "centered onto y" when it wasn't already exactly in the center.
It's not the cheap solution because it hasn't any drawbacks... Fm47 found one. You should make a delay that it teleports only every 5s.
My triggers were only conceptional. Once you decided what will fit best into your map we can refine them.

But seriously... in the time we are discussing about if you could adapt the cheap solution you could as well copy and replace the actions to teleport all units you need (3rd solution).




Mar 30 2008, 10:32 am okeee Post #18



Quote from NudeRaider
Fm47 found one. You should make a delay that it teleports only every 5s.
Im not quite sure how that works, but what it does already is check every few seconds if a unit is there, and if it is in the same place, then move a unit to another place?

setting units 1 by 1 would be ok as well, but i was looking for some other methods too, because i may use this "check every unit except 1" in other situations as well.



None.

Mar 30 2008, 11:58 am NudeRaider Post #19

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

Yes.

A common way to safely implement a trigger firing delay is using a death counter (dc). If you use hyper triggers 5s = 40 death counts. That means you only fire the trigger if deaths > 40 then make your actions and reset the dc. Let another trigger always add 1 to the dc. Use an unused unit for that, such as neutral - neutral - cantina and rename it.




Apr 1 2008, 3:22 am BlueFalcon Post #20



Locations

Location Move Units If Standing Still (MUISS)

Triggers
Condition
If Current Player brings X unit to Location MUISS
Action
Add 1 to Death Counter for Player X.
Preserve Trigger

Condition
If Current Player brings 0 unit to location MUISS
Action
Set 0 to Death Counter for Player X.
Preserve Trigger

Condition
If Death Counter equal 18
Action
Set Death Counter to 0.
Move all units for player x to location Where they should go.
Preserve Trigger

This means that if the units stay in the location for 1 and a half seconds, it will move the units. Depending on the size of the MUISS location should depend on how high you want the Death Counter to go. I'm also assumeing you are useing hyper triggers. This is what NudeRaider was showing.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:55 pm]
Zoan -- :wob:
[10:34 am]
NudeRaider -- SEN doesn't rely on spammers initiate its sleep cycle. It hat fully automated rest and clean-up phases. Please understand that this is necessary for the smooth operation of the site. Thank you.
[03:45 am]
Sylph-Of-Space -- Does the shoutbox get disabled when there's spammers?
[2024-5-17. : 6:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[2024-5-17. : 5:41 am]
Ultraviolet -- 🤔 so inf is in you?
[2024-5-17. : 4:57 am]
O)FaRTy1billion[MM] -- my name is mud
[2024-5-17. : 4:35 am]
Ultraviolet -- mud, meet my friend, the stick
[2024-5-16. : 10:07 pm]
lil-Inferno -- nah
[2024-5-16. : 8:36 pm]
Ultraviolet -- Inf, we've got a job for you. ASUS has been very naughty and we need our lil guy to go do their mom's to teach them if they fuck around, they gon' find out
[2024-5-16. : 5:25 pm]
NudeRaider -- there he is, right on time! Go UV! :D
Please log in to shout.


Members Online: 1avae8285rL7