An Roller-Coaster Control [Wiremod]

Hi guys

im a begginer on wiremod, so a noob !

I want to do an rollercoaster control (controls the speed of the car)

I want to do on E2, i think its easy but I don’t know how to do…

I want a timer on E2, when the timer equals 5, a thruster will turn on, and after more 5 seconds this same thruster will turn off and i want to do this with a lot of thrusters to control the velocity…

do you can help me ?

thx.

Well, it’s a bit better to wait until you’re semi-good with Wire before E2, but I’ll give you one anyway.


@name Roller Coaster
@inputs Power
@outputs Thrust
@persist IsOn

if (first() | duped()) {
  IsOn = 0
}

if (Power) {
  if (IsOn) { IsOn = 0 }
  if (!IsOn) {
    IsOn = 1
    timer("ThrustOn", 5000)
  }
}

if (clk("ThrustOn")) {
  if (IsOn) {
    Thrust = 1
    timer("ThrustOff")
  }
}

if (clk("ThrustOff")) {
  Thrust = 0
}

Should work, not going to test.

Wire the Power input to anything that doesn’t toggle (i.e. non-toggle button, Adv Pod Controller). Wire your thrusters to the Thrust output.

uow. its works but so only correct the other timer char

But realy thx !

so… i’m with other question…

How i can active this expression after “times” so…

I active this expression once and after the e2 ends, after a 4 seconds the expression actives again…

how I do this ?

thx

Oh, I see what’s wrong.


@name Roller Coaster
@inputs Power
@outputs Thrust
@persist IsOn

if (first() | duped()) {
  IsOn = 0
}

if (Power) {
  if (IsOn) { IsOn = 0 }
  if (!IsOn) {
    IsOn = 1
    timer("ThrustOn", 5000)
  }
}

if (clk("ThrustOn")) {
  if (IsOn) {
    Thrust = 1
    timer("ThrustOff")
  }
}

if (clk("ThrustOff")) {
  Thrust = 0
  if (IsOn) { timer("ThrustOn") }
}

I forgot a line :-/

The highlighted lines have errors:
Error here:


timer("ThrustOff"

, 5000


)

And here:


if (IsOn) { timer("ThrustOn"

, 5000


) }

Edit:
I’ll see if I can make a better one :smiley:


@name Interval thrust
@inputs Activate
@outputs Thrust
@persist
@trigger all
if (Activate) {interval(5000)} else {Thrust = 0}
if (clk()) {Thrust = !Thrust}

How’s that? :smiley:

Edit:
By the looks of it, your code uses a non-toggle input.
Mine is much more effective (due to being only 2 lines) but it needs to have a Toggled input.

I’d like it if you told me what the errors WERE :-/

Highlighted in red. You need to specify how long you want the timers to run. You forgot to put “, 5000” there.

Oh. Der.

Need to stop posting in the middle of the night.