Besiege

Besiege

Lua Scripting Mod
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.
ilyshk4  [author] 14 Jun, 2023 @ 1:01am 
You can only copy script itself. Im not sure if you are talking about script or module system.
Isaac Hipkiss 13 Jun, 2023 @ 6:27pm 
How do i carry over a module from one creation to another???
ilyshk4  [author] 4 Feb, 2023 @ 10:09am 
you should see errors in logging window, see documentation
uszaru 3 Feb, 2023 @ 12:32pm 
hi, im getting this error a lot, sometimes i make mistakes and instead of getting a error, the lua program simply wont run
so its hard to debug when it wont show what i did wrong
ilyshk4  [author] 2 Feb, 2023 @ 7:42am 
You can't but vscode will autocomplete on existing stuff
uszaru 2 Feb, 2023 @ 2:07am 
i am very new to lua, how can i setup autocomplete in vscode?
ilyshk4  [author] 20 Nov, 2022 @ 4:33am 
Wow thats so cool
Jao R 19 Nov, 2022 @ 5:20pm 
I might get a job in real life, because a robot i build using math that i tested in the game using your mod.
So thanks.:steamthumbsup:
ilyshk4  [author] 14 Sep, 2022 @ 9:36am 
thats a long story, you better read Lua documentation and this mod documentation
yotesnacks 14 Sep, 2022 @ 8:45am 
so, i got the main.lua folder open, where would i put that input in?
yotesnacks 14 Sep, 2022 @ 8:39am 
whoops, I meant the x and y axis
thanks though!
ilyshk4  [author] 14 Sep, 2022 @ 8:27am 
you can use input.get_axis("Horizontal") to get delta movement
also z axis of your mouse? :)
yotesnacks 14 Sep, 2022 @ 7:47am 
so, how would I get it so I have control of a wheel and a steering block by using the x, y, z axis of my mouse?
ilyshk4  [author] 26 Jul, 2022 @ 4:44am 
Yes. Why not?
Render 26 Jul, 2022 @ 4:42am 
Does this mod still work?
ilyshk4  [author] 25 Jul, 2022 @ 2:26am 
Единственный способ это установить клавишу на пушке и в коде создать эмулятор клавиши:
local cannons = machine.new_key_emulator('c')
и потом выстрелить:
cannons.click()
Больше информации на вики (ссылка в описании мода, не копирую потому что стим может скрыть комментарий с ссылками).
truposjigatel 24 Jul, 2022 @ 11:25pm 
Привет. Вопрос: как активировать блок через скрипт, если в игре он активируется не по нажатию клавиши, а по коду. Например для пушки: СТРЕЛЯТЬ: 'bot8_turCan_fire'. Спасибо!
ilyshk4  [author] 24 Jul, 2022 @ 4:30am 
your_var += input.mouse_scroll_delta().y
Hellcat 23 Jul, 2022 @ 1:05pm 
hello, i would like to ask if there is any way to get the input of the mouse wheel? i want to make a variable that increases each time i scroll the mouse wheel up, and decrease when i scroll the mouse wheel down.
ilyshk4  [author] 14 Apr, 2022 @ 11:53pm 
Hm. Yeah thats hard
Hellcat 14 Apr, 2022 @ 11:26am 
Explodes the tank
ilyshk4  [author] 13 Apr, 2022 @ 10:36am 
What key?
Hellcat 13 Apr, 2022 @ 10:06am 
If a wooden block has blown off from the machine, it triggers a key. Like if when the block is destroyed and falls off from the vehicle.
ilyshk4  [author] 13 Apr, 2022 @ 12:49am 
Joints are present only on server. What are you trying to do? Maybe there is a way to find alternative.
Hellcat 12 Apr, 2022 @ 8:05am 
Oh alright.Then uh, is there any way to check if an object's joint is holding on or its detached? (Not that much of a problem because i managed to do it with raycast, its just complicated) Still very great mod and the most useful to have :) .
ilyshk4  [author] 12 Apr, 2022 @ 7:40am 
Block's .health() should work, really not sure how to fix this. Also player's health value is set only on server... I really don't want to dig into game code base to figure out how and why it is like that. The .destroyed() is actually returned if block game object is gone, not detached. In general game's health system is a big mystery since blocks don't have health but joints.
ilyshk4  [author] 12 Apr, 2022 @ 7:11am 
sadly all these properties are just hooks for game variables. i cant fix them. ill try to add health bars value
Hellcat 11 Apr, 2022 @ 8:11am 
Could you add a function to check the player's health bar's value? Also the .heath() value only changes if the block is on fire, and do not change when it is blown off the machine.
.destroyed() always return false even if object burnt, or thorn off the machine.
ilyshk4  [author] 10 Apr, 2022 @ 7:27am 
no way currently
Hellcat 9 Apr, 2022 @ 2:29pm 
I have a question, is there any way to get the machine's health value? or if it is zero or not?
ilyshk4  [author] 13 Mar, 2022 @ 6:02am 
Ill try but I have certain issues so i am unable to fix these bugs now.
XiaNight 11 Mar, 2022 @ 10:31am 
some bugs here:
1. print doesn't work in play()
2. entities.count() is always 0
please fix :(
ilyshk4  [author] 23 Feb, 2022 @ 10:43pm 
uh you can check it by physics raycast
Jao R 23 Feb, 2022 @ 8:05am 
Do you intend to add detector to see if a grabber is helding something or not?
ilyshk4  [author] 30 Jan, 2022 @ 12:43am 
i think no...
[Lieutenant] Dan 29 Jan, 2022 @ 9:22pm 
Is there any way to use the reference controller on settings that aren't sliders? For example, toggling 'auto grab' on a grabber block.
ilyshk4  [author] 20 Nov, 2021 @ 3:18am 
i'll try to make them soon
ilyshk4  [author] 20 Nov, 2021 @ 3:17am 
i think set_steering isnt working work due game optimizations, i can try to fix this but im not sure if it is necessary

parameters for modules is a great idea, not just name but multiple parameters
azotic 19 Nov, 2021 @ 5:40pm 
set_steering is unreliable if no button associated with that steering is pressed.

Also, it would be nice if lua modules could get the string for its name.
ilyshk4  [author] 7 Nov, 2021 @ 7:01am 
string.format and maybe other functions seems not to be implemented, sorry