Whats wrong?

  • Squirtle
    6th May 2014 Member 0 Permalink
    What is wrong w/ my script? When I try to run it in TPT it says: Helium.lua:22: unexpected symbol near '='
    Any suggestions? I have gone over it like 4 times now...
    http://bpaste.net/show/VP8qgu8aOktm0R2kaEwL/
  • jacob1
    7th May 2014 Developer 0 Permalink
    can you explain what you are trying to do here?
    elements.property(elements.SQRT_PT_BISX, "HighTemperature", 400)
    elements.property(elements.SQRT_PT_BISX, "HighTemperatureTransition", (gravity = -0.5))
    elements.property(elements.SQRT_PT_BISX, "LowTemperature", -150)
    elements.property(elements.SQRT_PT_BISX, "LowTemperatureTransition", (gravity = 0.5))


    I'd like to point out that temperatures are in Kelvin, not celcius, so if you want that to transition at 400C, you need to add 273.15 (use 673.15 instead), same with the negative one. And then for the real error ... using "(gravity = -0.5)" doesn't make any sense. Transitions have almost nothing to do with gravity, instead of "(gravity = -0.5)" you should put the ID of the element you want to transition into. I'd need to know which element you want it to turn into before I tell you what to put :P
  • Squirtle
    7th May 2014 Member 0 Permalink
    I was trying to make it so that when the gas was heated to a certain degree it would rise, and when cooled to a certain degree it would sink. That was my best guess as to what it might be... I feel like a n00b now. :)
    Edited once by Squirtle. Last: 7th May 2014
  • jacob1
    7th May 2014 Developer 0 Permalink
    Well there is a "Gravity" property, but you can't set it based on temperature. The HighTemperatureTransition property is only for things like WATR turning into ICE at a certain temperature.
  • Squirtle
    7th May 2014 Member 0 Permalink
    *clicks tongue* ok then, to be honest i have no idea how to set it. Thus the reason for the thread, lol.
  • greymatter
    7th May 2014 Member 0 Permalink
    @Squirtle (View Post)
    I don't code lua, but if you want to modify the gravity at a certain temperature, there got to be something like

    if(element.temp==xxx)
    {
    gravity=-0.5
    }

    right?
  • jacob1
    7th May 2014 Developer 0 Permalink
    @greymatter (View Post)
    nope :P. Gravity is a per-element thing, not per-particle. You can't have it vary per-particle unless you modify the c++ code.

    You could modify .vy, maybe ...
  • greymatter
    7th May 2014 Member 0 Permalink
    @jacob1 (View Post)
    Alrighty then.