In-Code Basic Stairwell Creator

From Skyscraper Wiki
Revision as of 07:12, 23 April 2024 by Elevator1512 (talk | contribs)
Jump to navigation Jump to search

In-Code Basic Stairwell Creator is a script allowing users to create a stairwell in seconds rather than spending time doing it manually. It was made by escalatorgeek881 as part of the EG881 Integration Project. There are a couple limitations with this, such as the door being positioned in front of the stairs, floors having to be the same or similar height, and recommended for basic stairwells and not advanced ones.

Steps

#Step 1: Lets start by determining our stairwell coordinates. These two values will determine the stairwell's position in your building. To change these values, change the number after the equal sign to your desired value.

#Horizontal (x) Coordinate
Set 50 = 0

#Vertical (z) Coordinate
Set 51 = 0

#===========================================================================================

#Step 2: Now we will determine our stairwell's size. The longest side will be the length, and the corresponding axis will be in parenthesis.

#Length (x)
Set 48 = 18

#Width (z)
Set 49 = 9

#===========================================================================================

#Step 3: Now we must determine our start floor and end floor (or terminal floors). The terminal floors are inclusive. Before you set your terminal floors, make sure you have already created all of the floors that the stairwell will serve in the above code. Otherwise you will have an error.

#Lowest Floor
Set 54 = -21

#Highest Floor
Set 55 = 1

#===========================================================================================

#Step 4: Now we must determine the number of total steps we will have. Please notethat the resulting stairwell will have two sets of stairs for each floor. This means the number of steps each stair will have is half of this value you set.

#Number of Steps
#This hasn't been tested yet, so changing this may cause errors.
Set 56 = 20


#===========================================================================================

#Do not change this code.

Set 52 = %48% / 2
Set 53 = %49% / 2
Set 58 = %56% / 2

#stairs 1
CreateStairwell 1, %50%, %51%, %54%, %55%
CutStairwell 1, -%52%, -%53%, %52%, %53%, 0, 5

#===========================================================================================

#Step 5: Because these values cannot be set automatically from above, the terminal floors need to also be typed here. These must be the same as you set above.

#Terminal Floors
<Floors -21 to 1>

#===========================================================================================

#Step 6: Now its time to set our textures. Before changing the texture, make sure it has already been loaded in the texture section. The settings below are defaults.

#Landing/Floor Texture
Set 43 = Brick

#Wall Texture
Set 44 = StairsWall

#Ceiling (very top of stairwell) Texture
Set 45 = Ceiling1

#Stairs Texture
Set 46 = Stairs

#Door Texture
Set 47 = StairsDoor


#===========================================================================================

#Step 7: Now copy everything above and below and paste it into your building file. I recommend you place this at the end of your building code.

#===========================================================================================

#Do not change this code.


Set 57 = (%height% + Floor(%floor% + 1).InterfloorHeight) / %56%

if[%floor% < %55%] AddStairs 1, StairsLower, %46%, left, 0, -%53% / 2, %53%, %57%, %58% / (%58% - 1), %58%, 0, 0, 0
if[%floor% < %55%] AddStairs 1, StairsUpper, %46%, right, 0, %53% / 2, %53%, %57%, %58% / (%58% - 1), %58%, %57% * %58%, 0, 0
FloorOrientation = top

if[%floor% > %54%] AddStairsFloor 1, LandingLower, %43%, 0.5, -%52%, -%53%, -%56% / 4, %53%, 0, 0, 1, 1
if[%floor% = %54%] AddStairsFloor 1, LandingLower, %43%, 0.5, -%52%, -%53%, %52%, %53%, 0, 0, 1, 1
if[%floor% < %55%] AddStairsFloor 1, LandingUpper, %43%, 0.5, %56% / 4, -%53%, %52%, %53%, %57% * %58%, %57% * %58%, 1, 1

#Ceiling
FloorOrientation = bottom
DrawWalls = true, false, false, false, false, false
if[%floor% = %55%] AddStairsFloor 1, StairsCeiling, %45%, 0.5, -%52%, -%53%, %52%, %53%, %height% - 0.4, %height% - 0.4, 1, 1

DrawWalls = false, true, false, false, false, false
WallOrientation = right
AddStairsWall 1, LandingLowerCover, %43%, 0.1, -%56% / 4, -%53%, -%56% / 4, 0, 0.5, 0.5, -0.5, -0.5, 0, 1
DrawWalls = true, false, false, false, false, false
WallOrientation = left
if[%floor% < %55%] AddStairsWall 1, LandingUpperCover, %43%, 0.1, %56% / 4, 0, %56% / 4, %53%, 0.5, 0.5, (%57% * %58%) - 0.5, (%57% * %58%) - 0.5, 0, 1
DrawWalls = true, true, false, false, false, false

SetAutoSize = true, false
WallOrientation = right
AddStairsWall 1, LeftWall, %44%, 0.3, -%52%, -%53%, -%52%, %53%, %fullheight%, %fullheight%, -%interfloorheight%, -%interfloorheight%, 0, 3
AddStairsWall 1, FrontWall, %44%, 0.3, -%52%, -%53%, %52%, -%53%, %fullheight%, %fullheight%, -%interfloorheight%, -%interfloorheight%, 0, 3
WallOrientation = left
AddStairsWall 1, BackWall, %44%, 0.3, -%52%, %53%, %52%, %53%, %fullheight%, %fullheight%, -%interfloorheight%, -%interfloorheight%, 0, 3
AddStairsWall 1, RightWall, %44%, 0.3, %52%, -%53%, %52%, %53%, %fullheight%, %fullheight%, -%interfloorheight%, -%interfloorheight%, 0, 3
SetAutoSize = true, true

AddStairsDoor 1, %47%, 0.2, 1, -%52%, 0, 3.5, 8, 0, 1, 1
<EndFloors>

#===========================================================================================

#Congratulations. You have finished making your basic stairwell. Open your building and see the results. If the results are not what you desired you can change any of the values you set in the building code and test it until you get your desired results.</nowiki>

See also