Don’t know if this is the right forum but move it if it isn’t.
Ok so this is a little tutorial on setting up my little Companion as I call it.
It’s a hovercraft completely made of E2.
I have something similar just a hella lot better in a contraption I’ll post soon, a VTOL.
But here’s something for you simple guys that you can use when you are bored!
@name Pac's companion
@inputs Pod:wirelink
@persist W A S D E:entity Ground:vector Dir:vector Vel:vector Mov:vector Acc
runOnTick(1)
if (first()) {
soundPlay(1, 0, "ambient/machines/machine2.wav")
}
soundPitch(1, abs(Vel:y()/100)+80)
E = entity()
W = Pod:number("W")
A = Pod:number("A")
S = Pod:number("S")
D = Pod:number("D")
Dir = E:right():setZ(0)
Ground = rangerOffset(10000, E:pos(), vec(0, 0, -1)):position()
Vel = E:velL()
Mov = E:forward()*Vel:x()/5 + vec(0, 0, E:vel():z()) - E:right()*Vel:y()/20
Acc = clamp((W | S ? Acc+(S-W)*150 : Acc-(Acc/20)), -4000+(A | D)*1000, 1000)
applyForce((Ground+vec(0, 0, 40)-E:pos())*500-Mov*50+Dir*Acc)
applyAngForce(angnorm(-E:angles()+ang(-E:angVel():yaw()*Vel:y()/3500, 0, 0)-E:angVel()/7):setYaw(-E:angVel():yaw()/20+(A-D)*3)*700)
So that’s the E2 code.
Not too hard to understand if you know what you’re dealing with.
Now, the tutorial on how to set it up:
- First of all we’re gonna get the prop the hovercraft will use (Best with this prop), you do this by typing
wire_expression2_model models/hunter/plates/plate1x2.mdl
in your console.
-
Copy-Paste the code from above and put it into an Expression2!
-
Spawn the E2
Wiring it up!
Wiring has been done as simple as possible. Only one wire is required to be correct.
Thanks to wirelink!
-
Ok now, spawn a seat and an Advanced-Pod-Controller.
-
Link the Pod controller to the seat/chair.
-
Shoot the Advanced-Pod-Controller with the Expression2-wirelink tool!
-
Wire the “Pod [WIRELINK]” input on the E2 to the Advanced-Pod-Controller’s [WIRELINK] output.
-
Enjoy!
Also! I recommend that you turn gravity OFF of the seat AND Adv-Pod-Controller!
This is how it should look like (The plate is E2, red thing is the Adv-Pod-Controller):
http://img200.imageshack.us/img200/144/gmflatgrass0000.jpg
This E2 includes sounds, cool movement and is just pure awesome when bored
Your only controls are simple as well!
Just W, A, S and D!
If you have problems setting it up then try again and if that fails, make a reply to this thread!