Page 1 of 1

fast_replaceable_group

Posted: Mon Sep 30, 2013 9:56 am
by Nirahiel
Hi, I'd like to know if there is a way to add a fast_replaceable_group = "whatever" to any existing entity ingame ?
If so, how do I do that exactly in my mod ?
Thanks :)

Re: fast_replaceable_group

Posted: Mon Sep 30, 2013 2:13 pm
by ficolas
I think that you can put anything you want there, just by putting it, so you could put as fast repaceable group "wall" in all your wall entities.

Re: fast_replaceable_group

Posted: Mon Sep 30, 2013 2:27 pm
by Nirahiel
Yeah and you don't get it, i want to put it for vanilla walls as well.

Re: fast_replaceable_group

Posted: Mon Sep 30, 2013 2:32 pm
by ficolas
Then you need to edit data.raw.wall.fast_replaceable_group, to be "wall", and when doing this, you also need to make your mod need the basa to be loaded first (in info.json I think)

Re: fast_replaceable_group

Posted: Mon Sep 30, 2013 2:40 pm
by rk84
two "wall". type and name is same for base mod wall.

Code: Select all

data.raw.wall.wall.fast_replaceable_group = "walls"
and yea you need to add dependencies to info.json

Code: Select all

"dependencies": ["base"]

Re: fast_replaceable_group

Posted: Mon Sep 30, 2013 2:56 pm
by Nirahiel
rk84 wrote:

Code: Select all

data.raw.wall.wall.fast_replaceable_group = "walls"
Where do I put this code ? :)

Re: fast_replaceable_group

Posted: Mon Sep 30, 2013 3:22 pm
by FreeER
Nirahiel wrote:
rk84 wrote:

Code: Select all

data.raw.wall.wall.fast_replaceable_group = "walls"
Where do I put this code ? :)
data.raw 'commands' need to be in a prototype lua file, or as I always did, placed at the end of your data.lua (which typically calls require for all of the other prototypes).

Re: fast_replaceable_group

Posted: Mon Sep 30, 2013 3:24 pm
by rk84
Nirahiel wrote:
rk84 wrote:

Code: Select all

data.raw.wall.wall.fast_replaceable_group = "walls"
Where do I put this code ? :)
You can put it in data.lua file or any file that you require in data.lua. Example

Code: Select all

--data.lua
require("base-edits")

Code: Select all

--base-edits.lua
data.raw.wall.wall.fast_replaceable_group = "walls"
edit:These files are placed in mod's folder

Re: fast_replaceable_group

Posted: Mon Sep 30, 2013 3:34 pm
by Nirahiel
Okay :)
Well i'm gonna try and see how it works, if it's working the way I want, i'll update Industrio :)