Modifying Default Elements

  • TheAwesomeMutant
    10th Jan 2017 Member 0 Permalink

    In trying to make water more realistic, I tried to set high and low pressure transitions.

    Code:

    elements.property(elements.DEFAULT_PT_WATR,LowPressure,-2)
    elements.property(elements.DEFAULT_PT_WATR,LowPressureTransition,WTRV)
    elements.property(elements.DEFAULT_PT_WATR,HighPressure,150)
    elements.property(elements.DEFAULT_PT_WATR,HighPressureTransition,ICE)

    However, I get this:

    test.lua:1: bad argument #2 to 'property' (string expected, got nil)

    Edited 3 times by TheAwesomeMutant. Last: 10th Jan 2017
  • jacob2
    10th Jan 2017 Member 0 Permalink
    You forgot quotes around the 2nd argument. You should pass in a string, not a non-existent variable called LowPressure
  • TheAwesomeMutant
    10th Jan 2017 Member 0 Permalink

    oh, that worked. for some reason the script doesn't evaporate water till someone presses the frame button. or freeze water, either.

  • jacob2
    10th Jan 2017 Member 0 Permalink
    Oh, for the 3rd argument you also should be using elements.DEFAULT_PT_WTRV or tpt.el.ice.id (whatever format you prefer)
  • TheAwesomeMutant
    10th Jan 2017 Member 0 Permalink

    hmm. still not working.

    Edited once by TheAwesomeMutant. Last: 10th Jan 2017
  • edr-01
    12th Jan 2017 Member 0 Permalink

    You forgot quotes in the variables LowPressure, LowPressureTransition, HighPressure and HighPressureTransition. ICE and WTRV should be elements.DEFAULT_PT_ICE and elements.DEFAULT_PT_WTRV , respectively. Also you forgot place an space between "LowPressure", and -2.

    Edited 2 times by edr-01. Last: 12th Jan 2017
  • jacob1
    12th Jan 2017 Developer 0 Permalink
    @edr-01 (View Post)
    I already said both of those things. And whitespace is irrelevant, all you need is a comma
  • edr-01
    12th Jan 2017 Member 0 Permalink

    I made the changes that @jacob2 suggested. It works fine to me.

    elements.property(elements.DEFAULT_PT_WATR,"LowPressure",-2)
    elements.property(elements.DEFAULT_PT_WATR,"LowPressureTransition",elem.DEFAULT_PT_WTRV)
    elements.property(elements.DEFAULT_PT_WATR,"HighPressure",150)
    elements.property(elements.DEFAULT_PT_WATR,"HighPressureTransition",elem.DEFAULT_PT_ICE)

  • New_man100000
    3rd Feb 2017 Member 0 Permalink

    This may write in console?

  • New_man100000
    19th Apr 2017 Member 0 Permalink

    guys?..