Overwrite car sprites for new entity car?

Place to get help with not working mods / modding interface.
robertpaulson
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Sun Jun 18, 2017 2:21 pm
Contact:

Overwrite car sprites for new entity car?

Post by robertpaulson »

Hi.

I would like to have a different color for my custom car, however I can't manage to make it different in color than the vanilla car.

I made a copy of all the sprites and placed them in my graphics mod directory after editing the color pallet, I also copied the entire animation from the vanilla car with animation files pointed at my adjusted car graphic files and placed them in my mod lua for the custom car entity. However the game keeps the vanilla graphics from the base game dir. I have checked and if I replace the base game files all cars change color. But I would like to differentiate the custom car. I read that the lowest y coord takes the highest layer but how would I implement that?

Code: Select all

animation =
    {
      layers =
      {
        {
          width = 102,
          height = 86,
          frame_count = 2,
          direction_count = 64,
          shift = {0, -0.1875},
          animation_speed = 8,
          max_advance = 0.2,
          stripes =
          {
            {
             filename = "__custom car__/graphics/car/car-1.png",
             width_in_frames = 2,
             height_in_frames = 22,
            },
            {
             filename = "__customcar__/graphics/car/car-2.png",
             width_in_frames = 2,
etc etc
edit: aso I also came across a tint for sprites. Would that work for a car? There is something about run-time_tint buts its a Boolean.
User avatar
moon69
Fast Inserter
Fast Inserter
Posts: 184
Joined: Sun Sep 18, 2016 6:53 pm
Contact:

Re: Overwrite car sprites for new entity car?

Post by moon69 »

Not sure if it's the whole issue, but __custom car__ vs __customcar__ in the small snippet provided.

Are you using hr_version?
robertpaulson
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Sun Jun 18, 2017 2:21 pm
Contact:

Re: Overwrite car sprites for new entity car?

Post by robertpaulson »

moon69 wrote:Not sure if it's the whole issue, but __custom car__ vs __customcar__ in the small snippet provided.

Are you using hr_version?
No that was just a typo I made here in the post. Im using all contents of car folder, so the 3 normal files 6 for HR and all masks.
robertpaulson
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Sun Jun 18, 2017 2:21 pm
Contact:

Re: Overwrite car sprites for new entity car?

Post by robertpaulson »

There is a color change triggered on event on_player_driving_changed_state, anyone know how this color change is actually called? can you always turn it on? because that would work too... I just have a hard time with subbing these animation frames as i can't find anything wrong with the code and they do not overwrite the vanilla car

interesting part is that icon replacement works (so i can have a new icon for my custom car and the vanilla car), and if I point to the wrong path for my new icon I get an error, while if I change the path for animation graphics to incorrect intentionally game doesn't care. Its like it's ignoring the whole "animation" property of car entity.... more over trains get a whole new treatment since they have "pictures" instead of an "animation"...
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Overwrite car sprites for new entity car?

Post by darkfrei »

You can use this tool for open or change the raw table.
viewtopic.php?f=34&t=32741#p237880
robertpaulson
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Sun Jun 18, 2017 2:21 pm
Contact:

Re: Overwrite car sprites for new entity car?

Post by robertpaulson »

darkfrei wrote:You can use this tool for open or change the raw table.
viewtopic.php?f=34&t=32741#p237880
thank you for help.

Actually all I had to do was to change animation to car.animation.... duh :P
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Overwrite car sprites for new entity car?

Post by darkfrei »

robertpaulson wrote:
thank you for help.

Actually all I had to do was to change animation to car.animation.... duh :P
I haven't factorio now, but you can compare the table with your mod and without. Probably you has changed wrong part of table.
Post Reply

Return to “Modding help”