A couple questions about mods.

Place to get help with not working mods / modding interface.
Post Reply
User avatar
firestar246
Inserter
Inserter
Posts: 29
Joined: Sun Feb 19, 2017 11:25 am
Contact:

A couple questions about mods.

Post by firestar246 »

Ok, first question, is there a way to change the color of an existing entity? Like, if I wanted to make another tier of the assembling machine, is there a code I could write that would take the existing graphics of the assembling machine but change the color, so I wouldn't have to create whole new graphics (I stink at that)?

Second, are there any rules about publishing mods with stuff from franchises? My younger brother and I love How to Train Your Dragon, and I made a fun little mod only for me and my brother with dragons from the franchise. I doubt I'd ever publish it (dragons don't really fit with factorio), but if I did, or any other mod with stuff like that, would that be legal?

Thanks in advance guys!
For by grace are ye saved through faith, and that not of yourselves: it is the gift of God: Not of works, lest any man should boast. For the wages of sin is death; but the gift of God is eternal life through Jesus Christ our Lord.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: A couple questions about mods.

Post by eradicator »

You can tint graphics by adding tint = {r= 1, g = 1, b = 0, a = 0.3} (with your color obviously) to the prototype definition, right next to the file name. This will tint the whole graphic thought and so it looks only semi-nice.

As for using assets you didn't make that obviously depends on if you have permission. Some countries have "fair use" policies. But as a general rule i'd say: If you're unsure if you have permissoin, than the answer is usually that you do not have permission. And even if you had permission, it might still be a problem to publish it on the mod portal because you're not the one operating the mod portal, and wube might not have permission to redistribute. (So far nothing happend when people do it anyway, but who knows what'll happen in the future).

User avatar
firestar246
Inserter
Inserter
Posts: 29
Joined: Sun Feb 19, 2017 11:25 am
Contact:

Re: A couple questions about mods.

Post by firestar246 »

Thank you.
I don't have any entities in my mod yet, so I tried it on an item and it didn't seem to work. Factorio didn't block my mod for an invalid code, but nothing appeared different. This is what I had:

Code: Select all

 {
    type = "item",
    name = "tidal-token"  ,
	tint = {r= 100, g = 1, b = 0, a = 0.3}
    icon = "__dragon_mod__/graphics/icons/tidal-token.jpg",
	icon_size = 30,
	
    flags = {"goes-to-main-inventory"},
    subgroup = "token",
    order = "a[tidal-token]",
    stack_size = 99
  },
When I placed the item down, it looked just like the recipe image, which doesn't have the tint. Am I putting tint in the wrong place? Or does it only work for entities? Thanks!
For by grace are ye saved through faith, and that not of yourselves: it is the gift of God: Not of works, lest any man should boast. For the wages of sin is death; but the gift of God is eternal life through Jesus Christ our Lord.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: A couple questions about mods.

Post by darkfrei »

firestar246 wrote:Thank you.
I don't have any entities in my mod yet, so I tried it on an item and it didn't seem to work. Factorio didn't block my mod for an invalid code, but nothing appeared different. This is what I had:

Am I putting tint in the wrong place? Or does it only work for entities? Thanks!
Tinted image must be grayscale. I use tinting for entities (and items) in this mods:
https://mods.factorio.com/mod/RITEG
https://mods.factorio.com/mod/df_belt_graphics
https://mods.factorio.com/mod/Loader-Furnace
https://mods.factorio.com/mod/CannonAlpha as mask
https://mods.factorio.com/mod/NuclearFurnace
https://mods.factorio.com/mod/HeavyWagon as mask
https://mods.factorio.com/mod/GreenTies
and this mod was my first mod with entity tint: https://mods.factorio.com/mod/LinearInserters

:arrow: Item tint: viewtopic.php?f=34&t=51574

User avatar
firestar246
Inserter
Inserter
Posts: 29
Joined: Sun Feb 19, 2017 11:25 am
Contact:

Re: A couple questions about mods.

Post by firestar246 »

darkfrei wrote:
firestar246 wrote:Thank you.
I don't have any entities in my mod yet, so I tried it on an item and it didn't seem to work. Factorio didn't block my mod for an invalid code, but nothing appeared different. This is what I had:

Am I putting tint in the wrong place? Or does it only work for entities? Thanks!
Tinted image must be grayscale. I use tinting for entities (and items) in this mods:
https://mods.factorio.com/mod/RITEG
https://mods.factorio.com/mod/df_belt_graphics
https://mods.factorio.com/mod/Loader-Furnace
https://mods.factorio.com/mod/CannonAlpha as mask
https://mods.factorio.com/mod/NuclearFurnace
https://mods.factorio.com/mod/HeavyWagon as mask
https://mods.factorio.com/mod/GreenTies
and this mod was my first mod with entity tint: https://mods.factorio.com/mod/LinearInserters

:arrow: Item tint: viewtopic.php?f=34&t=51574
So I can't tint already existing graphics? Because as far as I know, no current graphics for the game are greyscale.
For by grace are ye saved through faith, and that not of yourselves: it is the gift of God: Not of works, lest any man should boast. For the wages of sin is death; but the gift of God is eternal life through Jesus Christ our Lord.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: A couple questions about mods.

Post by eradicator »

You can tint icons and non-greyscale images just fine, as i said before. Tinting a greyscale mask just looks significantly better than tinting a colored graphic. Vanilla uses tinted masks to show force colors, for example on cars, cargo wagons, turrets and your character.

Icon tinting only works on .icons and not on .icon, so you have to change that if you want to tint a prototype that currently uses .icon. There's an example on the wiki:

Code: Select all

 item.icons={ --we can make compound icons using this format
   {
     icon = item.icon,
   },
   { --and we can tint them
     icon = "__base__/graphics/icons/iron-plate.png",
     tint = {r= 1, g = 1, b = 0, a = 0.3},
   },
 }
Tinting the icon will have no effect on the entity (or depending on some other circumstances on the recipe icon). To tint an entity you have to change the entity prototype. For exemple (untested):

data.raw['assembling-machine']['assembling-machine-2'].animation.layers[1].tint={r= 1, g = 1, b = 0, a = 0.3}.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: A couple questions about mods.

Post by bobingabout »

darkfrei wrote:Tinted image must be grayscale.
it doesn't have to be, it works if it isn't, it just looks really damn odd and gives unexpected colours if it isn't.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: A couple questions about mods.

Post by darkfrei »

bobingabout wrote:
darkfrei wrote:Tinted image must be grayscale.
it doesn't have to be, it works if it isn't, it just looks really damn odd and gives unexpected colours if it isn't.
"Should be", in Russian it's the same :)

Post Reply

Return to “Modding help”