How do you replace component of the base mod?
- Solar's Wrath
- Burner Inserter
- Posts: 19
- Joined: Mon Mar 21, 2016 8:09 pm
- Contact:
How do you replace component of the base mod?
I am working on a mod, I have very basic modding knowledge for now so this isn't something I know but How do you replace a Base item or building for something else? Or just make it so certain Base stuff are ignored?
Exemple I want to replace Iron by something else and I want to replace Science labs by another building.
That would really help thanks ^^
Exemple I want to replace Iron by something else and I want to replace Science labs by another building.
That would really help thanks ^^
Last edited by Solar's Wrath on Mon Sep 05, 2016 2:17 pm, edited 1 time in total.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: How to replace an item/building for another
Depends when you want to do it... If you want the change to apply globally, then do it via prototypes - take a look at "balance" mods in the mod portal, unzip them and look in the prototypes folder.
If you want to do it in-game, on specific things on an ad-hoc basis, then you'd have to get a reference to the entity, or whatever, and destroy it then replace it with the new thing.
In either case, I'd suggest looking for mods that do similar changes to what you want and then look at how they do it.
If you want to do it in-game, on specific things on an ad-hoc basis, then you'd have to get a reference to the entity, or whatever, and destroy it then replace it with the new thing.
In either case, I'd suggest looking for mods that do similar changes to what you want and then look at how they do it.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
- Solar's Wrath
- Burner Inserter
- Posts: 19
- Joined: Mon Mar 21, 2016 8:09 pm
- Contact:
Re: How to replace an item/building for another
What I mean is like, my mod would remove certain stuff from the Base mod, it would just not be in the game at all and be replaced by my new object/building
- LuziferSenpai
- Filter Inserter
- Posts: 383
- Joined: Tue Jul 08, 2014 10:06 am
- Contact:
Re: How to replace an item/building for another
You mean from Raw Factory right?Solar's Wrath wrote:What I mean is like, my mod would remove certain stuff from the Base mod, it would just not be in the game at all and be replaced by my new object/building
If you want that you need to nil it.
But becareful with it!
- Solar's Wrath
- Burner Inserter
- Posts: 19
- Joined: Mon Mar 21, 2016 8:09 pm
- Contact:
Re: How to replace an item/building for another
But how do you do that? I know how to add stuff but I don't know how to nil stuff. Its kinda my problem at the moment ^^'LuziferSenpai wrote:Solar's Wrath wrote: If you want that you need to nil it.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: How do you replace component of the base mod?
Look in existing mods for anything that alters data.raw, especially in data-final-fixes.lua. The data.raw contains all the prototypes from all the mods, and you can edit, add, delete, stuff in it.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
- LuziferSenpai
- Filter Inserter
- Posts: 383
- Joined: Tue Jul 08, 2014 10:06 am
- Contact:
Re: How do you replace component of the base mod?
This is a older way how i did it.
or
Code: Select all
data.raw["item"][name] = nil
data.raw["recipe"][name] = nil
Code: Select all
data.raw["item"][name] = nil
data.raw['active-defense-equipment'][name] = nil
data.raw["recipe"][name] = nil
data.raw['active-defense-equipment']["basic-electric-discharge-defense-equipment"] = nil
data.raw["capsule"]["basic-electric-discharge-defense-remote"] = nil
data.raw["recipe"]["basic-electric-discharge-defense-remote"] = nil
- Solar's Wrath
- Burner Inserter
- Posts: 19
- Joined: Mon Mar 21, 2016 8:09 pm
- Contact:
Re: How do you replace component of the base mod?
Where is data-final-fixes.lua?aubergine18 wrote:Look in existing mods for anything that alters data.raw, especially in data-final-fixes.lua. The data.raw contains all the prototypes from all the mods, and you can edit, add, delete, stuff in it.
And what is data.raw?
LuziferSenpai
Thanks and if I just want to change the texture of an existing item or the sprite of a building for something else?
- LuziferSenpai
- Filter Inserter
- Posts: 383
- Joined: Tue Jul 08, 2014 10:06 am
- Contact:
Re: How do you replace component of the base mod?
Look for that in my Senpais Overhall MOD in the data-final-fixes. There you see how i did it.Solar's Wrath wrote:Where is data-final-fixes.lua?aubergine18 wrote:Look in existing mods for anything that alters data.raw, especially in data-final-fixes.lua. The data.raw contains all the prototypes from all the mods, and you can edit, add, delete, stuff in it.
And what is data.raw?
LuziferSenpai
Thanks and if I just want to change the texture of an existing item or the sprite of a building for something else?
- Solar's Wrath
- Burner Inserter
- Posts: 19
- Joined: Mon Mar 21, 2016 8:09 pm
- Contact:
Re: How do you replace component of the base mod?
Thanks I'm gonna look this up ^^LuziferSenpai wrote: Look for that in my Senpais Overhall MOD in the data-final-fixes. There you see how i did it.