I've been trying to make a mod that can modify the rocket animation speed so that it's easier to get neat ratios between it and other science setups. The game continues to throw messages that I have made a syntax error near the '-', but I don't know how to fix it, or why I've messed up.
data.raw.rocket-silo['rocket-silo'].light_blinking_speed = 1/(120)
data.raw.rocket-silo['rocket-silo'].door_opening_speed = 1/(151)
These two are the only lines in the data.lua file that I've created. I have attached both the data.lua and info.json files. I would appreciate some help with this.
Mod syntax error, can't figure out why
-
- Burner Inserter
- Posts: 9
- Joined: Sun Jun 19, 2016 8:15 am
- Contact:
Re: Mod syntax error, can't figure out why
You correctly quoted the second dash but forgot the first.
data.raw['rocket-silo']['rocket-silo']
data.raw['rocket-silo']['rocket-silo']
-
- Burner Inserter
- Posts: 9
- Joined: Sun Jun 19, 2016 8:15 am
- Contact:
Re: Mod syntax error, can't figure out why
It works now, thanks.
Say, is there more than one type of syntax that works for this? I made another mod with the form
data.raw.boiler['heat-exchanger'].target_temperature = 515
data.raw.generator['steam-turbine'].maximum_temperature = 515
and this worked just fine, so I'd like to know what's allowed and not allowed here.
Say, is there more than one type of syntax that works for this? I made another mod with the form
data.raw.boiler['heat-exchanger'].target_temperature = 515
data.raw.generator['steam-turbine'].maximum_temperature = 515
and this worked just fine, so I'd like to know what's allowed and not allowed here.
Re: Mod syntax error, can't figure out why
- is a special character in lua, to use it as a key it needs to be quoted
a.one is the same as a['one']
but
a.two-three has a special character in the key string so it has to be quoted otherwise it tries to subtract a.two and the (possibly nil) variable three. a['two-three']
a.one is the same as a['one']
but
a.two-three has a special character in the key string so it has to be quoted otherwise it tries to subtract a.two and the (possibly nil) variable three. a['two-three']