ObjectPlus
It contains good-faith information, such as an existing building or content. |
ObjectPlus is a script made by EG881 as a part of EG881 Integration Project Build 10. There are several functions available such as drawing, creating different lines, as well as escalators. Most of this was last updated by EG881 on January 16, 2017, and hasn't been updated since then.
NOTE: This list below is still a work in progress and was originally made by EG881, so all credit goes to EG881.
Control Functions
OP_Draw – the specialized ObjectPlus equivalent of DrawWalls, this function sets which components or sides of an object are drawn. Generally, OP_Draw will follow the conventions used for DrawWalls.
Syntax: OP_Draw(1, 2, 3, 4, 5, 6)
Each of these parameters can be either true to enable the side/component or false to disable the side/component. All of these are initially set to true at startup, but if any are set to false it will apply to all subsequent functions in your building script until reset back to true when OP_Draw is called again.
Each function in this guide lists which component or side the OP_Draw parameters will affect. Some functions will not use all six parameters.
Standard Shapes
- OP_Line – creates a floor using two points each with x, y, z, and width values drawn perpendicular to the line created by the two points. This is essentially an angled AddFloor. Also, the function does not use OP_Draw.
Syntax: OP_Line(destobject, name, texture, aligntexturemap, x1, y1, z1, w1, x2, y2, z2, w2)
destobject specifies the destination object (floor, external, buildings, landscape, or elevator). name is the name of the object. texture is the texture of the object. aligntexturemap currently does nothing. x1, y1, and z1 correspond to the x, y, and z coordinates of the first point. w1 is the width of the floor at the first point. Likewise, x2, y2, z2, and w2 correspond to the x, y, z, and width values at the second point.
The width is always drawn to the right 90° from the direction of drawing. In other words, when travelling down the line from P1 to P2, the width will always draw to your right.
- from –z to the +z direction, width will draw towards the +x direction
- from +z to the –z direction, width will draw towards the –x direction
- from –x to the +x direction, width will draw towards the –z direction
- from +x to the –x direction, width will draw towards the +z direction
OP_MultiLine – creates a path of connected floors using multiple points. This is useful in making curving 3D objects such as curved railings, roads, or track. Currently, MultiLine is limited to a maximum of 7 points. Like OP_Line, the function also does not use OP_Draw.
Syntax: OP_MultiLine(drawingmethod, destobject, name, texture, tilex, tilez, numberofpoints, x1, y1, z1, w1, x2, y2, z2, w2, x3, y3, z3, w3...)
drawingmethod does nothing. destobject specifies the destination object (floor, external, buildings, landscape, or elevator). name is the name of the object. texture is the texture of the object. tilex and tilez are the texture tiling values. numberofpoints specifies the number of points in the multiline (maximum is 7). xn, yn, and zn correspond to the x, y, and z coordinates of point n. wn is the width or the line at point n.
Similar to Line, the width is always drawn to the right 90° from the direction of drawing. In other words, when travelling down the line from P1 to P2, the width will always draw to your right.
- from –z to the +z direction, width will draw towards the +x direction
- from +z to the –z direction, width will draw towards the –x direction
- from –x to the +x direction, width will draw towards the –z direction
- from +x to the –x direction, width will draw towards the +z direction
MultiLine uses a set of special non-trigonometric formulas to calculate the points Qn in the Figure 2. These were mathematically derived using similar triangle and vector bisector properties.
OP_Polygon – creates a regular polygon (equal side lengths) with an arbitrary number of sides. Current restrictions include a maximum of 10 sides. The polygons are drawn to be inscribed in a circle (see Figure 3). The function also doesn't use OP_Draw.
Syntax: OP_Polygon(drawingmethod, destobject, name, texture, numberofsides, centerx, centerz, radius, altitude)
drawingmethod was created to allow the polygon to be drawn as if it were circumscribed about a circle, however this function was discontinued for OP_AdvPolygon and was only programmed to do inscribed polygons. destobject specifies the destination object (floor, external, buildings, landscape, or elevator). name is the name of the polygon object. texture is the texture of the object. numberofsides specifies the number of sides the polygon will have (current maximum is 10). centerx and centerz are the respective x, and z coordinates of the center of the polygon. radius specifies the distance from the center to the vertices when inscribed or the distance from the center to the midpoint of each side when circumscribed.
Currently, the polygon will always draw starting at the +x direction from the center (x = centerx + radius, z = centerz). A rotation parameter will be added later to allow rotating the polygon at an arbitrary angle counterclockwise from the +x axis.
Escalators
OP_Balustrades – sets the texturing and dimensions for the escalator’s left and right balustrades. This is applied to all escalators created until this function is called again with one or more settings changed.
Syntax: OP_EscBalustrades(texture, thickness, height, tw, th)
OP_Draw The Draw parameters are set for the escalator as a whole. See OP_Escalator.
- texture is the texture of the balustrades on both the inner and outer sides.
- thickness is the thickness of the balustrade. The midpoint between the inner and outer walls of the balustrades will run along the centerline of the truss
- height specifies the height of the balustrade, including the extra height from the truss at each side of the steps
- tw and th are the texture tiling parameters applied to the balustrades.
OP_EscLanding – sets the texturing and depths for the lower and upper landings of the escalator. This is applied to all escalators created until this function is called again with one or more setting changed.
Syntax: OP_EscLanding(lowerlandingtexture, lowerlandingdepth, twl, thl, upperlandingtexture, upperlandingdepth, twu, thu)
OP_Draw The Draw parameters are set for the escalator as a whole. See OP_Escalator.
- lowerlandingtexture is the texture of the lower landing, typically steel plates grooved perpendicular to escalator travel.
- lowerlandingdepth is the distance from where the steps come out (up) or go in (down) to the opposite edge of the landing. The width of the lower landing is the full width of the escalator from outer edge to outer edge, or step width + 2 * truss width
- twl and thl are the texture tiling parameters applied to the lower landing.
- upperlandingtexture is the texture of the upper landing, typically the same as the lower landing.
- upperlandingdepth is the distance from where the steps come out (down) or go in (up) to the opposite edge of the landing. The width of the upper landing is the full width of the escalator from outer edge to outer edge, or step width + 2 * truss width
- twu and thu are the texture tiling parameters applied to the upper landing.
OP_EscHandrails – sets the texturing and dimensions for the handrails running along the top of the balustrades. This is applied to all escalators created until this function is called again with one or more setting changed.
Syntax: OP_EscHandrails(texture, width, height, tw, th)
OP_Draw The Draw parameters are set for the escalator as a whole. See OP_Escalator.
- texture is the texture of the handrail.
- width is the width of the handrail. The centerline of the handrail will be aligned with the centerline of the truss and balustrades.
- height is the height of the handrail. This is generally a very small number. The total height of the handrail from the steps is the handrail height + the balustrade height
- tw and th are the texture tiling parameters applied to the handrails.
- The tracks that the handrails run on are set to be ½ inch (0.0417 ft.) thick and one inch (0.083 ft.) wider than the handrails. The track texture is the same as the step siding texture.
OP_EscTruss – sets the texturing and dimensions for the truss (step siding) and the texture of the underside covering the escalator’s structure and returning steps. This is applied to all escalators created until this function is called again with one or more setting changed.
Syntax: OP_EscTruss(trusstexture, outsidecoveringtexture, width, twt, tht, twoc, thoc)
OP_Draw The Draw parameters are set for the escalator as a whole. See OP_Escalator.
- trusstexture is the texture of the step siding, generally a metallic texture.
- outsidecoveringtexture is the texture of the escalator’s underside covering, generally metallic or a wall texture.
- width is the width of the escalator step siding. A good range is 0.5 ft. - 1 ft.
- twt and tht are the texture tiling parameters applied to the step siding.
- twoc and thoc are the texture tiling parameters applied to the outside covering.
OP_Escalator – creates a working escalator with its entire part assembly, including the truss, underside, handrails, landings, and balustrades. Due to the limitations of the escalator script in Skyscraper Simulator, escalators are limited to the four cardinal directions orthogonal to the x- or z-axes and can only be added as a floor object.
Syntax: OP_Escalator(name, up/down, topfloor, speed, sound_file, risertexture, treadtexture, direction, CenterX, CenterZ, width, risersize, treadsize, num_steps, voffset, voffsettop, tw, th)
OP_Draw
- balustrades, handrails, stairs, and truss
- underside of escalator
- left/front of escalator
- right/back of escalator
- bottom end of escalator
- top end of escalator
- name is the name of the escalator.
- up/down determines the step movement direction (up or 1 for up, 0 for stopped, or -1 or down for down).
- topfloor specifies the floor where the upper landing sits.
- speed is the speed of the escalator.
- sound_file is the sound of the escalator while running.
- risertexture is the texture of the risers and treadtexture is the texture of the treads. These two parameters are applied using a texture override on the escalator object. This prevents textures from being rotated incorrectly, however this won’t work for right and back facing escalators as texture override doesn’t work correctly for escalator and stair objects. This problem is masked in back facing escalators as the textures will already be rotated correctly, but is problematic in right facing escalators. When adding such escalators, it is recommended that a step texture without a painted stripe is used until the texture override problem is fixed.
- direction is the direction in which the bottom landing sits and thus the direction the escalator faces (back (+z, north), front (-z, south), left (-x, west), right (+x, east)).
- centerx and centerz are used to position the escalator. If the escalator faces back or front, centerx is the x-coordinate of the escalator’s centerline and centerz marks the “ledge” location at the upper landing where the escalator stops rising. Likewise, when the escalator faces left or right, centerz is the z-coordinate of the escalator’s centerline and centerx marks the “ledge” location.
- width specifies the step width (in feet) of the escalator. The standard step widths are 24 inches (2 feet), 32 inches (2.67 feet), and 40 inches (3.33 feet). Use x/12 for x inches.
- risersize determines the height of the step risers and treadsize specifies the length of the treads (both are in feet). Escalators in the real world have a 30 degree or 35 degree inclination above horizontal. Try to aim for a tread and riser size that approximately creates these inclination angles.
- num_steps determines the number of rising steps from the bottom landing to the top landing. This number does not include the steps that are moving horizontally at the landings. When selecting a riser size, make sure that the riser size multiplied by the number of steps add up to the total height of the escalator, otherwise the balustrades and truss will not line up with the stairs.
- voffset is the vertical offset in feet of the lower landing from the base of the bottom floor.
- voffsettop is the vertical offset in feet of the upper landing from the base of the top floor specified in topfloor.
- tw and th are the texture tiling parameters applied to the steps
Todo List
- Prism function
- Arc function
- Add Tree function from SROC as a possible expansion
- Add Sphere function, with starting and ending angles from the +x and +y axis, detail level