This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--@name lib/controlsurface | |
--@author Cheezus | |
local deg, atan, sign = math.deg, math.atan, math.sign | |
local ControlSurface = class("ControlSurface") | |
local surfaces = {} | |
function ControlSurface:initialize(base, ent, axisEnt) | |
local worldEntAngle = ent:getAngles() | |
self.ent = ent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@name Jet Nozzle | |
@inputs A | |
@outputs Value | |
@persist MoveRate Value Segments Distance MinAng MaxAng [MainScale Scale1 Scale2]:vector | |
@persist StartAngles:array LastValue First | |
@trigger none | |
@strict | |
if(first() | dupefinished()) { | |
MoveRate = 0.1 # Rate at which nozzle can move |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--@name Sim Spring Suspension | |
--@author Cheezus | |
--@server | |
--@include lib/spring.txt | |
-- Link front two wheels and then rear two wheels with adv e marker | |
-- Only update suspension when vehicle is frozen | |
local frontOffset = Vector(0, 0, 0) -- Position offset from wheel to place the end of the spring | |
local frontConstant = 10000 -- Newtons per meter of displacement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--@name lib/spring | |
--@author Cheezus | |
local clamp, max = math.clamp, math.max | |
local Spring = class("Spring") | |
local springs = {} | |
local springID = 0 | |
--- Create a new spring controller. | |
-- @param e1 The first entity to attach the spring to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--@name Joystick Controller | |
--@shared | |
--[[ | |
INSTRUCTIONS/INFO: | |
1. Spawn this chip on a Starfall screen and move your input device around/press buttons on it | |
2. Fill the axes and buttons tables below using the formats described below | |
- Wire outputs will automatically be created based on table names | |
- DeviceID is displayed on the top of the screen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--@name Joystick Helper | |
--@author Cheezus | |
--@shared | |
if SERVER then | |
local ent = chip():isWeldedTo() | |
if isValid(ent) and ent:getClass() == "starfall_screen" then | |
ent:linkComponent(chip()) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--@name Mesh Loader | |
--@author Cheezus | |
--@shared | |
local debugPrints = true -- Shows info about tri count and loading progress | |
if CLIENT then | |
local globalScale = Vector(0.1) -- Scale all meshes added by this amount, or add a scale vector to individual meshes | |
local offsetPos = Vector(0, 0, 0) -- Offsets are relative to chip/base | |
local offsetAngle = Angle(0, 0, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--@name tools/CPU Tracker | |
--@author Cheezus | |
--@shared | |
-- To use this chip, spawn it on a Starfall screen component | |
if SERVER then | |
if chip():isWeldedTo() then | |
chip():isWeldedTo():linkComponent(chip()) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--@name Car Steering v3.4 | |
--@author Cheezus | |
--@shared | |
--@model models/sprops/rectangles_thin/size_2/rect_12x12x1_5.mdl | |
local showAxes = true | |
local frontWheelPos = Vector(50, 0, 0) -- Between your front wheels | |
local rightAxis = Vector(0, -1, 0) -- The RIGHT facing direction of your car | |
local upAxis = Vector(0, 0, 1) -- The UP facing direction of your car |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--@name Simulated Gearbox | |
--@author Cheezus | |
--@shared | |
local crankAxis = Vector(0, 0, 1) -- Rotation axis of the crankshaft | |
local flywheelAxis = Vector(0, 0, 1) -- Rotation axis of the flywheel | |
crankAxis:normalize() | |
flywheelAxis:normalize() | |
if SERVER then |
NewerOlder