
Would you please add a shotgun "ammo box" to the game

I'm thinking 10-50 (how about 20 ?) shotgun shells and the stack size could be 50 - since it is much stronger than the piercing rounds and it could be called "shotgun ammo box"

in the new version i did make it simmaler to your way if you want to check it out DownloadAfforess wrote:Bl4ckmail wrote:Lol i never saw your mod before and decided to make aLogistic turrets mod myself and uploaded it yesterday. And now i get to see this post.You might want to take a look at how I made the logistics container invisible, and the turret in-operable. It's a bit more polished that way.
If you want to build off this mod and have your mod add new gun turret types (e.g sniper?), that would also be cool. I don't really have any plans to expand this mod, I'm happy with the way it works now.
I'll see if I can find some decent icon images for shotgun shells, and add it.jockeril wrote:Afforess - I was thinking about ammobox and remembered there is a similar stacker for the combat shotgun too
This would be pretty nice.jockeril wrote:Afforess - I was thinking about ammobox and remembered there is a similar stacker for the combat shotgun too, so I did some googling, and found this AA-12 combat shotgun (article picture below) with this MD-20 drum (20-round magazine/drum article) and a youtube video to show it off (don't mind the crazy, unprofessional russian demonstrating it)
Would you please add a shotgun "ammo box" to the game?
I'm thinking 10-50 (how about 20 ?) shotgun shells and the stack size could be 50 - since it is much stronger than the piercing rounds and it could be called "shotgun ammo box"
See extra addons on the OP.NoriSilverrage wrote:I don't suppose there is a way to get autofill to put ammo in these turrets? Or a way to make blueprints apply the logistics? A bit tough to use it large scale
Oh, huh, sorry.Afforess wrote:See extra addons on the OP.NoriSilverrage wrote:I don't suppose there is a way to get autofill to put ammo in these turrets? Or a way to make blueprints apply the logistics? A bit tough to use it large scale
No thanks. Edit it yourself, but I generally don't provide configurations. Its a waste of my time. Doubly so with thanks to the mod portal.Tyrindor wrote:Like the mod, but please give a way to disable the turret MK2 in config. It's not balanced for some other mods I use.
Well not everyone knows how to mod, which is why configs exist. The same reason why the 10 mods that add a random radar to their mod, all have a config options to disable it achieve better balance in any modded game. *shrug*Afforess wrote:No thanks. Edit it yourself, but I generally don't provide configurations. Its a waste of my time. Doubly so with thanks to the mod portal.Tyrindor wrote:Like the mod, but please give a way to disable the turret MK2 in config. It's not balanced for some other mods I use.
Cool! Ammobox is open source, and I'm always happy to have people modifying/remixing it.SquarelyCircle wrote:Yep, so I just went in and modified the code and eliminated the gun turret from the mod, and it went from being the mod that took up the most CPU time to one of them taking up the least CPU time.
If anyone is looking for the turret-less version, I'll upload it here. The author is, of course, perfectly welcome to request I take it down, or to take it and upload it separately as a solo ammobox mod.
https://drive.google.com/file/d/0B2dPrr ... sp=sharing
I've long since moved on from that map, and couldn't provide further information. However, I didn't even have any modified turrets on the map, which is what I find really odd. The performance wasn't terrible, it was just more than any other mod at that time. I usually run with a lot of mods, so that's still pretty surprising. Other mods whose performance is surprisingly CPU heavy include the single splitter mod and the item collector mod (although I think I'm getting why the item collector mod was so CPU heavy combined with Bobs Enemies). The only thing I can think is that it's making a call for something every tick, especially if it's searching for all the turrets, that could slow the mod down a lot (like the item collector) - I'm no expert.Afforess wrote:Cool! Ammobox is open source, and I'm always happy to have people modifying/remixing it.SquarelyCircle wrote:Yep, so I just went in and modified the code and eliminated the gun turret from the mod, and it went from being the mod that took up the most CPU time to one of them taking up the least CPU time.
If anyone is looking for the turret-less version, I'll upload it here. The author is, of course, perfectly welcome to request I take it down, or to take it and upload it separately as a solo ammobox mod.
https://drive.google.com/file/d/0B2dPrr ... sp=sharing
I'm curious exactly what sort of map setup you have to have such bad performance with this mod. Any chance you can provide a save/mod-set so I can take a look and see if the situation ca be improved?
Code: Select all
script.on_event({defines.events.on_entity_died,defines.events.on_preplayer_mined_item,defines.events.on_robot_pre_mined}, function(event)
onGunTurretMk2Destroyed(event.entity)
end)
.....
function onGunTurretMk2Destroyed(turret_entity)
Logger.log("Gun Turret Destroyed, Entity name: " .. turret_entity.name) --remove this line
if turret_entity.name == "ammobox-gun-turret-2" or turret_entity.name == "ammobox-gun-turret-2-ui" then
.....
Good find, and totally valid. I'll remove the logging entirely in the next release.WarriorOfAvalon wrote:So I was just investigating the performance of this mod after having some issues with it, specifically when using construction bots to destroy large areas, and have found something kinda weird in the code.
In control.lua your event handler for destroying or mining an entity does not filter the entity before calling 'onGunTurretMk2Destroyed(event.entity)'. This function ALWAYS logs the entity destroyed, before checking if it is a mk2 turret. This means every single entity that is destroyed is written to the text file, which is a massive CPU overhead. I assume this was something left behind from testing but you should remove asap.
Just removing this one line reduced CPU from 0.5/0.6 to 0.01 (when deconstructing)Code: Select all
script.on_event({defines.events.on_entity_died,defines.events.on_preplayer_mined_item,defines.events.on_robot_pre_mined}, function(event) onGunTurretMk2Destroyed(event.entity) end) ..... function onGunTurretMk2Destroyed(turret_entity) Logger.log("Gun Turret Destroyed, Entity name: " .. turret_entity.name) --remove this line if turret_entity.name == "ammobox-gun-turret-2" or turret_entity.name == "ammobox-gun-turret-2-ui" then .....
edit: for future reference I would recommend removing all but essential error logging lines when you release a mod as writing to a log file is very slow. There are a couple of others in the mod I would recommend you remove although they won't have any major impact, it's just good practice.