E2 Confusion.

Hello I’m using this code…(For my helicopter using 4 thrusters w/gyroscope balance)


@name Balance
@inputs Pitch Roll DeltaPitch DeltaRoll W A S D Space Shift
@outputs PP PM RP RM

PP=Pitch+(DeltaPitch*2)+(A*20)+(Space*20 - Shift*5)
PM=-(Pitch+(DeltaPitch*2))+(D+20)+(Space*20 - Shift*5)
RP=Roll+(DeltaRoll*2)+(W*20)+(Space*20 - Shift*5)
RM=-(Roll+(DeltaRoll*2))+(S*20)+(Space*20 - Shift*5)

#PP=Pitch Positive
#PM=Pitch Negative
#RP=Roll Positive
#RM=Roll Negative

But it keeps adding thrust even when im not using a adv pod… im bad at e2, can anybody help me out here?

You’ll need to add an if/else clause. If (Active [Active of course being the pod controller’s output for whether someone is in the pod] =1) then (all of your current code) else (all outputs = 0)

Obviously, that’s not proper syntax, but from what you’ve got already it seems like you can figure it out. And in the future, you should direct your questions to wiremod.com, who will generally be more supportive in matters relating to wire (especially E2’s)

I see… after further experimenting I ended up with


@name Balancea
@inputs Pitch Roll DeltaPitch DeltaRoll W A S D Space Shift
@outputs PP PM RP RM
runOnTick(1)
PP=Pitch+(DeltaPitch*2)
PM=-(Pitch+(DeltaPitch*2))
RP=Roll+(DeltaRoll*2)
RM=-(Roll+(DeltaRoll*2))
#For W,A,S,D control.(Left Right Forward Backward)
if (W) {PP=Pitch+(DeltaPitch*2)+10} else {PP=Pitch+(DeltaPitch*2)}
if (S) {PM=-(Pitch+(DeltaPitch*2))-10} else {PM=-(Pitch+(DeltaPitch*2))}
if (A) {RP=Roll+(DeltaRoll*2)+10} else {RP=Roll+(DeltaRoll*2)}
if (D) {RM=-(Roll+(DeltaRoll*2))-10} else {RM=-(Roll+(DeltaRoll*2))}
#For Space,Shift
if (Space) {PP=Pitch+(DeltaPitch*2)+20} else {PP=Pitch+(DeltaPitch*2)}
if (Space) {PM=-(Pitch+(DeltaPitch*2))+20} else {PM=-(Pitch+(DeltaPitch*2))}
if (Space) {RP=Roll+(DeltaRoll*2)+20} else {RP=Roll+(DeltaRoll*2)}
if (Space) {RM=-(Roll+(DeltaRoll*2))+20} else {RM=-(Roll+(DeltaRoll*2))}
if (Shift) {PP=Pitch+(DeltaPitch*2)-20} else {PP=Pitch+(DeltaPitch*2)}
if (Shift) {PM=-(Pitch+(DeltaPitch*2))-20} else {PM=-(Pitch+(DeltaPitch*2))}
if (Shift) {RP=Roll+(DeltaRoll*2)-20} else {RP=Roll+(DeltaRoll*2)}
if (Shift) {RM=-(Roll+(DeltaRoll*2))-20} else {RM=-(Roll+(DeltaRoll*2))}
#PP=Pitch Positive
#PM=Pitch Negative
#RP=Roll Positive
#RM=Roll Negative

Strangely it still doesn’t work with a adv pod. What I’m I doing wrong?

try the wiremod forums, you’re much more likley to get help there. :slight_smile:

The first code was better.

I edited your code to make it turn off when the player gets out of the seat.
The edited parts are in red.


@name Balance
@inputs 

Active


 Pitch Roll DeltaPitch DeltaRoll W A S D Space Shift
@outputs PP PM RP RM



if (Active) {



PP=Pitch+(DeltaPitch*2)+(A*20)+(Space*20 - Shift*5)
PM=-(Pitch+(DeltaPitch*2))+(D+20)+(Space*20 - Shift*5)
RP=Roll+(DeltaRoll*2)+(W*20)+(Space*20 - Shift*5)
RM=-(Roll+(DeltaRoll*2))+(S*20)+(Space*20 - Shift*5)


} else {
PP = PM = RP = RM = 0
}