Barotrauma

Barotrauma

[AH] ID Card Printer
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
jimmyl 2021 年 11 月 27 日 上午 3:51 
(not like security ever watches armory)
Uzric Rash  [作者] 2021 年 11 月 27 日 上午 3:50 
If security lets you then I don't see why you wouldn't.
jimmyl 2021 年 11 月 27 日 上午 3:49 
omw to print captain access to access armory and murder all of my crew