Skip to content

Commit 3bf306d

Browse files
committed
Update
1 parent c529177 commit 3bf306d

File tree

9 files changed

+313
-0
lines changed

9 files changed

+313
-0
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
@name ballchair
2+
@inputs [Cam]:wirelink
3+
@outputs
4+
@persist [E,Seat]:entity [Speed,SpeedRamp,Accel,Height,SpeedYaw]:number [BallAngle]:angle [Velocity]:vector
5+
@trigger none
6+
@model models/sprops/cuboids/height12/size_1/cube_12x12x12.mdl
7+
8+
if (first()|dupefinished()|changed(Cam))
9+
{
10+
11+
E = entity(), E:setMass(3500), E:setAlpha(0)
12+
13+
# Customize
14+
Speed = 300 # Max speed
15+
Accel = 0.1 # How fast it accelerates
16+
Height = 30 # How tall it is (ball size scales)
17+
18+
Cam["Parent",entity] = E
19+
Cam["Position",vector] = E:toWorld(vec(45,0,50))
20+
Cam["Distance",number] = 35
21+
22+
function void createHolo(Index,Vector:vector,Scale:vector,Angle:angle,Color:vector,Model:string,Parent:entity,Material:string,Shading,Alpha){
23+
24+
# All positions and angles are local, not global
25+
holoCreate(Index,Parent:toWorld(Vector),Scale,Parent:toWorld(Angle),Color,Model)
26+
holoMaterial(Index,Material),holoDisableShading(Index,Shading),holoAlpha(Index,Alpha)
27+
holoParent(Index,Parent)
28+
29+
}
30+
31+
function angle getSurfaceAngle(Base:entity, Ranger:ranger)
32+
{
33+
34+
# Shoutout shadowscion
35+
local Ground = angnorm(Ranger:hitNormal():toAngle() + ang(90, 0, 0))
36+
return ang((cos(Ground:yaw() - Base:angles():yaw()) * Ground:pitch()), Base:angles():yaw(), (-sin(Ground:yaw() - Base:angles():yaw()) * Ground:pitch()))
37+
38+
}
39+
40+
function number lerpN(A,B,C)
41+
{
42+
return A + (B - A) * C
43+
}
44+
45+
createHolo(2,vec(0),vec(1),ang(0),vec(255),"models/sprops/geometry/sphere_72.mdl",E,"",0,255)
46+
holoScaleUnits(2,vec(Height*2))
47+
48+
createHolo(3,vec(0),vec(0.2,1,1),ang(0),vec(255),"models/props_vehicles/tire001c_car.mdl",noentity(),"models/debug/debugwhite",1,255)
49+
50+
# Spawns the seat automatically
51+
Seat = seatSpawn("models/nova/airboat_seat.mdl", E:toWorld(vec(0,0,Height+(Height/4))), E:toWorld(ang(0,-90,0)), 0), Seat:parentTo(E), Seat:setMaterial("sprops/sprops_grid_12x12")
52+
noCollideAll(Seat, 1)
53+
54+
rangerHitEntities(0)
55+
rangerFilter(E),rangerFilter(Seat)
56+
rangerHitWater(1)
57+
rangerPersist(1)
58+
runOnLast(1)
59+
60+
}
61+
62+
interval(40)
63+
64+
local Ranger = rangerOffset(Height*2, E:pos(), vec(0,0,-1))
65+
local BallRanger = rangerOffset(Height*2, E:toWorld(vec(0,0,0)), -E:up())
66+
local Distance = Ranger:distance()
67+
local Hit = Ranger:hit()
68+
local SurfaceAngle = Ranger:hit() ? getSurfaceAngle(E, Ranger) : ang(0, E:angles():yaw(), 0)
69+
70+
# The yaw doesn't work as good as I want it too but it's better than insta turning
71+
SpeedYaw = lerpN(SpeedYaw, E:vel():setZ(0):toAngle():yaw(), 0.2)
72+
BallAngle = (BallAngle + ang(E:vel():length() / (Height*0.15), 0, 0)):setYaw(SpeedYaw)
73+
Velocity = E:velL(), local DeltaV = $Velocity
74+
75+
local Jerk = ang(clamp(-E:velL():x() / 35, -20, 20), 0, clamp(E:velL():y() / 35, -20, 20))
76+
77+
# DRIVER CONTROLS
78+
local W = Seat:driver():keyForward()
79+
local A = Seat:driver():keyLeft()
80+
local S = Seat:driver():keyBack()
81+
local D = Seat:driver():keyRight()
82+
83+
Cam["Activated",number] = Seat:driver():isValid()
84+
85+
if(W|S|A|D) { SpeedRamp = lerpN(SpeedRamp, Speed, Accel) }
86+
else { SpeedRamp = lerpN(SpeedRamp, 0, 0.33) }
87+
88+
local Eye = rangerOffset(16834, Seat:pos(), Seat:toLocal(Seat:driver():eyeAngles()):forward())
89+
local B = -E:bearing(Eye:pos()), holoPos(3, Eye:pos()), holoAng(3, Eye:hitNormal():toAngle())
90+
91+
# Ball position
92+
holoPos(2, BallRanger:pos() + (E:up() * Height))
93+
holoAng(2, BallAngle)
94+
95+
# Force
96+
E:applyAngForce(((E:toLocal(SurfaceAngle+Jerk)+ang(0,B,0)) * 40 - E:angVel() * 6) * shiftL(ang(E:inertia())))
97+
E:applyForce(((((E:toWorldAxis(vec((-E:velL():x() / 6) + (SpeedRamp*(W-S)), (-E:velL():y() / 3) + (SpeedRamp*(A-D)), 0))+vec(0, 0, ((Height-(E:vel():length()/100)) - Distance) * (75) - (E:velL():z() * 2))) * E:mass()) / 3)))
98+
99+
E:propGravity(1 - Ranger:hit())
100+
101+
if (last()) { Seat:propDelete() }
172 KB
Loading
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Starfall - [GMOD E2] Ballmobile
2+
3+
## Details
4+
5+
### Author
6+
7+
- Author: galaxy (ZeroTut0rials) (GDOGS)
8+
- Steam Profile: https://steamcommunity.com/profiles/76561198128391261
9+
- YouTube: https://www.youtube.com/@ZeroTut0rials
10+
11+
### Publication Info
12+
13+
- Title: [GMOD E2] Ballmobile
14+
- Date (dd-mm-yyyy): 27-03-2022
15+
- Source: https://www.youtube.com/watch?v=slRZzEvLL34
16+
- Source: https://pastebin.com/MpgSbpJG
17+
- Source Accessed (dd-mm-yyyy): 28-09-2025
18+
19+
## Description
20+
21+
Video:
22+
[YouTube - [GMOD E2] Ballmobile](https://www.youtube.com/watch?v=slRZzEvLL34)
23+
24+
![image1](./image1.jpg)
25+
26+
Here is the code and I showed how to wire it in the video
27+
https://pastebin.com/MpgSbpJG
28+
Prolly not optimized and not the perfect way to make it but if you want to use it enjoy, maybe you can learn something from it or maybe not
205 KB
Loading

GarrysMod/garrysmod/data/starfall/hud/ESP&Chip Display/info.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818

1919
## Description
2020

21+
Video:
22+
[YouTube - GMOD starfall ESP/Chip Display (w Code)](https://www.youtube.com/watch?v=yml5khlsd5g)
23+
24+
![image1](./image1.jpg)
25+
2126
Pretty simple esp and chip display, but if you'd like to take a look at it or use it (NOT IN PVP !!)
2227

2328
here it is
108 KB
Loading
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Starfall - starfall homing rocket launcher
2+
3+
## Details
4+
5+
### Author
6+
7+
- Author: galaxy (ZeroTut0rials) (GDOGS)
8+
- Steam Profile: https://steamcommunity.com/profiles/76561198128391261
9+
- YouTube: https://www.youtube.com/@ZeroTut0rials
10+
11+
### Publication Info
12+
13+
- Title: GMOD starfall homing rocket launcher (w Code)
14+
- Date (dd-mm-yyyy): 01-08-2022
15+
- Source: https://www.youtube.com/watch?v=p9x4efe7iKo
16+
- Source: https://pastebin.com/Wckjc2eu
17+
- Source Accessed (dd-mm-yyyy): 28-09-2025
18+
19+
## Description
20+
21+
![image1](./image1.jpg)
22+
23+
Video:
24+
[YouTube - GMOD starfall homing rocket launcher (w Code)](https://www.youtube.com/watch?v=p9x4efe7iKo)
25+
26+
Works as shown in the video! You might need permissions to use setpos
27+
Code: https://pastebin.com/Wckjc2eu
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
--@name NUCLEAR ROCKET LAUNCH
2+
--@author
3+
--@shared
4+
5+
if SERVER then
6+
7+
-- autowire screen
8+
if chip():isWeldedTo() ~= nil and chip():isWeldedTo():getClass() == 'starfall_screen' then chip():isWeldedTo():linkComponent(chip()) else error('Place on a starfall screen') end
9+
local screen, state, selectedplayer, missle = chip():isWeldedTo(), 'ready', owner() screen:setColor(Color(0,0,0,1))
10+
local counter = 0
11+
12+
-- keyboard input => gmod_wire_keyboard
13+
local keyboard = prop.createSent(screen:localToWorld(Vector(screen:obbSize().x/2,0,10)), screen:localToWorldAngles(Angle(-55,0,0)), 'gmod_wire_keyboard', false,
14+
{
15+
AutoBuffer = true,
16+
EnterKeyAscii = true,
17+
Model = "models/beer/wiremod/keyboard.mdl",
18+
Synchronous = true
19+
}) keyboard:setParent(screen)
20+
21+
-- keyboard input => gmod_wire_keyboard
22+
local button = prop.createSent(screen:localToWorld(Vector(screen:obbSize().x/2-10,-screen:obbSize().y/2+9,2)), screen:localToWorldAngles(Angle(0,0,0)), 'gmod_wire_button', false,
23+
{
24+
description = "NUKE!!!!!!!!!!!",
25+
entityout = false,
26+
Model = "models/cheeze/buttons2/up.mdl",
27+
toggle = false,
28+
value_off = 0,
29+
value_on = 1
30+
}) button:setParent(screen)
31+
32+
-- inputs for starfall and wiring
33+
wire.adjustInputs({'KEYINPUT', 'BUTTON'}, {'string', 'number'})
34+
wire.create(chip(), keyboard, 'KEYINPUT', 'Output', 1, Color(0,0,0), 'cable/cable2')
35+
wire.create(chip(), button, 'BUTTON', 'Out', 1, Color(0,0,0), 'cable/cable2')
36+
37+
-- make the holo launcher prop that the missle shoots out of
38+
local launcher = holograms.create(screen:localToWorld(Vector(-screen:obbSize().x,screen:obbSize().y/2-6,45)), screen:localToWorldAngles(Angle(-30,0,90)), 'models/sprops/misc/tubes/size_1/tube_12x42.mdl', Vector(1,2.5,1)) launcher:setParent(chip())
39+
launcher:setMaterial('models/debug/debugwhite') launcher:setColor(Color(0,0,0)) launcher:suppressEngineLighting(true)
40+
41+
hook.add('input', 'checknames', function(input, value)
42+
if input == 'KEYINPUT' and value ~= nil then
43+
net.start('getinput')
44+
net.writeString(value)
45+
local plys = find.playersByName(value, true, false)
46+
selectedplayer = plys[1] or owner()
47+
net.writeTable(plys)
48+
net.send()
49+
end
50+
51+
if input == 'BUTTON' and value ~= nil and value == 1 then
52+
if state == 'ready' then
53+
54+
missle = prop.create(launcher:localToWorld(Vector(0,140,0)), launcher:localToWorldAngles(Angle(0,90,0)), 'models/props_phx/amraam.mdl', false)
55+
missle:setTrails(15, 25, 1, 'trails/smoke', Color(155))
56+
state = 'firing'
57+
58+
end
59+
end
60+
end)
61+
62+
-- interval
63+
timer.create('interval', 0.05, 0, function()
64+
65+
if state == 'firing' and isValid(missle) then
66+
--print(counter)
67+
if counter + 0.025 > 1 then
68+
--print('breaking')
69+
counter = 0
70+
state = 'ready'
71+
if not isValid(selectedplayer) then missle:setPos(Vector(0,0,0)) else missle:setPos(selectedplayer:getPos()) end
72+
missle:breakEnt()
73+
else
74+
--print('flying', selectedplayer)
75+
counter = counter + 0.025
76+
if not isValid(selectedplayer) then counter = 1 return end
77+
local curve = math.bezierVector(counter, launcher:localToWorld(Vector(0,140,0)),launcher:localToWorld(Vector(0,1600,200)),selectedplayer:getPos())
78+
local angCurve = math.bezierVector(counter+0.05, launcher:localToWorld(Vector(0,140,0)),launcher:localToWorld(Vector(0,1600,200)),selectedplayer:getPos())
79+
missle:setPos(curve)
80+
missle:setAngles((angCurve-curve):getAngle())
81+
end
82+
end
83+
end)
84+
85+
end
86+
87+
if CLIENT then
88+
89+
local keyinput, foundplys, cursorPos = 'input name...', find.allPlayers(), {x = 0, y = 0}
90+
net.receive('getinput', function()
91+
keyinput = net.readString()
92+
foundplys = net.readTable()
93+
if keyinput == '' then keyinput = 'input name...' end
94+
if #foundplys < 1 then foundplys = {owner()} end
95+
end)
96+
97+
local selectedplyfont = render.createFont("Arial",30,1000,false,false,true, false,0, false,0)
98+
local inputfont = render.createFont("Arial",20,900,false,false,true, false,0, false,0)
99+
local followupfont = render.createFont("Arial",25,900,false,false,true, false,0, false,0)
100+
render.setFont(inputfont) -- set the font
101+
102+
hook.add('render', 'drawscreen', function()
103+
104+
cursorPos.x, cursorPos.y = render.cursorPos(player())
105+
106+
render.setColor(Color(0,0,0,255))
107+
render.drawRect(0,0,512,512)
108+
109+
render.setColor(Color(50,100,200))
110+
render.drawRectOutline(60,150,512-120,1)
111+
render.setColor(Color(255,255,255))
112+
render.drawRectOutline(60,152,512-120,1)
113+
114+
render.setColor(Color(255,255,255,55)) -- input text draw
115+
render.setFont(inputfont)
116+
render.drawText(80,80,keyinput or 'nil',0)
117+
118+
if not isValid(foundplys[1]) then foundplys[1] = owner() end
119+
120+
render.setColor(team.getColor(foundplys[1]:getTeam()))
121+
render.setFont(selectedplyfont)
122+
render.drawText(256,110,foundplys[1]:getName(),1)
123+
124+
if #foundplys > 1 then
125+
render.setFont(followupfont)
126+
for k = 2, #foundplys do
127+
if k > 13 then break end
128+
if not isValid(foundplys[k]) then
129+
render.setColor(Color(255,255,255,55))
130+
render.drawText(256,140+23*(k-1),'Player left!',1)
131+
else
132+
render.setColor(team.getColor(foundplys[k]:getTeam())-Color(0,0,0,220))
133+
render.drawText(256,140+23*(k-1),foundplys[k]:getName(),1)
134+
end
135+
end
136+
else
137+
render.setColor(Color(255,255,255,85))
138+
render.setFont(followupfont)
139+
render.drawText(256,180,'<No other players found!>',1)
140+
end
141+
142+
render.setColor(Color(255, 255, 255))
143+
render.drawRect(0,450,512,512)
144+
render.setColor(Color(50,100,200))
145+
render.drawRectOutline(0,0,512,512)
146+
147+
end)
148+
149+
end

GarrysMod/garrysmod/data/starfall/vehicles/starfall car/original/info.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ First "big" thing I made with starfall, I'm just getting into it so it's prolly
2727

2828
Heres the code tho :D
2929
https://pastebin.com/p2PK7v33
30+
31+
older video:
32+
[YouTube - [GMOD E2] full holo car FINAL](https://www.youtube.com/watch?v=XQaPRw-ALhk)

0 commit comments

Comments
 (0)