Here is a semi-large post with all my major contraptions that i have learned from the past month of building with gmod and wire.
I'm posting this in hopes that new people to wire can learn a little easier from these. Most tutorials are much older and don't use Expression Chips to their full potential like these things do.
If anyone does any kind of improvements i would love to see them!
Just a Note:
Most of my functions are inside of a "clk" check. The main reason behind this, is if the chips are updated to often, by a external component like a Beacon sensor or button, the code is executed to early and causes things to "shake" (when using thrusters to stabilize). So the "clk" check prevents that.
Enjoy.
1) MadDog's Flyer v1
I built this little flyer in about 30min using the Stabilizer contraption below as its base. It uses the Adv Pod Controller for control.
It hovers and moves using thrusters only. It works in Sandbox but also works in Spacebuild. If you hold down shift it makes it move a little faster and makes the craft tilt when turning. For only about 30min of work, its pretty fun to fly around and smash into people hehe.



Video:
[ame=http://www.youtube.com/watch?v=3VP61EOG7rE]YouTube - MadDogs Flyer v1[/ame]
Controls:
W=Forward, A=Left, S=Back, D=Right
Mouse1=Up, Mouse2=Down
Shift=Boost and Left/Right/Forward/Back Tilt
Advanced Dup Download Here (Right Click Save As)
Expression code:
HTML Code:
N@MadDogs Flyer v1
I@W A S D Shift Mouse1 Mouse2
O@TP TR TY VF VL TZ FT
interval(30)
first()->AddZ=extposz();
Shift==1->Value+=1,Value2+=0.5;
(A==0&D==0)->Value-=1*(Value>0);
(Mouse1==0&Mouse2==0)->Value2-=0.5*(Value2>0);
Value>50->Value=50;
Value2>=25->Value2=25;
AddZ+=(Mouse1-Mouse2)*(Value2+3)
clk()->
Roll=angnorm(extangr()+((D-A)*Value*W))
Pitch=angnorm(extangp()+((Mouse2-Mouse1)*Value2))
Yaw=angnorm(extangy()),X=extvelx(),Y=extvely(),Z=extposz()
TP=Pitch*2+(*15)
TR=Roll+(*15)
TY=(D|A?((D-A)*((Shift==1?3:0.5)*(W?18:1))):*10)
VL=X+(*1.6)*(A==1|D==1)
VF=Y+(*1.6)*(W==1|S==1)
TZ=((AddZ-Z)*2-(*15)*cos(Pitch))
W==0&S==0->FT=0;
W==1->VF=0,FT+=(Shift==1?10:0.2);
S==1->VF=0,FT+=(Shift==1?-10:-0.2);
;
Legend:
TP=Thrust Pitch
TR=Thrust Roll
TY=Thrust Yaw
VF=Velocity Forward
VL=Velocity Left
TZ=Thruster Z (bottom)
FT=Thruster Forward
2) MadDog's Stabilize Plate v1
This is the base of all my thruster hover contraptions. It uses only thrusters to hover and stabilize itself. I also added two thrusters that simulates air resistance so it doesn't float around.


Advanced Dup Download Here (Right Click Save As)
Expression code:
HTML Code:
N@MadDogs Stabilize Plate v1
I@None
O@TP TR TY TZ VL VR
interval(30)
first()->AddZ=extposz();
clk()->
Roll=angnorm(extangr()),Pitch=extangp(),Yaw=extangy()
X=extvelx(),Y=extvely(),Z=extposz()
TP=Pitch*2+(*5)
TR=Roll*2+(*5)
TY=Yaw*2+(*5)
VL=X+(*1.6)
VR=Y+(*1.6)
TZ=(AddZ-Z)*2-(*15)
;
Legend:
TP=Thruster Pitch
TR=Thruster Roll
TY=Thruster Yaw
TZ=Thruster Z (bottom)
VF=Velocity Forward
VL=Velocity Left
3) MadDog's Stabilize Vector Hover v1
This contraption is similar to above, except it uses a Vector Thruster and a XYZ input for its "go to" location. The vector thruster keeps it hovered, but also can make it go to a target. I have used this for everything from missiles, satellites, simple follow the laser pointer devices, space ship control, and tons of other things.
For those pretty new to Wire, you can use a Laser Pointer Receiver for the Target XYZ or use a Beacon sensor hooked up to a Target Finder (or Locater) to make it go to targets.


Advanced Dup Download Here (Right Click Save As)
Expression code:
HTML Code:
N@MadDogs Stabilize Vector Hover v1
I@TarX TarY TarZ
O@TP TR TY VecMul VecX VecY VecZ
interval(30)
TarZ+=30
clk()->
Roll=angnorm(extangr()),Pitch=extangp(),Yaw=extangy()
X=extposx(),Y=extposy(),Z=extposz()
TP=Pitch*2+(*5)
TR=Roll*2+(*5)
TY=Yaw*2+(*5)
Dis=vecdistance(vector(X,Y,Z),vector(TarX,TarY,TarZ))
VecMul=Dis+(*1.6)
VecX=(X-TarX)*2+(*15)
VecY=(Y-TarY)*2+(*15)
VecZ=(Z-TarZ)*2+(*15)
;
Legend:
TarX=Target X
TarY=Target Y
TarZ=Target Z
TP=Thruster Pitch
TR=Thruster Roll
TY=Thruster Yaw
VecMul=Vector Thruster Mul
VecX=Vector Thruster X
VecY=Vector Thruster Y
VecZ=Vector Thruster Z
Bookmarks