How to localize arbitrary item name?
Posted: Wed Sep 28, 2016 11:17 pm
Hi,
How can I localize item name when I don't know the type of an item? Like, is it entity, equipment or simple item?
Say, there is ghost entity that is blocked by laying around items. When my script revives ghost entity, I want to put these items into player's inventory and to show flying text "+10 Iron plate (50)" like in vanilla game when you build entity over items on the ground.
Problem is, I have item names only and don't know how to convert them into localised strings, because their names are grouped by types for some reason, like: 'item-name.pistol', 'entity-name.splitter' or 'equipment-name.battery-equipment'.
Its strange how entities and equipment have respective item prototypes but don't have 'item-name.###' localisation strings.
PS. Also, revive() function does a good job returning list of removed items from ground with their respective count, however all item specific information (health, clip rounds, armour equipment, etc.) is lost. But that's something I'm trying not to think about right now.
How can I localize item name when I don't know the type of an item? Like, is it entity, equipment or simple item?
Say, there is ghost entity that is blocked by laying around items. When my script revives ghost entity, I want to put these items into player's inventory and to show flying text "+10 Iron plate (50)" like in vanilla game when you build entity over items on the ground.
Problem is, I have item names only and don't know how to convert them into localised strings, because their names are grouped by types for some reason, like: 'item-name.pistol', 'entity-name.splitter' or 'equipment-name.battery-equipment'.
Its strange how entities and equipment have respective item prototypes but don't have 'item-name.###' localisation strings.
PS. Also, revive() function does a good job returning list of removed items from ground with their respective count, however all item specific information (health, clip rounds, armour equipment, etc.) is lost. But that's something I'm trying not to think about right now.