[skip all navigation]

[SOLVED] Keeping Buildings Unlifted, Limited Location Use

Creator: IAGG
Time: Jun 15 2012, 3:33 am
Topic Locked
Topic Locked
This topic has been locked!
Reason: Solved
Closed by: Roy

Post #1     IAGG Jun 15 2012, 3:33 am

[Avatar]
offlinecontact
Rank: Member
Ok so bottom line is im trying to minimize the amount of locations to use for keeping some terran buildings from lifting. There will be 6 human players and 2 computer players. There will be the upgrades section which consists of 1 Engineering Bay, 1 Barracks, 1 Science Facility for each player. I tried using just 2 locations; 1 for the entire upgrades location to detect if a building was in the air, and the other to move to the lifted building to move it to the same location which would make it unlifted. The issue i came accross was that when the building is being moved, it was moving up one normal grid block. Is there a method anyone can help me with that will allow me to keep the buildings from being lifted, or to land the buildings instantly without them waiting till they are fully lifted. If you need more info just let me know. I would prefer not having a location at each building... roughly 18 locations...
thx

Top

Post #2     Roy Jun 15 2012, 4:12 am

[Avatar]
An artist's depiction of an Extended Unit Death
onlinecontact
Rank: Veteran
If you have them lined up, you can use the technique used for location grids to center the location to the appropriate area.

For example, if all the buildings are 10 tiles from the top of the map, make a location that is 10*2+1.5 = 21.5 tiles tall (distance from edge times two, plus half the height of the building). When you center the location on the lifted building, the top edge of the map "pushes" the location so that its center is actually at the center of where the building originally was before it lifted.

Alternatively, you can put a location on the tile immediately above the buildings, and the instant they touch that location (i.e., they've started to lift off), move a location on the building. This will work much faster than detecting a full lift of the building, so it may work for you just fine.

Top

Post #3     IAGG Jun 15 2012, 4:19 am

[Avatar]
offlinecontact
Rank: Member
ok well the buildings are lined up but they are also overlaping slightly. a player is able to lift 1 building and then land it in the same spot. but if they lift a barracks and an engineering bay, they only have room to land one of them. ive never tried to use a mobile grid before and would like to avoid that if its possible. if not then ill try to learn it. on a side note... is it possible to just disable the lift option?

Top

Post #4     jjf28 Jun 15 2012, 4:22 am

[Avatar]
Relax.
offlinecontact
Rank: Regular
If you are only using science facilities to ease ups 2-3 and/or to aid unit creation, then you can use a disabled unit sprite, it will be unable to lift; you will not be able to perform emp/irrad/energy upgrades from it.

Rs_yes-im4real@USEast - Clan KHD - Helms Deep Home
Top

Post #5     Roy Jun 15 2012, 4:26 am

[Avatar]
An artist's depiction of an Extended Unit Death
onlinecontact
Rank: Veteran
You can disable lift through some impractical implementations (disabled/incomplete buildings).

Location grids aren't the same as mobile grids, and you wouldn't be implementing a grid, anyway. I was just referring to the technique location grids use to function.

Basically, when you center a location somewhere, SC makes sure its boundaries do not leave the map. So if you centered a 10x10 location in the top left corner (0x0), the center of that location wouldn't be the top left, but rather it would be at 5x5. By creating a really long location, you can basically force its center to be wherever you want it to be (assuming what you're centering it on is on the correct side of the map).

If you'd like, I can make sample maps for these two implementations.

Top

Post #6     IAGG Jun 15 2012, 4:29 am

[Avatar]
offlinecontact
Rank: Member
Quote from Roy
You can disable lift through some impractical implementations (disabled/incomplete buildings).

Location grids aren't the same as mobile grids, and you wouldn't be implementing a grid, anyway. I was just referring to the technique location grids use to function.

Basically, when you center a location somewhere, SC makes sure its boundaries do not leave the map. So if you centered a 10x10 location in the top left corner (0x0), the center of that location wouldn't be the top left, but rather it would be at 5x5. By creating a really long location, you can basically force its center to be wherever you want it to be (assuming what you're centering it on is on the correct side of the map).

If you'd like, I can make sample maps for these two implementations.

Thank you. i would like to be able to see the triggers and the effects if you dont mind.

Edit: just to remember the science facility will have the covert ops attached which will eventually allow ghost range. The barracks will be allowing the building of all units and the engineering bay will be used for upgrades. they will be starting at 0 as well**

Top

Post #7     jjf28 Jun 15 2012, 4:39 am

[Avatar]
Relax.
offlinecontact
Rank: Regular
If you need to re-stack buildings, there's a cool trick:

1. Create a random unit somewhere
2. Move the random unit to the location you want to stack at
3. Create the unit you want to stack somewhere
4. Remove the random unit
5. Move the created unit to the stack location

^ All in one trigger cycle

Rs_yes-im4real@USEast - Clan KHD - Helms Deep Home
Top

Post #8     Roy Jun 15 2012, 4:43 am

[Avatar]
An artist's depiction of an Extended Unit Death
onlinecontact
Rank: Veteran
I made a quick map and realized the second option I suggested doesn't work fast enough to get the effect you want. Option #1 it is.

As I'm sure you have in your own location, the "Area" location in the attached map only has the air flags selected.

Edit: Based on your current implementation, I'd say you don't need to change any triggers; you just need to change the size of the location you're moving.
Attachments:
scm file
LiftTheory.scm (51.69 kb)
3 hits.
This post was edited 1 time, last edit by Roy: Jun 15 2012, 4:54 am.

Top

Post #9     IAGG Jun 15 2012, 4:55 am

[Avatar]
offlinecontact
Rank: Member
Quote from Roy
I made a quick map and realized the second option I suggested doesn't work fast enough to get the effect you want. Option #1 it is.

As I'm sure you have in your own location, the "Area" location in the attached map only has the air flags selected.

ok so i checked out the map. *thx for showing me*. for starters, all the terraining is done for the map and the upgrades section is relatively bottom right. so lets say i have all the barracks for each player lined up horizontally like each building in your map. and then a row for facilities and bays. would i need 3 locations, one for each row? because if im grasping this correctly, they would need to be slightly different sizes since they are about 2~3 tiles vertically

Top

Post #10     jjf28 Jun 15 2012, 4:56 am

[Avatar]
Relax.
offlinecontact
Rank: Regular
ah yes, one more thing, covert ops don't require a science facility; pre-placed covert ops will continue to be owned by the assigned player. The owner can be changed with a semi-complicated trick, but not simply by the "give" trigger.

Rs_yes-im4real@USEast - Clan KHD - Helms Deep Home
Top

Post #11     IAGG Jun 15 2012, 4:57 am

[Avatar]
offlinecontact
Rank: Member
This is a pic of what it will look like. Sorry i dont know how to add images directly...
Attachments:
jpg file
Upgrades Location.jpg (86.72 kb)
9 hits.

Top

Post #12     Roy Jun 15 2012, 4:58 am

[Avatar]
An artist's depiction of an Extended Unit Death
onlinecontact
Rank: Veteran
Quote from IAGG
so lets say i have all the barracks for each player lined up horizontally like each building in your map. and then a row for facilities and bays. would i need 3 locations, one for each row? because if im grasping this correctly, they would need to be slightly different sizes since they are about 2~3 tiles vertically
Yes, you would need locations with different heights if you have different rows. The size of the location is based on how far away the building is from the edge of the map.

Based on your image, you would need five locations total (1 for each row and 1 for the whole area).

Top

Post #13     IAGG Jun 15 2012, 4:58 am

[Avatar]
offlinecontact
Rank: Member
Quote from jjf28
ah yes, one more thing, covert ops don't require a science facility; pre-placed covert ops will continue to be owned by the assigned player. The owner can be changed with a semi-complicated trick, but not simply by the "give" trigger.

Ok so for the science facilities, i would be able to disable them and the covert ops will still work. and the player will still be able to use upgrades from 1-3???

Top

Post #14     jjf28 Jun 15 2012, 5:03 am

[Avatar]
Relax.
offlinecontact
Rank: Regular
Quote
Ok so for the science facilities, i would be able to disable them and the covert ops will still work. and the player will still be able to use upgrades from 1-3???

Yes, that is the gist of it; but to be perfectly clear, disabled like this, not by "disable doodad state"

+
Collapse Box


Rs_yes-im4real@USEast - Clan KHD - Helms Deep Home
Top

Post #15     staxx Jun 15 2012, 5:09 am

[Avatar]
offlinecontact
Rank: Member
I like that Roy, cool trick :)

Top

Post #16     IAGG Jun 16 2012, 4:16 am

[Avatar]
offlinecontact
Rank: Member
Hey Roy, I came accross an issue with that method. Will that only work if the buildings are on the top half of the map? Because I cant get the locations to be long enough to Center where they would need to be.

Top

Post #17     staxx Jun 16 2012, 6:23 am

[Avatar]
offlinecontact
Rank: Member
Yeah seems buggy from bottom. I can get it to work proper for a few lifts, but on the 5th or 6th lift the buildings start moving upwards when theyre placed. I'm assuming this will only work when the buildings are at the top seeing as the center on top cant move any further north. Maybe Roy has a fix.

Top

Post #18     Vrael Jun 16 2012, 6:44 am

[Avatar]
offlinecontact
Rank: Veteran
If the buildings are in a grid, you could plop some burrowed units down on the left or righthand side (depending on where the buildings are in the map) and use the location shift centered on the burrowed units to replace the buildings. You'd need a location for each horizontal position, the burrowed units "encode" the vertical positions, and the "liftoff detection" location.

Top

Post #19     Roy Jun 16 2012, 8:31 am

[Avatar]
An artist's depiction of an Extended Unit Death
onlinecontact
Rank: Veteran
Oh yeah, come to think of it, you can only push the location upwards from the bottom of the map, which won't help solve your particular problem (because the buildings shifting up is the problem).

Quote from Vrael
If the buildings are in a grid, you could plop some burrowed units down on the left or righthand side (depending on where the buildings are in the map) and use the location shift centered on the burrowed units to replace the buildings. You'd need a location for each horizontal position, the burrowed units "encode" the vertical positions, and the "liftoff detection" location.
Yeah, this seems like the quickest way to fix the existing implementation. I placed them along the bottom of the buildings, though.

It's also important to note that locations think the bottom edge of the map is one tile above where it actually is, so you have to ignore the bottom tile when calculating the size of your location (you'll know the location is the wrong size because the building won't be in the correct spot when you replace it). I added one more action to move the location onto the burrowed Zerg Drone (below the buildings) to force the location to hit the bottom edge of the map. The attached map gives the desired result. You'll still need one location for each row, but you can reuse the burrowed unit as the anchor point for each column (as shown in the attached map).
Attachments:
scm file
LiftTheory.scm (51.90 kb)
3 hits.

Top

Post #20     rockz Jun 18 2012, 11:27 am

[Avatar]
お や す み
offlinecontact
Rank: Veteran
Start players with 3 natural upgrades:
you don't need a science facility.

turn off player vision and instead use player 7 or 8 as their vision:
you can hide stuff from the player, like unused upgrade buildings.

You can also pre-place buildings and link them some distance apart. The link goes away if you lift though, so that's why you have to turn off vision or make it impossible to select the building by covering it with CCs.

This is a great wallpaper to use if you want to go into an epileptic fit every time you sit down in front of your laptop, which I guess is a better option than watching Naruto.
Top
Topic Locked
Topic Locked
This topic has been locked!
Reason: Solved
Closed by: Roy
0 members in this topic (italic members are currently writing a reply): None
+ guest(s)


[04:49 pm]
Dem0n -- ;o
[04:41 pm]
Wing Zero -- lotusblue id fortheswarm AKA ?????
[04:36 pm]
Dem0n -- who the fuck is lotusblue then
[04:19 pm]
Wing Zero -- I'm sure fortheswarm was named something else before, cause i don't remember that name
[04:17 pm]
HCM™LoTu)S -- No, wot
[04:15 pm]
Wing Zero -- I will as soon as I fix finish my PC
[04:14 pm]
Dem0n -- aren't you LotusBlue
Please log in to shout.