ACM - Advanced Controls Mod [Besiege v0.45]

Discussion in 'Besiege: Modding' started by Lench, May 16, 2016.

  1. Lench

    Lench Active Member

    [​IMG]
    ACM allows you to control blocks in many new ways, including with controller or joystick and mouse.
    It introduces analog input for most blocks in game and enables control of slider values while simulating.

    [​IMG]

    Features
    Input axes include controller or joystick axes and two key axes.
    Additionally, for more complex configurations, you can combine multiple axes or write your own axis in Python.
    With these you can control all sliders, cogs, wheels, pistons, springs, ropes, drills,
    steering hinges, steering blocks and camera. Full control list here.

    Dependencies
    Joysticks and controllers are accessed through SDL2 library.
    You will be prompted for automatic download when required.

    Controller Support
    ACM will read input from all joysticks and controllers. Unknown controllers might not get properly recognized.
    If your controller has incorrect axis or button names, you can help by filling out this form:

    Submitted information will be processed and automatically updated to other mod users.

    How to use
    Simply use the key mapper tool and click on a block. Advanced controls window will appear beside it.
    When you're not using it, you can quickly toggle it off in the settings menu.
    For more information on all features, read the wiki.

    Download
    Requires Spaar's Mod Loader

    [​IMG][​IMG]

    Source code available on GitHub. Report an issue
    here.
    Feedback and suggestions are very welcome.


    Join the public Discord chat for help!
     
    Last edited: Apr 8, 2017
    ZiJer likes this.
  2. wang_w571

    wang_w571 Member

    OMG
    OMG
    OMG
     
  3. be5invis

    be5invis New Member

    INTERESTING
     
  4. AGGR0

    AGGR0 New Member

    After the first simulation i can't place any block
     
  5. Lench

    Lench Active Member

    That's interesting. Would you send me the error log from the console so I know more?
    Edit: I Think I know what it is. Patch should be up shortly.
     
  6. Lench

    Lench Active Member

    Patch v1.0.1 is up, fixing many bugs found after the initial release.
     
  7. Von

    Von Administrator Staff Member

    This is seriously impressive stuff Lench. I know that Matt gave it a go with his Xbox controller and said its brilliant. :)
     
  8. Lench

    Lench Active Member

    Thanks! That means a lot to me. :)
     
  9. Dakila

    Dakila New Member

    This is so awesome! Im gonna test it with my ps3 controller tonight. Everything will return to center now! Even the demo gif was very well executed.
     
  10. Chartreuse Bison

    Chartreuse Bison New Member

    Two things:
    1. Trying to use the controller for a wheel, if I select the same axis as both input and speed so you can normally move the wheel, for some reason reverse no longer works. I don't know if this is a glitch or if I am not using it right.
    2. So you can only have the default controller axis because the game doesn't have controller support? Unity certainly can support controllers.
     
  11. Lench

    Lench Active Member

    1. It's not a glitch. Think about what happens. Let's say you have both input and speed controls in range from -1 to 1. When you push the controller forward, the input control and slider control are set to 1, so the wheel moves forward. When you push it back, the input control is -1 so it should move backwards, but because slider control is -1 too, it inverts the direction so it still moves forward (because -1 * -1 = 1). For moving the wheel, just use the input control.
    2. Unity does support multiple controllers. Problem is I cannot access and change the Input manager of the game, which would allow me to define multiple controllers and axes. I am working on getting input through SDL, which should workaround the problem.
     
  12. ITR

    ITR l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ Staff Member

    Wouldn't setting it to automatic and setting axis to change the speed work better?
     
  13. Lench

    Lench Active Member

    It would work exactly the same as just controling input and leaving speed slider uncontrolled. You can do it either way.
     
  14. Dakila

    Dakila New Member

    I've been messing around with this for a couple of days now and so far have been very impressed. I think this mod can also be helpful for people who don't have controllers too. Everything works pretty much how i want it too except if i open and close the game my axes don't get saved for the next game session :(. Does this happen to everyone or is it just me?

    suggestion for future update:
    Can the gravity and sensitivity dials go up to 20 for even faster reaction times if you need it?

    Thanks again for your mod and your time!
     
  15. Lench

    Lench Active Member

    Thanks for your feedback!

    Input axes only get saved to the machine that uses them. However, since they're usually more device than machine specific, saving them for the next session is a good idea. I'll definitely implement this.

    I probably won't be changing the gravity and sensitivity dials though, but rather introduce new types of input axes, or add more configurability to the existing ones. You can also try turning Snap toggle on if you want it to be more responsive.
     
  16. Lench

    Lench Active Member

    Update v1.1.0 is up

    One key and Two key axis have been merged.
    You can now choose between Standard and Inertial axis.
    Maintains backwards compatibility.

    Custom programmed axes are now run by IronPython engine.
    Download full LenchScripterMod if you want to use them.
     
  17. alphanerd132

    alphanerd132 New Member

    Okay. I have a few questions. 1: how do you get the "create new controller axis" to work for the xbox 380 triggers. and B: What is the name for the buttons in the custom controller script.
     
  18. Lench

    Lench Active Member

    Unfortunately, controller axis will only recognize two default axes on a controller because of Input manager limitations, but I'm already working to resolve this. So what you see is what you get, for now.

    In custom axis, you can call UnityEngine.Input and UnityEngine.KeyCode to get your key presses. More features in LenchScripterMod documentation.

    Custom axis value is to be returned in an interval [-1, 1].
    For example:

    Code:
    axis_value = 0
    if Input.GetKey(KeyCode.LeftArrow):
        axis_value += 1
    if Input.GetKey(KeyCode.RightArrow):
        axis_value -= 1
    axis_value
    
    Controller buttons will be KeyCode.JoystickButton0, KeyCode.JoystickButton1 etc. If you have trouble determining which one is which, just open up a standard axis and try binding them there.

    Also, just fixed some custom axis related bugs, so make sure you download v.1.1.1 first.
     
  19. RedWingz

    RedWingz New Member

    These are the kind of mods I would love to see. Nice job, dude.
    But could add the ability to go back into the previous position once the input is back in that position? basically i'm trying to use a joystick or controller to fly one of my planes.
     
  20. Lench

    Lench Active Member

    Thanks!

    Try using the Angle control on steering blocks for that (see the hinge on the gif). Or position control if you're using pistons.

    Edit: Also, see how I do it here: https://www.youtube.com/watch?v=cA0D5SVzK18
     

Share This Page