Search found 5 matches

by iamdanthemanstan
Fri Aug 13, 2021 2:20 am
Forum: Modding help
Topic: Why is my command getting overwritten?
Replies: 2
Views: 1156

Re: Why is my command getting overwritten?


data.raw["character"]["character"].mining_categories = nil

I always use the bracket notation when editing data.raw, it is a helpful reminder to include the type and name.


Thank you that worked. But why did it work? "data.raw.character.mining_categories = nil" was working before I added the ...
by iamdanthemanstan
Thu Aug 12, 2021 7:12 pm
Forum: Modding help
Topic: Why is my command getting overwritten?
Replies: 2
Views: 1156

Why is my command getting overwritten?

I'm very new to this and I was messing around with disabling hand mining. This line below worked fine:
data.raw.character.mining_categories = nil

I was then messing around with adding new ores. I used some code from the Ice Ore mod to add one and it worked fine:
local mod_name = "__test__"
local ...
by iamdanthemanstan
Wed Aug 11, 2021 9:47 pm
Forum: Modding help
Topic: How can I edit every instance of a prototype type?
Replies: 5
Views: 1756

Re: How can I edit every instance of a prototype type?

Big thanks. For anyone coming to this later here is the code that worked per PFQNiet's suggestion.
for name, prototype in pairs (data.raw["recipe"]) do
prototype.enabled = false
if prototype["normal"] then
prototype.normal.enabled = false
prototype.expensive.enabled = false
end
end
by iamdanthemanstan
Wed Aug 11, 2021 8:37 pm
Forum: Modding help
Topic: How can I edit every instance of a prototype type?
Replies: 5
Views: 1756

Re: How can I edit every instance of a prototype type?

Thank you that's very helpful.

I am also trying to disable all recipes. I tried the code below and while it disabled a lot of the recipes it didn't work for all.

for name, prototype in pairs (data.raw["recipe"]) do
prototype.enabled = false
end

Looking through the prototype definitions it ...
by iamdanthemanstan
Wed Aug 11, 2021 7:47 pm
Forum: Modding help
Topic: How can I edit every instance of a prototype type?
Replies: 5
Views: 1756

How can I edit every instance of a prototype type?

I want to disable all the technologies. This: data.raw["technology"]["advanced-electronics"].enabled = "false" works for disabling one random tech but is there a way to do this for all of them without referencing each one specifically. I tried data.raw["technology"][].enabled = "false" and data.raw ...

Go to advanced search