Besiege

Besiege

51 ratings
Lua Scripting Mod
3
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
1.099 MB
4 Feb, 2021 @ 12:09am
27 Jul, 2021 @ 4:59am
41 Change Notes ( view )

Subscribe to download
Lua Scripting Mod

Description

What is this mod?
This mod allows you to create really cool machines using in-game Lua scripting with multiplayer and other mod support.

Join Besiege official discord server, there are so few members who plays with Lua mod. I`ll be waiting for you.

Main features at this stage of development
  • Almost full multiplayer support.
  • Key emulation.
  • Changing slider values in simulation.
  • Setting steering angle.
  • Module system for using same scripts for different machine parts.
  • Handling and writing chat messages.
  • Getting information about level entities (soldiers etc.).
  • Getting info of specified block of specified player such as position, velocity, rotation and so on.
  • Getting info of machine of specified player.
  • Creating GUIs based on Unity3D GUIs.
  • Raycasting, sphere overlapping and more.
  • Handling input from mouse, keyboard, joysticks.
  • Other usefuls things like screen info, FPS cursor mode and so on.
  • Documentation[github.com] provided.
  • Scripting examples provided.
  • In-game scripting, no need to compile, rejoin or restart.

How to start?

  1. Press Ctrl+L in building mode.
  2. See documentation.
  3. Download some examples.
  4. Press "Open LuaRoot folder".
  5. Open "main.lua" with some nice code editor.
  6. Examine it.
  7. Create!

Examples
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2558577515
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2396766820
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2393945683
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2383786648
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2383799572
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2383802295
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2383834423

Warning
Mod still in development and can contains a lot of bugs, but i will try to fix them as soon as they appear.
119 Comments
ilyshk4  [author] 2 Jun @ 7:47am 
It depends on how game develoeprs implemented the block, sometimes they precalculate values and save them so changing the source variables like rocket power doesnt affect the rocket
Neanod 31 May @ 6:41pm 
Very good mod for programmers and war crimes lovers. For some reason, after ignition you cant edit rocket power, but everything else is ok.
Antarctic_Singularity 9 Nov, 2024 @ 11:27am 
truposjigatel Certain values you can't change while the simulation is running, not sure if the ones you mentioned are unchangable but that might be why it's not working.
truposjigatel 9 Nov, 2024 @ 7:49am 
У клиента не работает set_slider('speed',..) для колес и вращающихся блоков. При этом у сервера все ок - тот же скрипт, та же техника - колеса крутятся без проблем. Было раньше такое или это после обновы бесиджа? Что можно поделать? Ошибок никаких не выдает.
孩子们我回来了 4 Jun, 2024 @ 4:18am 
support message simulate please. and new DLC blocks
ilyshk4  [author] 21 Jan, 2024 @ 12:53am 
Some blocks do not support changing its speed during simulation.
To detect presses on xbox controller you have to use input.get_key_down("JoystickButton0"). Joystick buttons are kind-of randomly mapped, so you have to google "unity xbox one controller mapping"
Antarctic_Singularity 2 Dec, 2023 @ 7:38pm 
Or how to detect button presses on xbox controller?
Antarctic_Singularity 2 Dec, 2023 @ 3:20pm 
Hi do flying blocks work with set speed slider? I tried yaw.set_slider("speed", 3) and using local yaw = machine.get_refs_control("yaw") but it is not working. Are they broken or am I doing it wrong : P
ilyshk4  [author] 15 Jun, 2023 @ 6:09am 
no problem
Isaac Hipkiss 14 Jun, 2023 @ 9:09pm 
I figured it out, i just had name sorting issues, sorry for the hassle.