Besiege

Besiege

Lua Scripting Mod
121 Comments
ilyshk4  [author] Jul 26 @ 10:53am 
I feel like its not related to the mod itself, but how the Unity game engine handles gamepad/joystick input. You can try and google for the correct axes names.
Neanod Jul 26 @ 5:00am 
I encountered a problem when connecting a gamepad: the script via input.get_key() sees pressing some digital buttons (for example, Joystick8Button9), but input.get_axis_raw() does not read the main axes of the sticks and triggers. I tried all possible options (JoystickAxis1-28, Joystick1Axis1, etc.), but they are not registered.

Please tell me if there is a known limitation of the mod, or am I doing something wrong?
ilyshk4  [author] Jun 2 @ 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 May 31 @ 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 Nov 9, 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 Nov 9, 2024 @ 7:49am 
У клиента не работает set_slider('speed',..) для колес и вращающихся блоков. При этом у сервера все ок - тот же скрипт, та же техника - колеса крутятся без проблем. Было раньше такое или это после обновы бесиджа? Что можно поделать? Ошибок никаких не выдает.
孩子们我回来了 Jun 4, 2024 @ 4:18am 
support message simulate please. and new DLC blocks
ilyshk4  [author] Jan 21, 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 Dec 2, 2023 @ 7:38pm 
Or how to detect button presses on xbox controller?
Antarctic_Singularity Dec 2, 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] Jun 15, 2023 @ 6:09am 
no problem
Isaac Hipkiss Jun 14, 2023 @ 9:09pm 
I figured it out, i just had name sorting issues, sorry for the hassle.
ilyshk4  [author] Jun 14, 2023 @ 1:01am 
You can only copy script itself. Im not sure if you are talking about script or module system.
Isaac Hipkiss Jun 13, 2023 @ 6:27pm 
How do i carry over a module from one creation to another???
ilyshk4  [author] Feb 4, 2023 @ 10:09am 
you should see errors in logging window, see documentation
uszaru Feb 3, 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] Feb 2, 2023 @ 7:42am 
You can't but vscode will autocomplete on existing stuff
uszaru Feb 2, 2023 @ 2:07am 
i am very new to lua, how can i setup autocomplete in vscode?
ilyshk4  [author] Nov 20, 2022 @ 4:33am 
Wow thats so cool
Jao R Nov 19, 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] Sep 14, 2022 @ 9:36am 
thats a long story, you better read Lua documentation and this mod documentation
yotesnacks Sep 14, 2022 @ 8:45am 
so, i got the main.lua folder open, where would i put that input in?
yotesnacks Sep 14, 2022 @ 8:39am 
whoops, I meant the x and y axis
thanks though!
ilyshk4  [author] Sep 14, 2022 @ 8:27am 
you can use input.get_axis("Horizontal") to get delta movement
also z axis of your mouse? :)
yotesnacks Sep 14, 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] Jul 26, 2022 @ 4:44am 
Yes. Why not?
Render Jul 26, 2022 @ 4:42am 
Does this mod still work?
ilyshk4  [author] Jul 25, 2022 @ 2:26am 
Единственный способ это установить клавишу на пушке и в коде создать эмулятор клавиши:
local cannons = machine.new_key_emulator('c')
и потом выстрелить:
cannons.click()
Больше информации на вики (ссылка в описании мода, не копирую потому что стим может скрыть комментарий с ссылками).
truposjigatel Jul 24, 2022 @ 11:25pm 
Привет. Вопрос: как активировать блок через скрипт, если в игре он активируется не по нажатию клавиши, а по коду. Например для пушки: СТРЕЛЯТЬ: 'bot8_turCan_fire'. Спасибо!
ilyshk4  [author] Jul 24, 2022 @ 4:30am 
your_var += input.mouse_scroll_delta().y
Hellcat Jul 23, 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] Apr 14, 2022 @ 11:53pm 
Hm. Yeah thats hard
Hellcat Apr 14, 2022 @ 11:26am 
Explodes the tank
ilyshk4  [author] Apr 13, 2022 @ 10:36am 
What key?
Hellcat Apr 13, 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] Apr 13, 2022 @ 12:49am 
Joints are present only on server. What are you trying to do? Maybe there is a way to find alternative.
Hellcat Apr 12, 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] Apr 12, 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] Apr 12, 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 Apr 11, 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] Apr 10, 2022 @ 7:27am 
no way currently
Hellcat Apr 9, 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] Mar 13, 2022 @ 6:02am 
Ill try but I have certain issues so i am unable to fix these bugs now.
XiaNight Mar 11, 2022 @ 10:31am 
some bugs here:
1. print doesn't work in play()
2. entities.count() is always 0
please fix :(
ilyshk4  [author] Feb 23, 2022 @ 10:43pm 
uh you can check it by physics raycast
Jao R Feb 23, 2022 @ 8:05am 
Do you intend to add detector to see if a grabber is helding something or not?
ilyshk4  [author] Jan 30, 2022 @ 12:43am 
i think no...
[Lieutenant] Dan Jan 29, 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] Nov 20, 2021 @ 3:18am 
i'll try to make them soon
ilyshk4  [author] Nov 20, 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