Difference between revisions of "Building structures"

From OrbiterWiki
Jump to navigation Jump to search
(Block object.)
(Block object.)
Line 3: Line 3:
 
The description of a block is written into the config file of a base (Orbiter\Config\<''Planet''>\Base\<''BaseConfig.cfg''>).
 
The description of a block is written into the config file of a base (Orbiter\Config\<''Planet''>\Base\<''BaseConfig.cfg''>).
  
So, let's build a block building. Open up a Base config file, here we will use the Bonneville.cfg file we created to build a sample base.
+
So, let's build a block building. Launch any scenario where any ship is located at Habana base. If there is a ship at Pad 1 select it as your ship, if not, move one to Pad 1 with the Scenario Editor and orient it to 270° (west).
  
  BLOCK
+
Open the Habana.cfg file (Orbiter\Config\Earth\Base) in your favorite text editor such as Notepad or Notepad+. Place your cursor at the end of the line BEGIN_OBJECTLIST and press {{Key|Enter}}. That moves the first TANK object down one line. Here enter the following:
        POS -50 0 0
+
 
        SCALE 10 1 1
+
  BLOCK
        ROT 30
+
POS 60 0 -100
        TEX1 Fcd01 5 1
+
SCALE 1 1 1
        TEX2 Fcd03 1 1
+
ROT 330
        TEX3 Roof01 1 1
+
TEX1 0 0 0
 +
TEX2 0 0 0
 +
TEX3 0 0 0
 
  END
 
  END
  
BLOCK: This command on the first line dictates that this is a block shaped object.
+
Save the file, you can keep the file open as we will be editing this block. Exit the scenario, then re-launch it. Now, you will see a small cube sitting on the ground about 100 meters in front of you. In the scenario editor, change the time to about 14:00 hours, that puts the Sun behind you to the left so you can see what effect shadows have.
POS: The distance from the base's center point and elevation. X Y Z
 
    X: meters north (-) or south (+)
 
    Y: elevation from the ground in meters
 
    Z: meters east (+) or west (-)
 
SCALE: X Y Z Length, depth, height of the block in meters
 
    X
 
  
The next line is the SCALE, which is how big in meters is the block, the first one is the width, or left to right dimension, the second is the height, and the third is the depth or length, front to back.
+
Now note the block is white on the side facing you slightly to the left and gray on the right facing side, the right side is in shadow, Orbiter shades it gray to show it's in shadow, the gray shade changes depending on time of day.
  
So, type in '''SCALE 10 1 1'''.
+
The block should look something like this:
 +
[[Image:Block_0_01.png|200px|thumb|center|Image of a BLOCK 0 0 0]]
  
Next line is ROT, rotation from east in degrees, 45 would face the block northeast, 135 northwest, 225 wouthwest, and 315 southeast.
+
This block is a cube 1 meter cubed. Now, let's edit the block in Habana.cfg as follows:
  
So, let's type in '''ROT 30'''.
+
BLOCK
 
+
POS 60 0 -100
The next line is TEX1 followed by a texture name and two numbers. This will place a texture on the front and back of the structure. Texture name is any texture listed in the Base.cfg file, but you may not want to select Runway2, for example. the first number is how many of this textures wide, and the last number is how many textures high.
+
SCALE 1 1 1
 
+
ROT 330
So, let's type in '''TEX1 Fcd01 5 1'''.
+
TEX1 Fcd01 1 1
 
+
TEX2 Fce03 1 1
Next line, TEX2 followed by a texture name and two numbers, but this is for the left and right face of the structure.
+
TEX3 Roof01 1 1
 
+
END
So, let's type in '''TEX2 Fcd03 1 1'''.
 
 
 
And the last line is TEX3 followed by a texture name and two numbers. This will place a texture on the top or roof of the structure, usually Roof01 or Roof02, again how many roof segments in width and length.
 
 
 
So, let's type in '''TEX3 Roof01 1 1'''.
 
 
 
Then the last thing is type in END on the last line. That tells Orbiter that this is the end of data for this block. The next line may begin a new object.
 
 
 
So, type in '''END'''.
 
 
 
Now, your block should be described as follows.
 
 
 
<code>
 
BLOCK
 
        POS -50 0 0
 
        SCALE 10 1 1
 
        ROT 30
 
        TEX1 Fcd01 5 1
 
        TEX2 Fcd03 1 1
 
        TEX3 Roof01 1 1
 
END
 
</code>
 
  
Save your config file, launch orbiter, and your structure should look something like this.
+
Again, save the scenario, exit to the Launchpad and re-launch.

Revision as of 13:14, 6 November 2023

A Block is an object that can be used to create structures on bases. It is a cube or rectangular prism consisting of three dimensions, length, width, and height, and it can use any of the textures that are listed in the base.cfg file (Orbiter\Config\base.cfg), although some may not be appropriate for a block.

The description of a block is written into the config file of a base (Orbiter\Config\<Planet>\Base\<BaseConfig.cfg>).

So, let's build a block building. Launch any scenario where any ship is located at Habana base. If there is a ship at Pad 1 select it as your ship, if not, move one to Pad 1 with the Scenario Editor and orient it to 270° (west).

Open the Habana.cfg file (Orbiter\Config\Earth\Base) in your favorite text editor such as Notepad or Notepad+. Place your cursor at the end of the line BEGIN_OBJECTLIST and press Enter. That moves the first TANK object down one line. Here enter the following:

BLOCK
POS 60 0 -100
SCALE 1 1 1
ROT 330
TEX1 0 0 0
TEX2 0 0 0
TEX3 0 0 0
END

Save the file, you can keep the file open as we will be editing this block. Exit the scenario, then re-launch it. Now, you will see a small cube sitting on the ground about 100 meters in front of you. In the scenario editor, change the time to about 14:00 hours, that puts the Sun behind you to the left so you can see what effect shadows have.

Now note the block is white on the side facing you slightly to the left and gray on the right facing side, the right side is in shadow, Orbiter shades it gray to show it's in shadow, the gray shade changes depending on time of day.

The block should look something like this:

Image of a BLOCK 0 0 0

This block is a cube 1 meter cubed. Now, let's edit the block in Habana.cfg as follows:

BLOCK
POS 60 0 -100
SCALE 1 1 1
ROT 330
TEX1 Fcd01 1 1
TEX2 Fce03 1 1
TEX3 Roof01 1 1
END

Again, save the scenario, exit to the Launchpad and re-launch.