Unsolved How Can I Activate an Electric Motor by Pressing a Key?

Discussion in 'Mod Support' started by TC203, Jun 15, 2021.

  1. TC203

    TC203
    Expand Collapse

    Joined:
    Sep 9, 2020
    Messages:
    133
    I'm thinking about making a helicopter pigeon where, to turn, I would need a seperate motor to spin a propeller and move the front/rear which would be activated by pressing a key. How could I do this?
     
  2. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,053
    I don't think this is possible, at least not easily. A better solution I think would be making it controllable with some LUA function rather than a motor, however I have no idea how that could work. Maybe take a look at how it's done in the Super Gnat mod.
     
  3. TC203

    TC203
    Expand Collapse

    Joined:
    Sep 9, 2020
    Messages:
    133
    I could use thrusters instead. Do you know if that’s possible?
     
  4. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,053
    Possible but could have side effects so I don't advise it, unless you are able to set the force of them just right, enough to make it rotate at the speed you need but not more
     
  5. TC203

    TC203
    Expand Collapse

    Joined:
    Sep 9, 2020
    Messages:
    133
    How can I activate thrusters by pressing a key? I know how to do it with hydros.
     
  6. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,053
    Take a look how it's done with JATO, it doesn't need a full on controller btw, just a LUA file that defines the variables you will use for it, but making it a controller is good because this way you won't have errors if you click the button when the part isn't equipped.
     
  7. TC203

    TC203
    Expand Collapse

    Joined:
    Sep 9, 2020
    Messages:
    133
    I don’t know how to code lua. What would the code be?
     
  8. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,053
    I guess similar to what you would have when using hydros, could be very simple, only a small portion of the JATO LUA is actually for the thrusters and controls, you could figure out which parts are for sound, glowmaps, fuel, etc. and not use them (though it would be cool to have fuel that can run out in the motor). If you can't figure it out I could try to do it for you later.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice