I'd like to retrieve some fluid information: kj/degree, max temp, default temp.
I can kinda work around the max temp and default temp using a 'fake' fluid box. (Create pipe, set the fluidbox type to be the fluid I want, set it on the pipe, read it back from the pipe. Set temp to something nuts like 99999, set it on the pipe, read it back.)
So far, I've no workaround to get kj/degree though.
Is it possible to access fluid prototypes?
Re: Is it possible to access fluid prototypes?
Something like this works, but it's less than ideal.starholme wrote:I'd like to retrieve some fluid information: kj/degree, max temp, default temp.
I can kinda work around the max temp and default temp using a 'fake' fluid box. (Create pipe, set the fluidbox type to be the fluid I want, set it on the pipe, read it back from the pipe. Set temp to something nuts like 99999, set it on the pipe, read it back.)
So far, I've no workaround to get kj/degree though.
Code: Select all
if entity.fluidbox[1].type == "water" then
maxTemp = 100
minTemp = 15
heatCapacity1 = 1
end
Re: Is it possible to access fluid prototypes?
Sorry, but I'm trying to get the values for heat capacity, without have to hardcode them(to keep other mods compatible easily)
Re: Is it possible to access fluid prototypes?
can test with very high values, like
["pipe"].fluidbox[1] = {type = "water", amount = 100, temperature = 20000}
if ["pipe"].fluidbox[1].temperature < 20000 then
myvarofpipe.maxtemperature = ["pipe"].fluidbox[1].temperature
end
["pipe"].fluidbox[1] = {type = "water", amount = 100, temperature = -20000}
if ["pipe"].fluidbox[1].temperature > -20000 then
myvarofpipe.mintemperature = ["pipe"].fluidbox[1].temperature
end
... i'm lazy.
["pipe"].fluidbox[1] = {type = "water", amount = 100, temperature = 20000}
if ["pipe"].fluidbox[1].temperature < 20000 then
myvarofpipe.maxtemperature = ["pipe"].fluidbox[1].temperature
end
["pipe"].fluidbox[1] = {type = "water", amount = 100, temperature = -20000}
if ["pipe"].fluidbox[1].temperature > -20000 then
myvarofpipe.mintemperature = ["pipe"].fluidbox[1].temperature
end
... i'm lazy.
Re: Is it possible to access fluid prototypes?
Thanks Kexik, I think that will do what I need. I'll reply back and let you guys know once I have a chance to try it.