ACM - Advanced Controls Mod [Besiege v0.45]

Lench

Active Member
#1

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.



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.

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



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

Join the public Discord chat for help!
 
Last edited:

Lench

Active Member
#5
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.
 

Von

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

Dakila

New Member
#9
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
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.
 

Lench

Active Member
#11
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.
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#12
Wouldn't setting it to automatic and setting axis to change the speed work better?
 
#14
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!
 

Lench

Active Member
#15
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.
 

Lench

Active Member
#16
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
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.
 

Lench

Active Member
#18
alphanerd132 said:
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.
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
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.
 
Top