ACM - Advanced Controls Mod [Besiege v0.45]

#42
Yeah, I meant the joystick stick input, I've used your scripting mod aplenty. Also didn't realize about the curvature, thought that the linear input could be easily fixed so it'd be max angle at max input. And the problem with my controller is that it never hits the 0 mark. It jumps from 0.06 to -0.06 but after that it's fine and centered.
 

Lench

Active Member
#44
Last release (v1.2.4) windows download was packaged incorrectly. AdvancedControls folder was supposed to be Resources\AdvancedControls. This means that SDL2.dll library wasn't found on clients that have not installed this mod before.
This has been fixed now. You can now install the Windows release correctly just by extracting the files to the Mods folder.
 

Lench

Active Member
#45
Update v.1.2.5 brings automatic game controller mapping updates and other improvements, like update checker and automatic library installation.

If your controller is not properly recognized and mapped, you can submit information through the form below to get it supported.
http://goo.gl/forms/xoFDYdI4exNNWGVt2
 

Lench

Active Member
#46
Big update v1.3.0
  • All axes bound to the machine will now get saved in the .bsg file for easy sharing. Controller axes and buttons that belonged to creator's controller will get automatically resolved to users first connected device, but keep in mind that because of the differences this might swap axes. You can avoid this by submitting your controller information.
  • Added Mouse Axis that reads mouse position in given portion of the screen.
  • Standard and Inertial axis merged into a more configurable Key axis.
  • Flying block speed can now be controlled. Full control list here.
  • Other minor improvements
 
#49
Big thanks for this - it's actually made playing Besiege just as much fun as building in Besiege!

Mapping for PS4 controller is incorrect btw, will try and remember to submit data when I get home.

One thing that I would REALLY like as an improvement: the ability to have a kind of 'latching' (?) speed control: e.g. you set a spinning block to speed 1.00 as usual, then be able to use Trigger 1 to decrease the speed to e.g. 0.5, but ignore the values coming from the trigger as my finger releases and the trigger returns to it's 'rest' position. Then I can set up the other trigger the other way, to increase speed.

Not sure if this is possible with simple maths for the axes...I guess it would have to ignore any values between that are not an increase in axis value. Like if(newAxisValue > lastAxisValue) {return newvalue} else {return lastAxisValue} or something...then probably the opposite for the negative side of the axis...difficult to explain what I mean :p
 

Lench

Active Member
#50
Big thanks for this - it's actually made playing Besiege just as much fun as building in Besiege!

Mapping for PS4 controller is incorrect btw, will try and remember to submit data when I get home.

One thing that I would REALLY like as an improvement: the ability to have a kind of 'latching' (?) speed control: e.g. you set a spinning block to speed 1.00 as usual, then be able to use Trigger 1 to decrease the speed to e.g. 0.5, but ignore the values coming from the trigger as my finger releases and the trigger returns to it's 'rest' position. Then I can set up the other trigger the other way, to increase speed.

Not sure if this is possible with simple maths for the axes...I guess it would have to ignore any values between that are not an increase in axis value. Like if(newAxisValue > lastAxisValue) {return newvalue} else {return lastAxisValue} or something...then probably the opposite for the negative side of the axis...difficult to explain what I mean :p
Glad you like it!

What you are asking for can actually be done, but because there are infinite different ways how people like to set up their inputs, the system is rather complex.

There are two systems in place for complex inputs like this. First is axis chaining.
So you have left trigger and right trigger axes. You invert one of those. Then you create two chain axes: both link these trigger axes but one uses Min and other Max method. Then you create another chain axis and use Sum method, linking these two chain axes. I think this would roughly result in what you want.

Another way, which you will probably like more, is using custom axis. Here you can write your own axes in Python.
You can get references to other axes in initialisation code like this:

Code:
leftTrigger = AdvancedControls.GetAxis("axis name asdf")
rightTrigger = AdvancedControls.GetAxis("other axis name")
axis_value = 0    # initialize variables
Then you can use their values to calculate your own output value and create whatever you want.

Code:
if leftTrigger.OutputValue > axis_value:
    axis_value = leftTrigger.OutputValue
# something something
axis_value
You can read more about ACM API regarding axes here: https://github.com/lench4991/AdvancedControlsMod/wiki/API
The Python environment is the same as in my scripting mod. It's functions are documented here: https://github.com/lench4991/LenchScripterMod/wiki/Functions

If you run into any problems I'm happy to help, but since you actually used pseudocode to explain what you want, I think you'll be fine.
 
#51
You're welcome to believe that I wrote that in pseudocode (rather than just blurting out the C# that was rolling around in my head) :p

I'll check this out in more detail; haven't really played with the Min and Max types of the chain axis yet...guess I should have done that before posting here :p
 

Lench

Active Member
#52
You're welcome to believe that I wrote that in pseudocode (rather than just blurting out the C# that was rolling around in my head) :p

I'll check this out in more detail; haven't really played with the Min and Max types of the chain axis yet...guess I should have done that before posting here :p
Any code that has no language explicitly stated is by default pseudocode :p. Don't worry about posting here, it's a legit question. If you're worried about spamming the forums though, you can still PM me.
 
#53
Hi Lench, I'm having issues since update v0.32 Now even tho i have install sdl2 in my systems frameworks, When i want to create a new controller axis, it's still telling me i need SDL2 Library. I'm using the OSX version. Also the mod seems to crash the game when it's first opened, once i click reopen after the crash, its fine. And nothing seems to come up in the console. Plz help!
 
#54
I'll post here rather than PM in case anyone else wants to solve the same problem :)

So I have this Python so far (I have never written a line of Python in my life until now):

In the "Initialisation Code" TextBox:
Code:
bothTrigs = AdvancedControls.GetAxis("Both Triggers") #(I have a Chain Axis called Both Triggers that just subtracts one from the other)
axis_value = 0    # initialize variables
In the "Update Code" TextBox:
Code:
if bothTrigs.OutputValue > 0:
    axis_value = Max(axis_value,bothTrigs.OutputValue)
else:
    axis_value = Min(axis_value,bothTrigs.OutputValue)
axis_value
I've checked the maths and I'm pretty sure this is correct in terms of what I want to achieve, but I get this error:
Code:
NameError: Name 'Min' is not found
But according to the Python docs, Min is a standard built in function...what am I doing wrong?

Tried your chain axis suggestion btw, it doesn't do anything near what I want because there is no way of doing that IF statement to compare to the axis's current value.

Thanks
 
Last edited:
#55
Never mind, figured it out:

Code:
bothTrigs = AdvancedControls.GetAxis("Both Triggers")
axis_value = 0    # initialize variables
accel = 0.05 # how quickly to accelerate or decelerate while holding trigger
and

Code:
if((axis_value + (bothTrigs.OutputValue*accel))<=1 and axis_value + (bothTrigs.OutputValue*accel)>=-1):
    axis_value = axis_value + (bothTrigs.OutputValue*accel)
axis_value
So now I can set a wheel to Automatic, and use triggers to increase/decrease the speed without it stopping when I let go of the trigger :)
 
Last edited:

Lench

Active Member
#56
I've checked the maths and I'm pretty sure this is correct in terms of what I want to achieve, but I get this error:
Code:
NameError: Name 'Min' is not found
min and max are indeed Python built in functions, except they're all lower case.

Glad you figured it out.
 
#57
Something else about this mod that is becoming an annoyance for me: if I click in a TextBox to change a value, if there is a block under the cursor and behind the TextBox, that block gets selected and the parameter window changes to show parameters for that block.

So basically I have to zoom out away from my machine and make sure the window is in a corner of the screen in order to change anything. It's not a huge deal...just annoying when you're doing a lot of changes.

Also an 'invert' option on the block parameters would be good - quicker than remapping 1 to -1 and vice versa, but I don't want to invert the axis itself or I'll end up with a huge list of axes (inverted and non-inverted), and have to change two instead of one if I want to change e.g. sensitivity...there are times when I want to invert the mapping from an axis to a block, but not invert the axis and not flip the direction of the block itself.
 

Lench

Active Member
#58
Something else about this mod that is becoming an annoyance for me: if I click in a TextBox to change a value, if there is a block under the cursor and behind the TextBox, that block gets selected and the parameter window changes to show parameters for that block.

So basically I have to zoom out away from my machine and make sure the window is in a corner of the screen in order to change anything. It's not a huge deal...just annoying when you're doing a lot of changes.

Also an 'invert' option on the block parameters would be good - quicker than remapping 1 to -1 and vice versa, but I don't want to invert the axis itself or I'll end up with a huge list of axes (inverted and non-inverted), and have to change two instead of one if I want to change e.g. sensitivity...there are times when I want to invert the mapping from an axis to a block, but not invert the axis and not flip the direction of the block itself.
Invert option on block controls sounds like a good idea. You can expect it in the next update.

As for the window click-through issue; every mod interface currently has the same problem. I plan to eventually port the interface to the native game UI, but that will be a ton of work. Maybe I can put some colliders behind the window to "catch" the clicks, but I can't promise anything.
 
Top