Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/07/2022 in all areas

  1. trigger_segfault

    Building Shape Coordinates

    I can finish up the remaining questions about Blue Water tiles, and other general construction zone quirks. Building Shape Shape property Location: Buildings/<name>/<name>.ae Usage: Lego*::Shape #,#[:#,#:...] Example: Shape 0,-1:0,-1:0,1:0,1 The Shape property is a list of points (#,#), separated by colons (#,#:#,#). The Shape property implicitly starts with the origin point (0,0:). A single tile is defined by either one or two points. A repeated point (i.e. 0,1:0,1) will be treated as a Yellow/Blue Path tile. A non-repeated point (i.e. 0,1:0,2) will be treated as a Green Building tile. Because of the implicit origin point (0,0:), starting your Shape property with 0,0 will treat the first tile as a Yellow/Blue Path tile (see WaterEntrances property). Point coordinates are defined based on the default in-game rotation, which is Up (North). Thus, all coordinates are rotated 180 degrees from what may be expected (just multiply everything by -1). Defining a point that repeats more than two times in a row is undefined behaviour, and is parsed differently by different functions in the game. It is possible to construct a building with only (even one) Yellow Path tiles. (See WaterEntrances property bullet point describing WaterEntrances -1). WaterEntrances property Location: Lego.cfg Usage: Lego*::Stats::<name>::WaterEntrances <INTEGER> Example: WaterEntrances 2 The WaterEntrances property defines how many Yellow Path tiles from the start of the Shape points list are treated as Blue Water tiles. The calculation uses (WaterEntrances + 1) because of the implicit 0,0:, which is intended to always be a Green Building tile. Defining the first shape point as 0,0 will create a Blue Water tile, even when using WaterEntrances 0. Using WaterEntrances -1 will allow defining the first tile as a Yellow Path tile. These tiles do not change the vehicle teleport-down location (it always seems to be in-front of the origin tile). These tiles do not change the "goto Docks" location (same as above). These tiles do prevent vehicles from idling on that location. If no Yellow/Blue tile is placed in front of the building, then the vehicle may freely idle in the teleport-down/"goto Docks" location. It is possible to construct a building with only (even one) Blue Water tiles, as long as the building has no resource costs. This property does not do anything other than influence the building placement shape. Basically for water tiles, your Blue Water tiles must come before your Yellow Path tiles in the shape points list. Blue tiles are just Yellow tiles They conduct electricity over water to other paths. They cause octagonal power paths to visually connect, like with normal building foundation paths. They tell units to not idle here. They meet the path connection requirement when placing a construction zone. Construction Origin tile A construction zone is created from the origin tile where the cursor has placed the building (0,0 for shape point coordinates). The attempted rotation of the placed building is in the direction of the side the cursor is closest to on the tile (i.e. closest to North of tile will use Up rotation). This is especially useful for aesthetic placement of single-tile buildings. The origin tile is where all resources are placed, with exception to Barriers, which have their own rules. The origin tile is the only tile that allows cancelling construction (this is because the tile coordinates are used as a sort of "handle" to that construction zone). Even though you can open the Construction interface menu using non-origin Green Building tiles, cancelling them will have no effect. It's possible to prevent a construction zone from being completed or cancelled during unmodded gameplay, by having a Power Station construction zone overrun by lava erosion on its primary side during "Don't Panic!". Barriers Barrier placement is determined based on Green Building tiles and their borders. A Green Building tile bordering another Green tile, will not request a barrier on that side. A Green Building tile bordering a Yellow/Blue/or no tile, will request a barrier on that side. If a shape defines no Green Building tiles, then no barriers will be requested. Defining StoreObjects FALSE in the Stats section will also remove the need to place barriers. Barrier placement does not have to cover the origin tile. If your building has no resource costs, but requires barriers, then the origin tile can be made unreachable without issue (other than being unable to cancel construction). StoreObjects property Location: Lego.cfg Usage: Lego*::Stats::<name>::StoreObjects <BOOL> Example: StoreObjects TRUE The StoreObjects property defines whether a building can accept resources to deposit, or provide resources requested for construction. This property only seems to provide the above effect when Lego*::ToolNullName has been defined. Otherwise, units will ignore this capability. The StoreObjects property defines one other behaviour, which is whether the construction zone requires placing Barriers. Setting this property to FALSE will allow constructing a building that only requires placed resources. Or instantly spawning a building (like the Tool Store) if there are no resource costs. Image Examples @aidenpons showcasing the ability to construct Docks in a vanilla game by connecting its water tile to a Power Path, in "Water Lot of Fun". The great water bridge of power conductivity. A building shape with a disconnected water tile, that shows electricity conduction over water, and enforced vehicle teleport-down location. A building shape with just 1 water tile. And a building shape with just 1 path tile. .
    2 points
  2. Amauros

    Building Shape Coordinates

    In the ae file of any building in LRR, you'll find "Shape" followed by a sequence of numbers. The only exception is the E-Fence and GunStation (which has Shape commented out). Shape represents the area that a building will take up within a cavern. Shape uses coordinates that represent each tile in reference to what tile the mouse is over. Therefore, 0,0 is understood as the coordinates where the mouse is pointing to. This is also the center location of the building's lwo. That said, 0,0 is an understood coordinate for the Shape. Adding 0,0 to the coordinates can cause crashing. Step 1, deciding what type of tile you want. There are blue, green, and yellow tiles. Unfortunately, I haven't figured out how to make the blue tiles; it might have to do with the entrance/deposit nulls. So for now, lets work with green and yellow. Green tiles have single coordinates, e.g. 0,-1 or 0,-2 would both be green. Yellow tiles have dual/duplicate coordinates, e.g. 0,-1:0,-1 or 0,-2:0,-2. Step 2, deciding where you want your tiles. For example, we'll make the super teleport's Shape (without looking at the code). 0,0 is understood as the default starting coordinate, this will always be a green tile. 0,-1, this is one tile to the left of the starting coordinate and is green (coordinates are in -y,x format, yes it's weird) 1,0:1,0 this is yellow tile directly below or directly in front of the super teleport's main tile 1,-1:1,-1 this is also a yellow tile down and to the left of the center tile. Step 3, writing the code properly. All coordinates must be separated by colons and have absolutely no spaces! They also must be written in descending order! Remember y's are negative (-y,x format), so descending order is 0, 1, 2, 3, etc, x's are positive and therefore descend 0, -1, -2, -3, etc. So the above code for the super teleport is 0,1:1,0:1,0:1,-1:1,-1. Again, this isn't finished. I haven't figured out the blue tiles yet. Negative values for y and positive values for x tend to cause crashing. Using 0,0 also causes crashing. I hope this enlightens people a bit, and maybe someone else will figure out the blue tiles. :D
    1 point
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.