Barotrauma
[AH] ID Card Printer
13 comentarii
Haufzibelstoltz 18 aug. 2022 la 19: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 18 aug. 2022 la 13:57 
Set InventoryIconColor
lua:
targetItem.SerializableProperties[Identifier("InventoryIconColor")].SetValue(targetItem,Color(255, 0, 0, 255))
Uzric Rash  [autor] 4 aug. 2022 la 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 3 aug. 2022 la 23:05 
any update on broken status?
Uzric Rash  [autor] 26 apr. 2022 la 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  [autor] 26 apr. 2022 la 1:06 
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 la 13:47 
Would there be any way to add a write color to this in order to change the cards sprite color?
whosyourdaddy 28 nov. 2021 la 8:09 
Good, maybe one day, lua will realize life service server.
Evil Factory 27 nov. 2021 la 6:20 
Nice!
jimmyl 27 nov. 2021 la 3:54 
though i could just airlock myself and wait 10 minutes to respawn as security
jimmyl 27 nov. 2021 la 3:51 
(not like security ever watches armory)
Uzric Rash  [autor] 27 nov. 2021 la 3:50 
If security lets you then I don't see why you wouldn't.
jimmyl 27 nov. 2021 la 3:49 
omw to print captain access to access armory and murder all of my crew