Barotrauma 潜渊症

Barotrauma 潜渊症

评价数不足
[AH] ID Card Printer
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
532.258 KB
2021 年 11 月 27 日 上午 3:24
2022 年 4 月 24 日 上午 6:04
5 项改动说明 ( 查看 )

订阅以下载
[AH] ID Card Printer

描述
This mod overrides the vanilla ID card. Incompatibilities may arise with other mods that override the very same item.
This mod needs Lua for Barotrauma installed as a server mod.


A BUG INTRODUCED IN THE NEWEST BAROTRAUMA VERSION HAS COMPLETELY BROKEN THE write_character PIN.



Have you ever lost your ID card and wished to have it back without creating a new character? Have you ever wanted to promote a loyal crewmate to an officer and grant them access to sensitive areas of the submarine? Or maybe even, have you ever wanted to demote an officer instead?

If your answer is yes to any of these questions, then this mod is for you.

Now you can fabricate a new item called an ID Card Printer. Once you have the printer installed and powered you can place any ID card inside to modify it. In order to do so you have the following pins:

Pin read_tags, when a one (1) signal is received then all overwritable tags of the ID card are sent as a signal through read_tags_out (or a none signal is sent instead if the card has no such tags).

Pin write_tags, when a signal is received it writes its value as tags into the ID card. In order to prevent exploits with special item tags, it only accepts tags that start with id (for example: id_captain). Any overwrittable tags that are not in the signal are lost, thus you can send a nonsense signal (for example: id_no_tags_for_you) in order to remove all other tags and demote an ID card. In order to write more than a single tag at a time you can concatenate them with commas (for example: id_medic,id_security,id_engineer).

Take into account that valid access tags are different depending on the submarine, although all vanilla submarines use the following: id_captain, id_security, id_medic, id_engineer, id_mechanic. You can also use the read_tags pin with another ID card as a template.

Pin write_character, when a signal is received it searches its value among the names of the crew and prints a suitable ID card clone (for example: if you have Artie Dolittle as a crewmate, if you send an "Artie Dolittle" signal without the quotes then an "Artie Dolittle the assistant" card will be written, albeit with no access tags). You can use this in order to write new ID cards for the crew that lost them. Or for identity theft as a crafty traitor.

You can also now fabricate blank ID cards, which are perfectly suitable for these operations.

For an in game example of a circuit using the printer, this mod also includes an item assembly.

Known issues:
  • A BUG INTRODUCED IN THE NEWEST BAROTRAUMA VERSION HAS COMPLETELY BROKEN THE write_character PIN.
  • Since Lua does not work without a server, this mod does not work in the sub editor or in single player.
  • There might be some exploits in PVP by writing enemy ID cards.

CREDITS:
  • ID Card Printer sprite by LzNN.
13 条留言
Haufzibelstoltz 2022 年 8 月 18 日 下午 7:12 
Write_character pin, without crew spawn tags.

lua:

local function replaceIdCardAndWriteCharacter(targetInventory, oldItem, newPrefab, character)
Entity.Spawner.AddItemToRemoveQueue(oldItem)
ah_utils.time.delayFunction(0.1, function()
Entity.Spawner.AddItemToSpawnQueue(newPrefab, targetInventory, nil, nil, function(spawned)
spawned.GetComponentString("IdCard").Initialize(nil, character);
end)
end)
end
local function ah_idcard_printer_write_character(item, contained, signal, connection)
local target = contained[1]
local inventory = target.ParentInventory
local prefab = target.Prefab
local character = ah_utils.table.firstOrNil(Character.CharacterList, function(it)
return it.IsHuman and it.Info.Name == signal.value
end)
if(character ~= nil) then
replaceIdCardAndWriteCharacter(inventory, target, prefab, character)

end
end
Haufzibelstoltz 2022 年 8 月 18 日 下午 1:57 
Set InventoryIconColor
lua:
targetItem.SerializableProperties[Identifier("InventoryIconColor")].SetValue(targetItem,Color(255, 0, 0, 255))
Uzric Rash  [作者] 2022 年 8 月 4 日 上午 3:45 
The write_character pin is still broken.
Although it's less of an issue in campaign mode now because idcards are sold in stations.
Still a bummer for traitor mode though.
The other pins work perfectly as far as I know.
Dr.Shimapan 2022 年 8 月 3 日 下午 11:05 
any update on broken status?
Uzric Rash  [作者] 2022 年 4 月 26 日 上午 2:24 
Unfortunately upon further investigation it looks like it's not possible: I can change the SpriteColor (that is, when the ID card is dropped on the floor) but the InventoryColor is hardcoded so it can only be changed in the sub editor.
Uzric Rash  [作者] 2022 年 4 月 26 日 上午 1:06 
That's a very good idea. I believe it is possible. When I have more free time I will add that.
thecrazy13 2022 年 4 月 25 日 下午 1:47 
Would there be any way to add a write color to this in order to change the cards sprite color?
whosyourdaddy 2021 年 11 月 28 日 上午 8:09 
Good, maybe one day, lua will realize life service server.
Evil Factory 2021 年 11 月 27 日 上午 6:20 
Nice!
jimmyl 2021 年 11 月 27 日 上午 3:54 
though i could just airlock myself and wait 10 minutes to respawn as security