Page 2 of 3
Re: [MOD 0.12.x] AmmoBox 0.2.1
Posted: Mon Jan 18, 2016 1:07 pm
by Afforess
callmewoof wrote:I appreciate the mod! I was wondering though after looking at the files, is there a reason it needs to be so complicated? Like, what's with the logger stuff? Isn't the principal of requesters built into the base game? I know it isn't literally that simple, but in the end an object is just saying "hey I have 1 requester slot, FYI". I hope that doesn't sound rude, I mean the mod works and again thanks, but what's the hurdle from it being much simpler? I'm sure I'm missing something, probably obvious, so I appreciate if you/anyone can answer. Thanks!
The main reason for complexity is that you can't have an entity act as two different types (gun turret and logistics container). So what happens instead is that when you place it, a hidden logistics chest is placed on half the space and the turret checks it to find ammo. in addition, some extra complexity is introduced due to the lack of any way for mods to tell when a player right clicks on an entity. I think there are definitely places the code could be simplified in some places, because this was my first "real" mod, and I wasn't super-familiar with lua or the API when I wrote it. The logging code is simply for debugging, and also was written for 0.11 before there was a good way to append to files... Again, it could be greatly simplified now.
As it states on the readme in Github, I'm open to contributions if you want to attack the code and fix or clean up things.
Re: [MOD 0.12.11+] AmmoBox 0.2.1 - Fun with Turrets & Logistics
Posted: Tue Jan 19, 2016 4:04 am
by callmewoof
Thank you so much for your answer! It makes a lot more sense now. I don't think I'd be able to tweak or improve it though. Too bad the game has limitations like that, but I suppose that's hard-coded and simply the design choice they went with. Oh well!
Re: [MOD 0.12.11+] AmmoBox 0.2.1 - Fun with Turrets & Logistics
Posted: Tue Jan 19, 2016 5:15 am
by Afforess
callmewoof wrote:Thank you so much for your answer! It makes a lot more sense now. I don't think I'd be able to tweak or improve it though. Too bad the game has limitations like that, but I suppose that's hard-coded and simply the design choice they went with. Oh well!
Glad it makes sense, and I wasn't the one to come up with the "hidden entity" trick, I believe TreeFarm was the first mod I saw using it, but there may be even older mods that did it.
Re: [MOD 0.12.11+] AmmoBox 0.2.1 - Fun with Turrets & Logistics
Posted: Tue Jan 19, 2016 4:56 pm
by kiba
Don't think it's a design choice, but rather that the developers hadn't gotten around to it yet.
Re: [MOD 0.12.11+] AmmoBox 0.2.1 - Fun with Turrets & Logistics
Posted: Tue Jan 19, 2016 5:08 pm
by Afforess
kiba wrote:Don't think it's a design choice, but rather that the developers hadn't gotten around to it yet.
I am not sure. I've talked with rseding in IRC ages ago, and I don't think there is going to be a way for modders to ever create new "types" of entities, because the entity types are backed by a C++ class, which obviously modders don't have control over. Having an entity with multiple types likely is a similar problem, I haven't see the source code, but from the API docs, it seems that the developers went the OOP inheritance model for entities, and multiple inheritance is generally regarded as evil.
Again, I can't see the source code, but it is possible to make reasoned speculation based on the API documentation, and it does not seem like the game was designed to allow multiple entity types.
Re: [MOD 0.12.11+] AmmoBox 0.2.1 - Fun with Turrets & Logistics
Posted: Thu Jan 28, 2016 9:50 pm
by MtnDew
Added to an existing save with Dytech and it seems your research for the turret 1 is the same name as his and seems to be overridden in the research tree. Can't research it so you can't ever get it. I can see it on filters and so forth but just can't research it. Unless you are planning on making turrets 2 etc. Then might I suggest an alternative name like logistics turret or something.
Re: [MOD 0.12.11+] AmmoBox 0.2.1 - Fun with Turrets & Logistics
Posted: Fri Jan 29, 2016 12:50 am
by Afforess
MtnDew wrote:Added to an existing save with Dytech and it seems your research for the turret 1 is the same name as his and seems to be overridden in the research tree. Can't research it so you can't ever get it. I can see it on filters and so forth but just can't research it. Unless you are planning on making turrets 2 etc. Then might I suggest an alternative name like logistics turret or something.
Yeah, I just checked and both the recipe and the tech having naming collisions. AmmoBox loads first, (A loads before D) and then Dytech overrides my recipe & tech definition.
I will release a new version that fixes the naming collisions this weekend. It's not straightforward because I will probably have to rename everything to avoid this. I have to check if a gun-turrets-2 already exists and make sure it unlocks my recipe, and also prefix the recipe and entity with 'ammobox-' so to prevent the collisions and this issue from cropping up again.
Re: [MOD 0.12.11+] AmmoBox 0.2.1 - Fun with Turrets & Logistics
Posted: Fri Jan 29, 2016 12:20 pm
by Buggi
So the devs went with Objects instead of interfaces for different types of entites?
Sigh...
With interfaces you could have entities have the functionality of many different types of things.
So like,
class LogicTurret : ILogisticContainer, ITurret
In LUA you could add a hook for item types and expand on it with "Functionality" flags. The code could read the LUA entity definition item ID as well as functionality ID's and ensure the game manages the different features accordingly.
like this:
Code: Select all
data:extend(
{
{
type = 'ammo-turret',
name = 'logic-turret',
functions = 'turret, logicContainer,circuitNetwork',
.....
}
Then the game would see the flags, know what settings to look for, and what functionality to implement.
Just a thought.
Re: [MOD 0.12.11+] AmmoBox 0.2.1 - Fun with Turrets & Logistics
Posted: Fri Jan 29, 2016 3:02 pm
by Afforess
Buggi wrote:So the devs went with Objects instead of interfaces for different types of entites?
Sigh...
With interfaces you could have entities have the functionality of many different types of things.
So like,
class LogicTurret : ILogisticContainer, ITurret
In LUA you could add a hook for item types and expand on it with "Functionality" flags. The code could read the LUA entity definition item ID as well as functionality ID's and ensure the game manages the different features accordingly.
like this:
Code: Select all
data:extend(
{
{
type = 'ammo-turret',
name = 'logic-turret',
functions = 'turret, logicContainer,circuitNetwork',
.....
}
Then the game would see the flags, know what settings to look for, and what functionality to implement.
Just a thought.
I agree, I've suggested as much before, and the Factorio devs explained that changing the entity system in such a fundamental way at this late stage is a non-starter. At this point I am just working within the framework we have.
Re: [MOD 0.12.11+] AmmoBox 0.2.1 - Fun with Turrets & Logistics
Posted: Fri Jan 29, 2016 9:52 pm
by kiba
Afforess wrote:Buggi wrote:So the devs went with Objects instead of interfaces for different types of entites?
Sigh...
With interfaces you could have entities have the functionality of many different types of things.
So like,
class LogicTurret : ILogisticContainer, ITurret
In LUA you could add a hook for item types and expand on it with "Functionality" flags. The code could read the LUA entity definition item ID as well as functionality ID's and ensure the game manages the different features accordingly.
like this:
Code: Select all
data:extend(
{
{
type = 'ammo-turret',
name = 'logic-turret',
functions = 'turret, logicContainer,circuitNetwork',
.....
}
Then the game would see the flags, know what settings to look for, and what functionality to implement.
Just a thought.
I agree, I've suggested as much before, and the Factorio devs explained that changing the entity system in such a fundamental way at this late stage is a non-starter. At this point I am just working within the framework we have.
Technical debt...it sucks.
Does this mod works with bob's mod?
Re: [MOD 0.12.11+] AmmoBox 0.2.1 - Fun with Turrets & Logistics
Posted: Fri Jan 29, 2016 9:54 pm
by Afforess
kiba wrote:
Technical debt...it sucks.
Does this mod works with bob's mod?
I haven't tried, but I think I will test it after I make the changes to make it compatible with Dytech.
Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics
Posted: Sat Jan 30, 2016 5:44 am
by Afforess
MtnDew wrote:Added to an existing save with Dytech and it seems your research for the turret 1 is the same name as his and seems to be overridden in the research tree. Can't research it so you can't ever get it. I can see it on filters and so forth but just can't research it. Unless you are planning on making turrets 2 etc. Then might I suggest an alternative name like logistics turret or something.
I just released AmmoBox 0.3.0 which should fix the compatibility with Dytech. Let me know if you encounter more incompatibilities or other bugs.
Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics
Posted: Sat Feb 27, 2016 8:12 pm
by Jelgadis
this mod + addon are Awesome!!
can you add 1 more turret codes with hidden recipe to expand please? (ammobox-gun-turret-3 or ammobox-some-turret something like this...)
Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics
Posted: Sat Feb 27, 2016 9:37 pm
by Afforess
Jelgadis wrote:
can you add 1 more turret codes with hidden recipe to expand please? (ammobox-gun-turret-3 or ammobox-some-turret something like this...)
I'm not really sure what you are asking for... expand what?
Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics
Posted: Sat Feb 27, 2016 10:52 pm
by Jelgadis
Afforess wrote:Jelgadis wrote:
can you add 1 more turret codes with hidden recipe to expand please? (ammobox-gun-turret-3 or ammobox-some-turret something like this...)
I'm not really sure what you are asking for... expand what?
first, sorry for my bad english.
I wanna add more ammobox-turrets.. MK3.. MK4..etc
but I don't have good skill for codes.
If you add 1 more turret code in this mod, maybe I can handle it.
can you do it for me please?
Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics
Posted: Tue Mar 01, 2016 11:03 am
by jockeril
not only am I excited to try this out - I'v also decided to contribute a Hebrew translation for it !

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics
Posted: Tue Mar 01, 2016 4:22 pm
by Afforess
jockeril wrote:not only am I excited to try this out - I'v also decided to contribute a Hebrew translation for it !

Fantastic! I'll take a look and get it included in a new release.

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics
Posted: Tue Mar 01, 2016 4:31 pm
by Bl4ckmail
Lol i never saw your mod before and decided to make a
Logistic turrets mod myself and uploaded it yesterday. And now i get to see this post.
Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics
Posted: Tue Mar 01, 2016 6:51 pm
by Afforess
Bl4ckmail wrote:Lol i never saw your mod before and decided to make a
Logistic 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.
Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics
Posted: Sun Mar 20, 2016 12:12 pm
by thurak126
One thing I have noticed is that the Gun Turret Mk2 does not remember its logistic requested items in blueprints, in 0.12.27 anyway, not tested in previous versions. Also do you have any plans for other types of x100 ammo, or just bullets and flamethrowers?