Well, what the title says.
Knowing group of ammo my be useful for realisation of different transfrormations and transitions between groups.
I currently have the mod, which needs to know ammo category in order to procedurally provide compatibility for other mods which add custom ammunition.
Add ammo_category to game.item_prototypes
Add ammo_category to game.item_prototypes
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Add ammo_category to game.item_prototypes
Yeah, when talking about data.raw, an ammo type item is of type ammo instead of item, which makes detecting ammo and it's type easy.
but when you get into the game and are using game.item_prototypes to look for item types to make scripts, that dynamically add in items from other mods, this because a whole other story. there is no way to detect what is an ammo type, or what type of ammo it is.
so.... in short, I agree, I think the whole game.item_prototypes thing in inadequate, you really need a system that is capable of presenting all the information that would be accessable via data.raw ingame.
In fact, I'd sugest re-designing the way the whole thing works, and present the modder with a bigger option, perhaps game.prototypes. should allow read-only access to all data.raw entries, so when a modder needs to find such a thing he can scan game.prototypes.ammo and scan through the ammo types for ammo catagory.
but when you get into the game and are using game.item_prototypes to look for item types to make scripts, that dynamically add in items from other mods, this because a whole other story. there is no way to detect what is an ammo type, or what type of ammo it is.
so.... in short, I agree, I think the whole game.item_prototypes thing in inadequate, you really need a system that is capable of presenting all the information that would be accessable via data.raw ingame.
In fact, I'd sugest re-designing the way the whole thing works, and present the modder with a bigger option, perhaps game.prototypes. should allow read-only access to all data.raw entries, so when a modder needs to find such a thing he can scan game.prototypes.ammo and scan through the ammo types for ammo catagory.
Re: Add ammo_category to game.item_prototypes
Doesn't prototype.type == "ammo" work for checking if a item prototype is ammo? As for the category - that would be useful and i'll add that for 0.13.
If you want to get ahold of me I'm almost always on Discord.
Re: Add ammo_category to game.item_prototypes
LuaGameScript::ammo_category_prototypes has been added and LuaGameScript::get_filtered_item_prototypes allows getting prototypes of a given type. The thread can be moved to implemented requests now.