Lench Scripter Mod [Besiege v0.42]

#68
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
 

Lench

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

https://docs.python.org/2/library/math.html

Code:
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
 
#72
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?
 

Lench

Active Member
#73
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).
 
#74
Thanks, got it working now. Camera control would be amazing though. Also noticed that controller buttons can be mapped in the game itself.
 

Lench

Active Member
#75
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.
 
#80
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?
 
Top