Page 1 of 1

Making a no impact damage mod for vanilla vehicles

Posted: Wed Aug 08, 2018 5:26 am
by Sarxis
Greetings modders!

I know how to add and change resistance types for existing mods, and I also know how to change the game's entities.lua to alter impact damage resistance. But would making a small mod to do give the vanilla vehicles 100% impact resistance be very involved? I'd rather use a mod than altering the base game files, but I don't know how to make a mod from scratch and might be too involved for my amateur skills.

Any advice is appreciated!

Re: Making a no impact damage mod for vanilla vehicles

Posted: Wed Aug 08, 2018 7:08 am
by darkfrei
Reference mod: https://mods.factorio.com/mod/HeavyWagon
Just add resistance:

Code: Select all

resistances = {
      {  type = "fire",  decrease = 15,  percent = 50}, 
      {  type = "physical",  decrease = 15,  percent = 30}, 
      {  type = "impact",  decrease = 1,  percent = 1}, 
      {  type = "explosion",  decrease = 15,  percent = 30}, 
      {  type = "acid",  decrease = 10,  percent = 20}
    },

Re: Making a no impact damage mod for vanilla vehicles

Posted: Thu Aug 09, 2018 7:11 am
by Sarxis
Like I said, I know how to implement the resistance changes directly to existing mods and to the base game entities.lua file, I just don't know how to make a mod or script that I could insert into an existing mod to do the same thing. I hate having to tinker with the base game files if I can avoid it.

I just don't know how to avoid it!

Re: Making a no impact damage mod for vanilla vehicles

Posted: Thu Aug 09, 2018 8:05 am
by DaveMcW
Making a mod requires 3 things:

1. A new folder in your factorio mods directory named: my-mod_0.0.1
2. An info.json file. Copy it from any mod and make sure the name is my-mod and the version is 0.0.1
3. A data.lua file containing your changes. In this case you would want:

Code: Select all

data.raw["car"]["car"].resistances = {}
Bonus 4th thing: you can zip the mod folder to distribute it, but this makes it harder to edit and is not required.

Re: Making a no impact damage mod for vanilla vehicles

Posted: Thu Aug 09, 2018 10:25 am
by darkfrei
Sarxis wrote:Like I said, I know how to implement the resistance changes directly to existing mods and to the base game entities.lua file, I just don't know how to make a mod or script that I could insert into an existing mod to do the same thing. I hate having to tinker with the base game files if I can avoid it.

I just don't know how to avoid it!
Just open current log file with Notepad++ and this mod:
viewtopic.php?f=135&t=45107
You can find whole data.raw here.

Re: Making a no impact damage mod for vanilla vehicles

Posted: Mon Aug 13, 2018 5:25 am
by Sarxis
Thanks for the help you guys!