Lench Scripter Mod [Besiege v0.42]

hey Lench , um sorry but i have a question, would you have a script by any chance that can do an auto balance type of thing, because without the gyro mod, i am having trouble keeping my hover craft up when disturbed too much, also if you want to try it then you can


Active Member
Hello. You can stll use the UnityEngine Mathf class like before. However, some functions (like Mathf.Clamp) have problems with overloads when being called from python, so I recommend using the built-in module.


import math          # import math module at the start of the script

math.sqrt(x)          # square root
math.pow(x, y)     # x raised to power y
Mathf.DeltaAngle(a, b)      # same as before
I was adventuring in the wild world of Unity documentation and wondered whether it is possible to use such functions as GetAxis and GetButton to control variables with my controller. If so, how would one go on with such task? Or is that other mod of yours better suited for this purpose?


Active Member
You can use Input.GetAxis('Vertical') and Input.GetAxis('Horizontal') to get two default axes defined by the Besiege input manager. These axes also use arrow keys. I actually do this with some of my machines.

Other axes are inaccessible through Unity as they are not defined by the game's input manager, but you might be able to do it with Python.
For joystick buttons you can just use Input.GetKey(KeyCode.JoystickButton0).
Thanks, got it working now. Camera control would be amazing though. Also noticed that controller buttons can be mapped in the game itself.


Active Member
Thanks for the report! I have managed to find and fix the bug. I have some other features in development though, so the patch will be included in the next release, hopefully soon.
Hi, THank your for your mod!!
I have a problem when I follow your guide " Getting started " . At the step with the variable v=1, the console said "MissingFieldException: Field '.AddPiece.isSimulating' not found".
What can I do?