Barotrauma

Barotrauma

[AH] ID Card Printer
13 Komentar
Haufzibelstoltz 18 Agu 2022 @ 7:12pm 
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 18 Agu 2022 @ 1:57pm 
Set InventoryIconColor
lua:
targetItem.SerializableProperties[Identifier("InventoryIconColor")].SetValue(targetItem,Color(255, 0, 0, 255))
Uzric Rash  [pembuat] 4 Agu 2022 @ 3:45am 
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 3 Agu 2022 @ 11:05pm 
any update on broken status?
Uzric Rash  [pembuat] 26 Apr 2022 @ 2:24am 
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  [pembuat] 26 Apr 2022 @ 1:06am 
That's a very good idea. I believe it is possible. When I have more free time I will add that.
thecrazy13 25 Apr 2022 @ 1:47pm 
Would there be any way to add a write color to this in order to change the cards sprite color?
whosyourdaddy 28 Nov 2021 @ 8:09am 
Good, maybe one day, lua will realize life service server.
Evil Factory 27 Nov 2021 @ 6:20am 
Nice!
jimmyl 27 Nov 2021 @ 3:54am 
though i could just airlock myself and wait 10 minutes to respawn as security
jimmyl 27 Nov 2021 @ 3:51am 
(not like security ever watches armory)
Uzric Rash  [pembuat] 27 Nov 2021 @ 3:50am 
If security lets you then I don't see why you wouldn't.
jimmyl 27 Nov 2021 @ 3:49am 
omw to print captain access to access armory and murder all of my crew