Biter Nest Quality!


This mod makes it so that the quality of the nests increase as the evolution factor increases! Now attack speed and movement speed also increase as quality increases!

Tweaks
8 hours ago
2.0
92
Enemies Environment

i Hardcoded Quality

16 hours ago

I have noticed that in the Mod basically all Qualities it can use are hard coded in to multiple manually typed out lists.
i hope what im saying isnt going to come across as negative but there exists something "defines.prototypes["quality"]["quality"]" (https://lua-api.factorio.com/latest/defines.html#defines.prototypes) which will give you a list of all quality prototypes that have been registered with the game and thus by default include all modded qualities as well.
Usage of this build in list wouldnt even require any change to the mod other then replacing the manually typed strings with a reference to the quality list, this would most likely make work on the mod significantly easier since you wouldnt need to manually add every quality name someone comes up with on the mod portal.

15 hours ago

Thanks for the response! I'm sorry, i am very new to this, and i tried to get the keys using defines.prototypes["quality"]. In the API docs it says this should return a table equivalent to {normal = 0, uncommon = 0,...} but when i tried to get the keys using for k,_ in defines.prototypes["quality"] it would just return... something that was not useful to me (at this point i don't remember). Thanks for reaching out, i knew there had to be a better way of doing this, but at some point i just wanted the mod to run :P

13 hours ago

Apologies for the confusion, i havent worked much with quality my self yet compared to other parts of the API and there is definitely some weird fuckery going on since large parts are hard coded but thanks to the use of "gvv" (https://mods.factorio.com/mod/gvv?from=search) to visually inspect the lua side of the games structure i discovered that something like "for key, _ in pairs(prototypes.quality) do print(key) end" will get you the prototype names of the qualities. switching the _ with "value" would also allow you access to any of the prototypes data directly as well.
no idea what the defines table does as even after unlocking and using every quality it still only holds the variable quality = 0 and nothing else.
the prototypes.quality method should still uphold my earlier statement i made in the context of the defines table to automatically get every quality.
while im already on the topic besides gvv i would also recommend the use of "event trace" (https://mods.factorio.com/mod/0-event-trace?from=search) as both are very useful moding tools, they not only give you the option to visualy inspect structures your not familiar with and get more information out of it but gvv also has a sandbox of sorts which allows to write code snipets directly in to it to quickly test while the game is running to avoid the need to reload the game to apply script changes.

8 hours ago

Gvv has been a lifesaver, and i did not realize defines.prototypes and prototypes were different things :P

Thanks a lot, it should work with most modded qualities now

New response