Page 1 of 1
How do you replace component of the base mod?
Posted: Mon Sep 05, 2016 7:49 am
by Solar's Wrath
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 ^^
Re: How to replace an item/building for another
Posted: Mon Sep 05, 2016 10:41 am
by aubergine18
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.
Re: How to replace an item/building for another
Posted: Mon Sep 05, 2016 12:16 pm
by Solar's Wrath
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
Re: How to replace an item/building for another
Posted: Mon Sep 05, 2016 3:01 pm
by LuziferSenpai
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
You mean from Raw Factory right?
If you want that you need to nil it.
But becareful with it!
Re: How to replace an item/building for another
Posted: Mon Sep 05, 2016 3:06 pm
by Solar's Wrath
LuziferSenpai wrote:Solar's Wrath wrote:
If you want that you need to nil it.
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 ^^'
Re: How do you replace component of the base mod?
Posted: Mon Sep 05, 2016 3:12 pm
by aubergine18
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.
Re: How do you replace component of the base mod?
Posted: Mon Sep 05, 2016 3:18 pm
by LuziferSenpai
This is a older way how i did it.
Code: Select all
data.raw["item"][name] = nil
data.raw["recipe"][name] = nil
or
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
Re: How do you replace component of the base mod?
Posted: Mon Sep 05, 2016 3:42 pm
by Solar's Wrath
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.
Where is data-final-fixes.lua?
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?
Re: How do you replace component of the base mod?
Posted: Mon Sep 05, 2016 3:45 pm
by LuziferSenpai
Solar's Wrath wrote: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.
Where is data-final-fixes.lua?
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?
Look for that in my Senpais Overhall MOD in the data-final-fixes. There you see how i did it.
Re: How do you replace component of the base mod?
Posted: Mon Sep 05, 2016 3:56 pm
by Solar's Wrath
LuziferSenpai wrote:
Look for that in my Senpais Overhall MOD in the data-final-fixes. There you see how i did it.
Thanks I'm gonna look this up ^^