Giter Club home page Giter Club logo

multiplayer-crew-manager's Introduction

Steam workshop: https://steamcommunity.com/sharedfiles/filedetails/?id=2775613786

Description

Got only a few friends that you want to play Barotrauma with, but the Bots make game less tolerable? Well worry no more! Kinda ...

Multiplayer crew manager is a modification that makes Multiplayer Campaign play something more similar to the Singleplayer one, in terms that:

  • Directly controllable bot crew-mates (all crew members are AI controlled bots, that can be possessed by client player)
  • Crew information panel now also used to switch between crew characters by clicking on them (Full installation needed, see Client-side lua installation)
  • Server CHAT commands that allows more in-depth control of campaign (especially for server admins), just type in chat mcm or mcm help
  • Can user mcm release to spectate, or for admins mcm release <client_id> to free characters from AFK players
  • Enable secure mode if you playing with unfamiliar players to prevent them to gain control between the characters and ruin the game

To keep in mind

  • To run this mod, as every other LuaCs mod, you must select LuaForBarotrauma server executable in 'Host Server' menu.
  • ALWAYS keep your campaign files backed up
  • Be careful with new respawning mechanic, when doing a level transition
  • Campaign most probably cannot be converted back, without manual editing (xml file), or in-game shenanigans
  • Every bot, new hire and player is saved into _CharacterData.xml
  • Respawns are turned off by default, to turn them on use: mcm respawn set true
  • Respawn delay and time refers to timeout on first person dead and time to arrive to main sub on respawn shuttle.
  • Secure mode is disabled by default. Use mcm secure and mcm secure true/false to check and toggle it.

Client-side lua installation

  • Install Lua For Barotrauma mod
  • In the settings mod menu enable LuaForBarotrauma.
  • In multiplayer select 'Host Server', select LuaForBarotrauma executable.
  • While in the hosting menu open the console window (most commonly F3)
  • Type in or copy, then execute the console command: install_cl_lua
  • Restart the game

Checkout my other mods

My Barotrauma workshop

Want to message me more directly? Message me on my discord


Steam 创意工坊:https://steamcommunity.com/sharedfiles/filedetails/?id=2775613786

介绍

也许你只有很少的朋友愿意和你一起玩这个游戏,但人工智障控制的船员让你难以忍受?那么这个模组可以满足你的要求。

这个模组以类似单人模式的方式控制你多人战役模式的船员:

  • 人工智障会接管所有不被玩家控制的船员。
  • 你不需要再担心你的朋友掉线或者是你控制其他角色时,原本的角色灵魂出窍而死。以及没有在存档前回到自己的角色导致角色消失。
  • 可以通过直接点击船员面板中的船员来切换控制的角色。(需要完整安装,请见 客户端 Lua 安装
  • 添加更深入的控制战役的指令(一部分需要服务器管理员权限)。只需要在 聊天框 输入 mcm 或者是 mcm help 指令。

指令

  • mcm [函数] [参数]

    • mcm 函数语法
    • ID 参数 分为 mcm list 查询的角色 IDmcm clientlist 指令查询的玩家 ID。两者均为查询时显示在第一列的数字
    • [方括号] 内的内容为可选项
    • <尖括号> 内的内容为必选项
  • mcm [help] — 显示 mcm 函数帮助。(help是可选的)

  • mcm list — 列出所有可控制角色及其 ID 信息。

  • mcm control <角色ID> — 控制你输入的 ID 所属的角色。

  • mcm release [角色ID] — 释放你当前控制的角色,或者是输入一个 ID 释放其所属的角色。(后者需要管理员权限才能使用)

管理员指令

  • mcm delete <角色ID> — 删除你输入的 ID 所属的角色。(包括其身上所有物品)

  • mcm clientlist — 列出所有玩家及其 ID 信息。

  • mcm spawn <玩家ID> — 以你输入的 ID 所属玩家的预设生成一个角色。

  • mcm client autospawn <true/false> — 打开或关闭为新连接的玩家生成一个其预设角色的功能

  • mcm respawn — 列出重生设置

  • mcm respawn set <true/false> — 打开或关闭重生功能

  • mcm respawn penalty <true/false> — 打开或关闭重生惩罚

  • mcm respawn delay <整数/秒> — 重生前的等待时间

  • mcm respawn time <整数/秒> — 提供给复活飞船与潜艇对接的时间

  • mcm secure — 显示当前安全模式状态

  • mcm secure <true/false> — 安全模式只允许管理员/版主获得开/关控制权

  • mcm reserve - 显示储备中的字符

  • mcm reserve put <ID> - 使用提供的ID将角色保留

  • mcm reserve get <ID> - 使用提供的ID从储备中获取字符

注意事项

  • 要启用这个模组,首先你要在游戏设置中启用。然后在创建服务器服务器可执行文件选择 Lua For Barotrauma - DedicatedServer
  • 永远注意备份你的战役存档。
  • 如果你想要从一个进行中的战役存档中卸载这个模组,那么你需要手动修改存档的 .xml 文件,并且还可能需要修改一些其他的东西,我不能确定,后果自负。
  • 每个 AI 控制的船员与玩家的角色都会被保存在 _CharacterData.xml当中。
  • 默认情况下,重生功能是被关闭的。如果要打开,请使用:mcm respawn set true

客户端 Lua 安装

  • 订阅并启用 Lua For Barotrauma 模组。
  • 在多人游戏中选择“创建服务器”,服务器可执行文件选择“Lua For Barotrauma - DedicatedServer”。
  • 在服务器大厅,打开控制台(默认按键为 F3)。
  • 输入或复制这条指令并执行:install_cl_lua
  • 重启游戏。

查看我的其他模组

我的潜渊症创意工坊

想更直接的跟我交流吗?请在我的 Discord 留言

multiplayer-crew-manager's People

Contributors

akronyhm avatar antoinedijoux avatar nickolasfleim avatar oiltanker avatar xardion495 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

multiplayer-crew-manager's Issues

[2 Issues] New Players joined with Code 0, Restarting the server causes to Players spawn on Wrong Character.

First issue :
Well we were playing with a friend, our other friends decided to join. They joined but they didnt spawned... We wrote the autospawn etc... Well It didnt worked... We tried manual one but our friends had code 0. Both of em.THEY JOINED MIDGAME
Well we didnt able to spawn them... Also I had weird thing... When I spawned my character got perma-ragdolled. Not a keyboard issue. My character just stood there. I took control of the ai but my character still stood there in ragdoll. At some point he died?
Second But Minor issue :
We decided to recreate the same GAME. But I spawned on a wrong person?

Thats all! Other functions like controlling AI etc works very well.

Null reference exception OnPirateMissionInitPirates

Using dynamic europa, took the raving pirate vessel mission and saw this exception at the top of the server log:

[11/09/2023 03:36:29]
Starting a new round...
[11/09/2023 03:36:38]
[LuaCs] [MCM-SERVER] Loading multiplayer campaign
[11/09/2023 03:37:05]
[LuaCs] [SV LUA ERROR] System.NullReferenceException: Object reference not set to an instance of an object.
at MultiplayerCrewManager.McmSession.<>c__DisplayClass22_0.b__0(Int32 minAmount, Int32 maxAmount, Single levelDifficulty, Random rand)
at MultiplayerCrewManager.McmSession.OnPirateMissionInitPirates(PirateMission self)
at MultiplayerCrewManager.McmMod.b__39_1(Object instance, ParameterTable ptable)
at Patch_mcm_piratemission_initpirates_02d3302055484158acdfea6c1ed14d1d_Barotrauma_PirateMission-Void_InitPirates__.HarmonyPrefix(MethodBase __originalMethod, Object __instance)

Inventory doesn't get updated when the round ends

When ending a round (finishing mission or leaving a base), inventory of character currently controlled by player gets reset to start of last round. Only happens to controlled character.

Can be temporarily be fixed for current round by closing without saving and restarting.

Null Reference Exception in RestoreWallets

McmSave.cs 194
if (charData.WalletData != null) {
var character = Character.CharacterList.FirstOrDefault(c => charData.CharacterInfo.GetIdentifier() == c.Info.GetIdentifier());

Above code needs to be guarded against a nullreference if Character does not return a valid List

Mod not working in version 1.1.18.1

Mod broke with the new game patch

I already have it fixed; but i havn't commited the changes yet - im looking into solving some issues that i havn't had the energy to deal with properly yet.

I will commit to my own fork; do some testing and when im happy with the results i´ll do a pull request

Wrong Respawn

If respawn is turned on, then characters killed by the delete or reserve commands will also be respawn

Infinite loading at the final (2nd final?) stage

My friend and I have been playing an MCM campaign, and we've been trying to load into the last stage (or maybe 2nd last). It's the stage before the reaaally long straight path. When we first tried transitioning to that stage, the game got stuck in an infinite loading screen and we eventually returned to the lobby. Now, whenever I try to load the campaign, it gets stuck in an infinite loading screen. I gave the save files to my friend so he could host it instead, but that didn't change anything.

I unfortunately don't have any logs to provide, because the game doesn't seem to generate any logs from this.

Mod fails to compile after recent game update (v1.5.7.0)

After the last update the mod no longer compiles.

I was itching to play so I took it upon myself to restore it to working order in my own fork and local copy (I know... I know - I said I wasn't gonna continue maintaining it)

There were some pretty major changes made to various parts of the base game which meant that in order to restore functionality I had to rip out some pretty major parts of the mod code base. I've added a link(s) to my Fork (and commits) If anyone wants to see what i did to make it work

  1. a2df6a0 - had to change access to AllowRespawn to use a new variant similar to how base-game checks for that setting
  2. 4fe4bd6 - Fixed issues with loading the config file and accessing serversettings during campaign
  3. b05c64b - Added a raw logger that doesn't look at logging level (in case of the Config being null). Also added new method for getting a Mod-Store directory

In short:

  1. I removed ways to change server settings from a running campaign, (you can change those settings from the lobby anyway)
  2. The config file used a method from the ACsMod class, but this class is deprecated and i ran into issues using it to actually generate a path to the .modstore directory, So i copied the behaviour into our own McmUtils class (it does the same thing)
  3. I had to replace all references to "AllowRespawn" as the base game now introduces several behaviours that relate to this, you can respawn either mid-game; not at all or when switching maps - and as such that "setting" no longer exists ( i actually had to look into the Barotrauma source code to find how they solved this in the base game, and copy the behavior into our mod)

Let me know if there are any questions

Custom jobs not supported

So at least one player has experienced issues that arose from playing as a custom class/job.

I've managed partially isolate it to the "TryCeateClientCharacter"-method in serverside McmMod.cs

The issue occurs because as the server iterates through all available spawn points on the player submarine, no one matches with the custom job descriptor.

A quick/dirty solution to this would be to create "a fail-over to an assistant" in the method... This means that if the server cannot find a "preferred" spawn point, it'll spawn it on an assistant point, and give the character the job-related items for that spawn point.

This could possibly also solve the incompatibility with "alien races" such as "play as a mudraptor".

I'll be submitting a pull request in the coming days as I progress further down this line.

Sending a bot crew member to reserve when respawn is enabled causes them to respawn as if they had died.

I assume this is unintended behaviour, as it makes sense for player-controlled crew to respawn, but not bot crew members, especially when they haven't actually died. This also means the crew member is duplicated if they are then retrieved from the reserve.

A workaround is to disable respawn, send crew to reserve, transition the level, then reenable respawn. Though this obviously means no one else can respawn before that level transition.

Crash when trying to release another player character

Exception: Object reference not set to an instance of an object. (System.NullReferenceException) Target site: Boolean IsClientOwner(Barotrauma.Networking.Client) Stack trace: at Barotrauma.Character.IsClientOwner(Client client) in <DEV>\Barotrauma\BarotraumaServer\ServerSource\Characters\CharacterNetworking.cs:line 48 at System.Collections.Generic.List1.Find(Predicate1 match) at Barotrauma.Networking.GameServer.Update_Patch2(GameServer this, Single deltaTime) at Barotrauma.GameMain.Run() in <DEV>\Barotrauma\BarotraumaServer\ServerSource\GameMain.cs:line 352 at Barotrauma.Program.Main(String[] args) in <DEV>\Barotrauma\BarotraumaServer\ServerSource\Program.cs:line 89

In save fallback, the character released with reserve disappears forever

My English is not very good, I use deepl to translate, I try to explain the problem and the cause of the problem

For example, the "reserve" command has a character named Shimo, and I use reserve get to release him.
Halfway through the game, our mission fails and we go back to the beginning of the game. At this point, using the "reserve" command again will reveal that there are no stored characters.
The reason for this is that the reserve store file is updated in real time and will not be rolled back with save

Respawn shuttle missbehaving

The respawning shuttle has been misbehaving for some time. It would appear that the instance isn't properly reset between respawning (Items aren't replaced, batteries aren't replenished etc...)

The shuttle has been reported to spawn in when restarting a mission.

The shuttle has been reported to "reset" while approaching the main sub with newly spawned characters in it

If the shuttle was docked with the main sub, both the shuttle and the main sub can start to warp around

Experience and talents lost on death with respawn turned on

Pulled from the steam comments:

pyro557
I have respawn turned on but we still lose our skill levels and talents any help would be appreciated

Worth exploring; i may have broken something when attempting to fix so that characters can be imported into campaigns

No longer works in 0.19.11.0

Thank you for creating such a great mod, but this mod no longer works after the 0.19.11.0 update, please fix.

Mid-game spawn is broken?

*Sry, my English is bad and I use Yandex translator.

mcm spawn throw Exception

I control my character. The player who should appear is an observer.
At first, "mcm spawn" just created a copy of my character (which is also a problem. I want the character configured in the lobby by the player to appear), then he started throwing exceptions.
And "mcm autospawn true" works in an incomprehensible way. He didn't do anything in my game.

My bots are spawning with autospawn off

I have mods Lua For Barotrauma, Multiplayer crew manager only (And several manually made subs upgrades).
Lua settings: CSharp, Hide usernames (toggled on)
So in stations or missions, whenever I write "mcm client autospawn false" and have answer "...character spawn is turned OFF" and then when I die, I get respawned.

Server executable Lua for Barotrauma - ...
Game version 1.4.6.0, mods also up to date

2024-05-17.23-30-46.mp4
2024-05-17.23-27-07.mp4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.