This mod enables you to control your Besiege machine with Python 2.7/3.0 scripts.
Changing sliders or toggles and triggering actions allows you to create controllers, stabilizers, autopilots or anything you can dream up to guide your machines.
NOTE: This mod requires some basic programming knowledge.
Place your scripts in .../Besiege_Data/Scripts/ directory with .py extension with the same name as machine.
my-machine.bsg -> my-machine.py
They will be ran automatically when simulation starts.
Read the wiki for more information on running scripts.
This script simply controls the speed of an automatic wheel.
When U is held down, the wheel spins with speed 1.
If you press I, spinning direction is inverted.
# get block reference
wheel = Besiege.GetBlock("WHEEL 1")
direction = 1
# set wheel toggle mode
""" updates the speed on every frame """
# direction variable is defined globally
# if U is held down, speed is 1
speed = 1 # set speed to 1 if U is pressed down
speed = 0
# invert direction if I is pressed
direction *= -1
# set wheel speed slider
wheel.SetSliderValue("SPEED", speed * direction)
For more examples, read the tutorials.
Read getting started guides here.
Read full documentation here.
Read about mod integration here.
Requires Spaar's Mod Loader
Source code available on GitHub.
Feedback, suggestions and contributions are very welcome.
See the examples on the workshop.
Join the community Discord chat for help!