if statement syntax

Place to get help with not working mods / modding interface.
Post Reply
Bizobinator
Fast Inserter
Fast Inserter
Posts: 193
Joined: Fri May 06, 2016 10:35 pm
Contact:

if statement syntax

Post by Bizobinator »

I'm adding some recipes into a mod of mine that are dependent on stuff in another persons' mod(s). I'm getting an error though on my if statements that check before adding a recipe

Code: Select all

if data.raw.fluid["lithia-water"] then
	
		{
			type = recipe,
			name = "void-lithia-water",
			category = "void-liquid",
		  (etc, etc)	
end
Is there something wrong with my syntax? Does the if statement have to be outside of the

Code: Select all

data:extend
?

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: if statement syntax

Post by prg »

Bizobinator wrote:Is there something wrong with my syntax? Does the if statement have to be outside of the

Code: Select all

data:extend
?
Yes.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

Bizobinator
Fast Inserter
Fast Inserter
Posts: 193
Joined: Fri May 06, 2016 10:35 pm
Contact:

Re: if statement syntax

Post by Bizobinator »

prg wrote:
Bizobinator wrote:Is there something wrong with my syntax? Does the if statement have to be outside of the

Code: Select all

data:extend
?
Yes.
Rats :P

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: if statement syntax

Post by Nexela »

Rats how?

Code: Select all

if data.raw.fluid["lithia-water"] then
   
data:extend{
    {
         type = recipe,
         name = "void-lithia-water",
         category = "void-liquid",
        (etc, etc) 
    }
}  
end

Post Reply

Return to “Modding help”