围攻
53 个评价
Lua Scripting Mod
3
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
1.099 MB
2021 年 2 月 4 日 上午 12:09
2021 年 7 月 27 日 上午 4:59
41 项改动说明 ( 查看 )

订阅以下载
Lua Scripting Mod

描述

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://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2558577515
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2396766820
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2393945683
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2383786648
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2383799572
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2383802295
https://psteamcommunity.yuanyoumao.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.
121 条留言
ilyshk4  [作者] 7 月 26 日 上午 10:53 
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 7 月 26 日 上午 5:00 
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  [作者] 6 月 2 日 上午 7:47 
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 5 月 31 日 下午 6:41 
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 2024 年 11 月 9 日 上午 11:27 
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 2024 年 11 月 9 日 上午 7:49 
У клиента не работает set_slider('speed',..) для колес и вращающихся блоков. При этом у сервера все ок - тот же скрипт, та же техника - колеса крутятся без проблем. Было раньше такое или это после обновы бесиджа? Что можно поделать? Ошибок никаких не выдает.
孩子们我回来了 2024 年 6 月 4 日 上午 4:18 
support message simulate please. and new DLC blocks
ilyshk4  [作者] 2024 年 1 月 21 日 上午 12:53 
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 2023 年 12 月 2 日 下午 7:38 
Or how to detect button presses on xbox controller?
Antarctic_Singularity 2023 年 12 月 2 日 下午 3:20 
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