Oil-Based Paint


Improves paint color & maximum saturation on entities that can be painted: The Engineer, Cars, Locomotives, Trainstops, Gun Turrets etc! - Great for color-coding trains! - Mod support for several AAI vehicles & Hovercrafts - To color vehicles individually, install DMV - Directionally Moving Vehicles!

Tweaks
2 years ago
1.1
3.61K

g Fixed: The engineer …

2 years ago

… is not necessarily just data.raw.character.character. There are a number of mods that provide alternative skins. miniMAXIme has optional dependencies on some of them, if you want to see for yourself. Why don't you loop over data.raw.character and apply the saturation to all characters?

2 years ago

Mmm, good point!
Do you have a specific character you like to play with? I don't actually have a function yet that searches each layer and identifies which layer is the mask layer.

2 years ago

Do you have a specific character you like to play with?

I usually use I, Robot.

I don't actually have a function yet that searches each layer and identifies which layer is the mask layer.

Is it actually possible to automatically identify the mask layer among all the other possible layers?

OT: Is there a way to contact you on the forum? I've some questions regarding compatibility of your DMV mod with some mods I'm working on, but I'm not on Discord etc.

2 years ago

Awesome, I didn't realize I, Robot had color mask! In that case I'll get to work implementing that!

Yes, all you've gotta do is for each index in layers
if .apply_runtime_tint and if .apply_runtime_tint = true, then
do all the saturation to that layer index.

https://forums.factorio.com/memberlist.php?mode=viewprofile&u=116915

There I am on the forums! I was just thinking I'd love to do some actual collaboration, so far it's been a hermit's journey. xD

2 years ago

Well, Pi-C.

I've rewritten everything, and it all works except I, Robot. :( I'm looking in DataRawSerpent, and my changes are accurately reflected in the custom character there, but they just aren't showing up in-game. I honestly have no idea what's going on, since my code works on so many different entities, but not this one.

2 years ago

Awesome, I didn't realize I, Robot had color mask! In that case I'll get to work implementing that!

Yes, all you've gotta do is for each index in layers
if .apply_runtime_tint and if .apply_runtime_tint = true, then
do all the saturation to that layer index.

OK.

https://forums.factorio.com/memberlist.php?mode=viewprofile&u=116915

There I am on the forums! I was just thinking I'd love to do some actual collaboration, so far it's been a hermit's journey. xD

Thanks, I've sent you a PM there!

2 years ago

Well, Pi-C.

I've rewritten everything, and it all works except I, Robot. :( I'm looking in DataRawSerpent, and my changes are accurately reflected in the custom character there, but they just aren't showing up in-game. I honestly have no idea what's going on, since my code works on so many different entities, but not this one.

Sorry, I've got a hunch this may have to do with how I create the character. There's two scenarios to consider: IRobot will replace the default character if no character-selector mod is active, or it will keep both the new and the default character if there is a character-selector mod.

In data.lua, I create a table with the properties I definitely want to keep: that would be sounds and graphics, mainly. Other mods may change things I don't care about, like inventory size, or mining_reach. So I always create my new character with a new name.

In data-updates.lua, other mods have a chance to make changes to the default character. In data-final-fixes.lua, I decide whether I should keep both characters or replace the default. If I replace the default, I copy all properties stored in my table from the new character to the default (thus, I can keep the changes made by other mods to properties I don't care about); if I keep both characters, I copy all properties NOT stored in my table from the default to the new character.

So, you change the new character in data-updates.lua, then I revert your changes in data-final-fixes.lua -- that's the crux of the matter. But it gets even more complicated: As my own character-selector mod (miniMAXIme) depends on other character mods using the procedure described above (so that not every new character replaces the default and you end up with just one alternative character although you've got five active character mods), I've provided a helper mod which already is a dependency of several character mods. Ideally, we should avoid changes in the character mods and try to let the helper mod do everything.

However, you could also move your changes to characters and character-corpses from data-updates.lua to data-final-fixes.lua, and add an optional dependency (it should be OK if it's hidden) on IRobot and any other character mods you want to support, so that they are guaranteed to be finished before you add your changes.

2 years ago
(updated 2 years ago)

Thank you! Lol, I've been racking my brain on this one! How do I create a hidden optional dependency?

EDIT: Nvm, googled it! (?)

2 years ago
(updated 2 years ago)

In info.json:

"dependencies": [
    "base >= 1.1.6",              -- Hard dependency
    "? SchallTransportGroup",     -- Optional dependency
    "(?) cargo-ships",            -- Hidden optional dependency
    "! autodrive",                -- Conflict
    "~ UnminableVehicles"         -- Hard dependency that won't affect loading order
]

The first 3 dependencies force the mod you depend on to load before yours; the last one just ensures that both your mod and the mod you depend on are active, but it doesn't really matter which one is loaded first; the conflict will prevent that both mods are active at the same time. You should keep in mind that a JSON file doesn't allow for comments, so copying the code above will error on loading.

OK, I'm off for today. Good luck! :-)

2 years ago

Alrighty! Implemented in v1.0.6.

It's been a difficult journey, but I've learned a lot. :P

New response