Making a no impact damage mod for vanilla vehicles

Place to get help with not working mods / modding interface.
Post Reply
Sarxis
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sat Feb 24, 2018 2:21 pm

Making a no impact damage mod for vanilla vehicles

Post by Sarxis » Wed Aug 08, 2018 5:26 am

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!

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

Re: Making a no impact damage mod for vanilla vehicles

Post by darkfrei » Wed Aug 08, 2018 7:08 am

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}
    },

Sarxis
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sat Feb 24, 2018 2:21 pm

Re: Making a no impact damage mod for vanilla vehicles

Post by Sarxis » Thu Aug 09, 2018 7:11 am

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!

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 2532
Joined: Tue May 13, 2014 11:06 am

Re: Making a no impact damage mod for vanilla vehicles

Post by DaveMcW » Thu Aug 09, 2018 8:05 am

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.

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

Re: Making a no impact damage mod for vanilla vehicles

Post by darkfrei » Thu Aug 09, 2018 10:25 am

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.

Sarxis
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sat Feb 24, 2018 2:21 pm

Re: Making a no impact damage mod for vanilla vehicles

Post by Sarxis » Mon Aug 13, 2018 5:25 am

Thanks for the help you guys!

Post Reply

Return to “Modding help”