Profile image

Automatic gear shifting?

1,247 SteamPunkPilot  1.5 years ago

I'm back. Reason I was offline: forgor to post.

I'm making a car, and I want a gear shifting sistem, my idea is when reaching a certain speed, the car briefly throttles down, and then continues, just for the effect of gear shifting, I don't really want any... Interaction

Problem is, I succ at Funky Trees, so... Any help of how I could do that? Thanks.

  • Log in to leave a comment
  • Profile image

    @11qazxc thanks! I will test it out and tell you the results!

    1.4 years ago
  • Profile image
    6,220 11qazxc

    Pitch*clamp01((Time-smooth(Time,abs(rate(GS<V1))?9999:0))>T1)*clamp01((Time-smooth(Time,abs(rate(GS<V2))?9999:0))>T2) .... *clamp01((Time-smooth(Time,abs(rate(GS<Vi))?9999:0))>Ti)
    V1,V2...Vi is speed at which 1,2...ith gear switches in meters per second.
    T1,T2...Ti is time 1,2...ith gear needs to switch.

    1.4 years ago
  • Profile image
    83.5k ReinMcDeer

    @SteamPunkPilot I'll test it later

    1.5 years ago
  • Profile image

    @ReinMcDeer changed those &amp and &Lt correctly, still doesn't move.

    1.5 years ago
  • Profile image
    83.5k ReinMcDeer

    @SteamPunkPilot i think you put an extra * because of the italics
    Try
    Pitch*clamp01((GS>50 & GS<50+1))*clamp01((GS>80 & GS<80+2)

    &amp are more than symbols and &lt are less than

    1.5 years ago
  • Profile image

    @ReinMcDeer update: it's working, but when I add another gear it just doesn't move.

    Edit: this is the code I put in the Inputcontroller section of the engine

    Pitchclamp01((GS>50 & GS<50+1))*clamp01((GS>80 & GS<80+2)

    I put it in input.

    1.5 years ago
  • Profile image
    14.0k Griffon1

    @SteamPunkPilot
    As requested
    https://www.simpleplanes.com/a/y8Q0T3/PA-PX-532ST-WORKING-AUTO-TRANSMISSION

    1.5 years ago
  • Profile image
    83.5k ReinMcDeer

    @SteamPunkPilot Yep

    1.5 years ago
  • Profile image

    @Griffon1 I would like to see it!

    +1 1.5 years ago
  • Profile image

    @ReinMcDeer where should I add this to?

    I'm guessing the engine?

    I know... I'm slow...

    1.5 years ago
  • Profile image
    14.0k Griffon1

    I've actually coded an automatic transmission.
    I borrowed some code from a manual transmission and modified it to shift at certain rpms.
    It's rough, but it works.
    The manual transmission also had editable gear ratios in the variables so that was kinda cool
    I havent uploaded it yet, but I'd be willing to if you'd like to take a look.

    1.5 years ago
  • Profile image
    83.5k ReinMcDeer

    I've thought about this too
    Probably something like:
    Throttle*clamp01((GS>a & GS<a+x))
    Throttle can be changed to whatever you're using for the engine
    a = Gear change speed
    x = The smaller this is, the shorter the gear change
    Add more *clamp01((GS>a & GS<a+x)) to add more gears
    I don't know if car engines have throttleResponse as a variable, but if it does, set it to 1

    +2 1.5 years ago