Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Freezing AIr Units
Freezing AIr Units
Jun 5 2008, 1:23 pm
By: Oh_Man  

Jun 5 2008, 1:23 pm Oh_Man Post #1

Find Me On Discord (Brood War UMS Community & Staredit Network)

Hey guys I have a question I have a Dropship which I am using for my Inventory system. You drop the unit inside and a trigger occurs.

I am trying to keep the dropship stationary. I have two methods of doing this I can either have a trigger teleport the dropship there if it moves out of its alloteted area which I don't want to do as it looks unprofessional.

And then I can order it to constantly to go to the spot it is already on. With ground units I use the "teleport to water" trick to freeze it but I can't do this with an air unit. Now my trigger does keep him in the same spot but if I keep right clicking fast enough it starts moving away and the trigger isn't moving it fast enough!

And I have it on

Condition
Always

Action
order Dropship at location STAY move to location STAY
preserve trigger.

Please help? I want it frozen!

Also is there a way to make explosions more realistic? I occasionaly get flashes of the unit b4 it dies.




Jun 5 2008, 1:53 pm Kenoli Post #2



Why don't you just teleport the dropship to the location constantly?

Try creating cloaked wraiths for the explosions.



None.

Jun 5 2008, 2:46 pm Falkoner Post #3



You can also constantly ORDER it back, then have safeguards in case they get too far away, then teleport it back, that looks the most professional, the method of constantly moving them can be used on air units by teleporting it to an area where it cannot go constantly(a bunch of stacked command centers) the best one would be outside the map, you just put a location outside the map and it works the best.

A cloaked wraith wouldn't work, since it has to cloak when it first appears, I'm not sure how to help you there.



None.

Jun 5 2008, 2:57 pm Devourer Post #4

Hello

LoL... I couldnt understand this here: I can either have a trigger teleport the dropship there if it moves out of its alloteted area which I don't want to do as it looks unprofessional.


well if you didnt ment this, I can help you:

You also can make the "Unit-to-water-beam-trick" also for air!
The location only have to be blocked by air! Best way you use lifted buildings!
It works perfekt....

But theres onething, which isn't very good: it causes game-lagg, if you teleport to much unit to the area! [To much are more than (ca) 50! Units]

Hope that helps



Please report errors in the Staredit.Network forum.

Jun 5 2008, 3:01 pm Falkoner Post #5



Yeah, DeVouReR, teleporting the units to a location outside the map, rather than to a lifted building doesn't cause any lag. Does anyone know why that is?



None.

Jun 5 2008, 3:45 pm Clokr_ Post #6



SC probably checks if the location is valid before trying to find an empty space big enough for the unit. Searching for such space has to be quite slow.



?????

Jun 6 2008, 9:47 am Ahli Post #7

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

It's the same with trying to move ground units to an area where could have been moved to, if there weren't all the units inside of it blocking the move action.
It's the most horrible lag I ever created...




Jun 6 2008, 11:04 am Wormer Post #8



Quote from Falkoner
Yeah, DeVouReR, teleporting the units to a location outside the map, rather than to a lifted building doesn't cause any lag. Does anyone know why that is?
Wow, I haven't known that! :)

private_parts, you could also use inverted locations thing to detect if the dropship leaves the place and then teleport it back. If you size the location properly then it won't even be noticeable.



Some.

Jun 6 2008, 12:18 pm pneumatic Post #9



Quote from Wormer
private_parts, you could also use inverted locations thing to detect if the dropship leaves the place and then teleport it back. If you size the location properly then it won't even be noticeable.

How is using an inverted location in this case different from using a 1x1 pixel location?



None.

Jun 6 2008, 2:26 pm JaBoK Post #10



Uhm, if you want professional look, then use hyper triggers and constantly move the dropship to it's original position.



None.

Jun 6 2008, 3:04 pm Kenoli Post #11



Quote
How is using an inverted location in this case different from using a 1x1 pixel location?
A unit has to travel some distance to escape a 1x1 pixel location. (ie half the size of the unit in pixels plus one)
Using a properly sized inverted location, the unit must remain utterly stationary to remain inside.

However you could probably avoid even that small amount of movement by just constantly teleporting the unit regardless of where it is.



None.

Jun 6 2008, 5:12 pm Heimdal Post #12



To be a little more specific on what Kenoli said, SC more or less uses the following algorithm to see if a unit's inside a location:

Code
if (((unit.left >= location.left && unit.left <= location.right) || (unit.right >= location.left && unit.right <= location.right)) &&
((unit.top >= location.top && unit.top <= location.bottom) || (unit.bottom >= location.top && unit.bottom <= location.bottom)))


So if the location has its left and right reversed, and its bottom and top reversed (inverted), as soon as the unit moves just 1 pixel it will no longer be in the location.



None.

Jun 6 2008, 6:39 pm Falkoner Post #13



In other other words :P, a completely inverted location will only detect a unit if the unit is touching every side of the location at once. Note that inverted locations will not get bounced back when centering off the map.



None.

Jun 6 2008, 7:41 pm Clokr_ Post #14



Quote from Heimdal
To be a little more specific on what Kenoli said, SC more or less uses the following algorithm to see if a unit's inside a location:

Code
if (((unit.left >= location.left && unit.left <= location.right) || (unit.right >= location.left && unit.right <= location.right)) &&
((unit.top >= location.top && unit.top <= location.bottom) || (unit.bottom >= location.top && unit.bottom <= location.bottom)))


So if the location has its left and right reversed, and its bottom and top reversed (inverted), as soon as the unit moves just 1 pixel it will no longer be in the location.

No?

Quote
((unit.left >= location.left && unit.left <= location.right) || (unit.right >= location.left && unit.right <= location.right))

Code
Reversed Location: aaaaaaa R mmmmm L aaaaaaa

If that's a reversed location how can the unit.left value be higher than L and at the same time lower than R? The same can be applied to the unit.right value.

Has anyone ever tested reversed locations? If SC uses that algorithm no unit will ever be inside the location because no point can ever be inside (it would have to be at both sides of the location at the same time).



?????

Jun 6 2008, 8:20 pm Heimdal Post #15



Oh, right. I didn't think hard enough about it. In any case it's something similar to that, but it works because they used <= and >=; the unit can only be in the location when its boundaries are touching the location's boundaries.

I think it must be something more like this (which is really just half of what I wrote):
Code
unit.right >= location.left && unit.left <= location.right




None.

Jun 6 2008, 8:22 pm Falkoner Post #16



Just as I said :P It must be touching every side at once :)



None.

Jun 6 2008, 9:54 pm Clokr_ Post #17



Quote from Heimdal
Oh, right. I didn't think hard enough about it. In any case it's something similar to that, but it works because they used <= and >=; the unit can only be in the location when its boundaries are touching the location's boundaries.

I think it must be something more like this (which is really just half of what I wrote):
Code
unit.right >= location.left && unit.left <= location.right

But the trigger condition will return true for normal locations whenever the unit intersects them, not if they unit is inside them. So that's not how SC does it either...



?????

Jun 7 2008, 6:33 am Wormer Post #18



Quote
But the trigger condition will return true for normal locations whenever the unit intersects them, not if they unit is inside them. So that's not how SC does it either...
Why not (unit.right >= location.left && unit.left <= location.right && unit.bottom >= location.top && unit.top <= location.bottom)?



Some.

Jun 7 2008, 9:59 am Clokr_ Post #19



Because that will only return true if the whole unit is inside the location, not if it is touching it (for normal locations, that's it).



?????

Jun 7 2008, 10:57 am Wormer Post #20



Quote from Clokr_
Because that will only return true if the whole unit is inside the location, not if it is touching it (for normal locations, that's it).
Stop, I definetly don't understand. Why?

Code
(1) (unit.right >= location.left)
(2) (unit.left <= location.right)
(3) (unit.bottom >= location.top)
(4) (unit.top <= location.bottom)

Let's assume the unit is fully between the location.top and location.bottom and is touching the location from the left side. In this case expressions (2)-(4) are true. But the (1) is true either because the unit is touching the location from the left side that means exactly that unit's right border intersects the location's left border.

In other cases everything is the same. Am I wrong?



Some.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:05 am]
Vrael -- I won't stand for people going around saying things like im not a total madman
[01:05 am]
Vrael -- that's better
[12:39 am]
NudeRaider -- can confirm, Vrael is a total madman
[10:18 pm]
Vrael -- who says I'm not a total madman?
[2024-5-03. : 2:26 pm]
UndeadStar -- Vrael, since the ad messages get removed, you look like a total madman for someone that come late
[2024-5-02. : 1:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[2024-5-02. : 1:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
Please log in to shout.


Members Online: RIVE, Excalibur