ACM - Advanced Controls Mod [Besiege v0.45]

#61
Just want to clarify something:

If I follow this procedure:
1. Create a new machine
2. Create a new axis
3. Use that axis in the machine
4. Save that machine
5. Destroy that machine and create a new one
6. Use the axis I created in step 2
7. MODIFY that axis slightly
8. Load the machine saved in step 4

...Will the axis have the values from step 2 or step 7?
 

Lench

Active Member
#62
Just want to clarify something:

If I follow this procedure:
1. Create a new machine
2. Create a new axis
3. Use that axis in the machine
4. Save that machine
5. Destroy that machine and create a new one
6. Use the axis I created in step 2
7. MODIFY that axis slightly
8. Load the machine saved in step 4

...Will the axis have the values from step 2 or step 7?
The values will be from step 2, but both axes will actually be present.

At step four, the axis gets saved to the machine.
Loading a machine loads all axes with it. If there is an identical axis already present, it just forwards the controls to that axis instead.

If you modified it (in step 7), it will get loaded into a separate container for machine embedded axes. The machine will use that instead of the locally saved one.
However, the axis that you modified later will still be present as locally saved axis, but won't be used.
 

Lench

Active Member
#63
Update v1.4.7:
Super Loader Update
  • Added invert interval button in control mapper.
  • Update for compatibility with block mods loaded by the new integrated block loader.
  • Fixed crash caused by attempting to download custom axis assets after Scripter Mod has just downloaded it's own assets.
  • Fixed steering hinge and steering block lock-up bug.
Important note: Update checker seems to be broken. If your game is crashing on startup, edit the Mods/Config/AdvancedControlsMod.json to disable the update checker.
Code:
  {
    "key": "mod-updater-enabled",
    "value": {
      "type": "bool",
      "value": "True"  <= set this to "False"
    }
Also note that the command 'acm modupdate check' may crash your game.
 
#64
Minor bug report (haven't updated to 1.4.7 yet though): if one of the axis values is set to -0 (note the '-' sign), that value doesn't copy & paste to other blocks.
 
#65
Also the new version seems to a) have wiped all my locally saved axes, and b) Saving a Python axis appears to STOP the code running (so you can see it working when in the Python window, but when you save/exit the window, it stops working).

Or am I doing something wrong?

The Python code worked in the last version of ACM.
 

Lench

Active Member
#66
Also the new version seems to a) have wiped all my locally saved axes, and b) Saving a Python axis appears to STOP the code running (so you can see it working when in the Python window, but when you save/exit the window, it stops working).

Or am I doing something wrong?

The Python code worked in the last version of ACM.
Nothing changed in regards to saving and loading, or in regards to Python custom axis with v1.4.7 (see commit history). Saving an axis creates a duplicate and overwrites the existing entry to break references. If you are modifying an axis and not creating a new one, you don't have to press save.

You can check Mods/Debug/ACM_Log.txt to see if the reason for disappeared axes is the saving process. If not, the error must have been logged to the console at startup. Unfortunately, these logs only last one game session.
 

Yut23

New Member
#68
I'm getting segfaults under Linux when running the 64-bit version of Besiege (both Steam and Humble Bundle versions). I added some debug logging and recompiled the mod, and tracked down the segfault to line 195 of AdvancedControlsMod/Input/Controller.cs (github link), which is probably the first time SDL2 is trying to do something. I can send you my Player.log file if you want, but it doesn't have much more information. It works fine with the 32-bit version of Besiege, which I've been using for now.

I also had some issues with path separators, but that's a simple fix. I'll submit a pull request on GitHub for that once I confirm it doesn't break anything on Windows.
 

Lench

Active Member
#69
I'm getting segfaults under Linux when running the 64-bit version of Besiege (both Steam and Humble Bundle versions). I added some debug logging and recompiled the mod, and tracked down the segfault to line 195 of AdvancedControlsMod/Input/Controller.cs (github link), which is probably the first time SDL2 is trying to do something. I can send you my Player.log file if you want, but it doesn't have much more information. It works fine with the 32-bit version of Besiege, which I've been using for now.

I also had some issues with path separators, but that's a simple fix. I'll submit a pull request on GitHub for that once I confirm it doesn't break anything on Windows.
Thanks for the pull request. I'm so happy that someone is actually willing to contribute.

The SDL2 is already initialized by Input.DeviceManager.InitSDL() at the point it reaches the line you mentioned, which is only dealing with remapping axis indexes to fit the configuration in GameControllerMappings.txt. My guess is that the mappings are wrong for your device, which I suppose could cause the access violation. Why this only happens on the 64-bit version is beyond me.

I'd ask you to try out a few things and see if it fixes the issue:
  1. Enter `acm dbupdate disable` in console to disable the mod's automatic GameControllerMappings.txt updating.
  2. Delete GameControllerMappings.txt in Mods/Resources/AdvancedControls and see if the issue is resolved.
  3. Replace the contents of the file with this.
 

Yut23

New Member
#70
Nope, no change. FYI, I'm using a Logitech F710 Wireless gamepad in XInput mode.

I found an interesting line at the top of my Player.log:
Code:
* Assertion: should not be reached at mini-amd64.c:543
I took a look at the relevant file in the Mono source, and it looks like it's in the function "merge_argument_class_from_type", if that means anything to you.
 
Last edited:

Lench

Active Member
#71
Update v1.4.8: Bugfixes
  • Fixed axis and button resolving when loading foreign machine.
  • Fixed custom axis error when stopping simulation.
  • Fixed debug messages when downloading libraries.
  • Fixed downloading libraries on Linux.
  • Fixed update checker.
GitHub release

Note:
If you disabled ACM update checker in version v1.4.7, you can now re-enable it using the following command.
Code:
acm modupdate enable
 

cam

New Member
#72
The mod doesn't seem to be recognizing inputs from my Xbox One controller. It recognizes inputs from the mouse fine, but when I try to create a new controller axis, the yellow line doesn't move no matter what buttons/sticks/triggers I press. When I tried unplugging and replugging the controller, it says "ArgumentException: An element with the same key already exists in the dictionary." in the console.
 
Last edited:

Lench

Active Member
#73
The mod doesn't seem to be recognizing inputs from my Xbox One controller. It recognizes inputs from the mouse fine, but when I try to create a new controller axis, the yellow line doesn't move no matter what buttons/sticks/triggers I press. When I tried unplugging and replugging the controller, it says "ArgumentException: An element with the same key already exists in the dictionary." in the console.
Can I ask you for the complete error log when this happens? This can be found in Besiege_Data\Mods\Debug\ConsoleOutput.txt, or you can just copy the entire text from the console. It will help me pinpoint the problem.
 

cam

New Member
#74
Can I ask you for the complete error log when this happens? This can be found in Besiege_Data\Mods\Debug\ConsoleOutput.txt, or you can just copy the entire text from the console. It will help me pinpoint the problem.
ArgumentException: An element with the same key already exists in the dictionary.
System.Collections.Generic.Dictionary`2[System.Guid,Lench.AdvancedControls.Input.Controller].Add (Guid key, Lench.AdvancedControls.Input.Controller value)
Lench.AdvancedControls.Input.Controller.AddDevice (Int32 index)
Lench.AdvancedControls.Input.DeviceManager.Update ()
DontDestroyOnLoad only work for root GameObjects or components on root GameObjects.
[ACM]: Game controller connected: XInput Controller
Guid: 706e6978-7475-0001-0000-000000000000
ArgumentException: An element with the same key already exists in the dictionary.
System.Collections.Generic.Dictionary`2[System.Guid,Lench.AdvancedControls.Input.Controller].Add (Guid key, Lench.AdvancedControls.Input.Controller value)
Lench.AdvancedControls.Input.Controller.AddDevice (Int32 index)
Lench.AdvancedControls.Input.DeviceManager.Update ()
[ACM]: Game controller connected: XInput Controller
Guid: 706e6978-7475-0001-0000-000000000000
ArgumentException: An element with the same key already exists in the dictionary.
System.Collections.Generic.Dictionary`2[System.Guid,Lench.AdvancedControls.Input.Controller].Add (Guid key, Lench.AdvancedControls.Input.Controller value)
Lench.AdvancedControls.Input.Controller.AddDevice (Int32 index)
Lench.AdvancedControls.Input.DeviceManager.Update ()
 

Lench

Active Member
#75
@cam Alright, I've made you a test version with some changes. I can't recreate the bug myself, but I've changed some stuff that might be causing it.

Please try it out and tell me if it works. If you notice any other bugs let me know.
 

Attachments

cam

New Member
#76
@cam Alright, I've made you a test version with some changes. I can't recreate the bug myself, but I've changed some stuff that might be causing it.

Please try it out and tell me if it works. If you notice any other bugs let me know.
:/ Nope, still nothin. Here's a screenshot of the console in case that helps. Also in this picture I was pressing the left trigger all the way, but the yellow line still doesn't move.
upload_2016-11-21_17-35-38.png
 

Lench

Active Member
#77
This may be a longshot, but you can try typing this in console
Code:
acm dbupdate disable
then exiting Besiege and deleting "Besiege_Data\Mods\Resources\AdvancedControls\GameControllerMappings.txt".

This would cause your controller to be recognized as a joystick. If that's not it, I'm gonna need to gather some testers again to figure out what's happening.
 
#79
how o i set the rotation angle/limit of the steering block? The one that has two miny gears on the sides and looks like a wooden block but it's black. thanks!
 

Lench

Active Member
#80
how o i set the rotation angle/limit of the steering block? The one that has two mini gears on the sides and looks like a wooden block but it's black. thanks!
You will have to use the Angle control with an ACM input axis. To create the same behavior as the vanilla steering hinge, you can create a Key axis with gravity and momentum sliders at zero, like in this example:
 
Top