Help...(Please noone laugh at me)

  • jacob1
    29th Sep 2014 Developer 0 Permalink
    @QuentinADay (View Post)
    I noticed the same thing ):

    Apparently if there is no particle at that position it spams errors. I searched but couldn't find an equivalent function that doesn't error if the space happens to be empty. I'll add one for the next version.

    So either check the type first to make sure there isn't an empty space there (which is annoying to have to do), or use pcall. I did pcall to make it easier ...
  • QuentinADay
    29th Sep 2014 Member 0 Permalink

    so why doesn't it make errors when you use: tpt.get_property("type", x + math.random(-1,1), y + math.random(-1,1) ?

  • jacob1
    29th Sep 2014 Developer 0 Permalink
    @QuentinADay (View Post)
    I guess because it doesn't care if it's an empty space because it can just return 0. Really it's undefined what to return if you check the ctype of nothing ... but 0 should be fine. Or maybe some other method to say the particle doesn't exist besides erroring.
  • jward212
    29th Sep 2014 Member 0 Permalink

    so no type is a value of type and no ctype is no value and not understood if there is no type (x,y)?

  • batman333
    29th Sep 2014 Member 0 Permalink

    Thanks, Also I have another problem,

    Why isn't this working

    elements.property(elements.METAL_PT_BRAS, "HighPressureTransition", elem.METAL_PT_BRSS)

    (Man, I need to refresh my page more often)

     

    Edited 2 times by batman333. Last: 29th Sep 2014
  • jward212
    29th Sep 2014 Member 0 Permalink

    did you set the high pressure with something like this

    elements.property(elements.METAL_PT_BRAS, "HighPressure", #####)

    ##### being the pressure the transition happens

  • batman333
    29th Sep 2014 Member 0 Permalink

    Yes I did (Heres the entire element)

    local BRAS = elements.allocate("METAL", "BRAS")
    elements.element(elements.METAL_PT_BRAS, elements.element

    (elements.DEFAULT_PT_METL))
    elements.property(elements.METAL_PT_BRAS, "Name", "BRAS")
    elements.property(elements.METAL_PT_BRAS, "Description", "Brass, brittle

    metal")
    elements.property(elements.METAL_PT_BRAS, "Colour", 0xFFB46224)
    elements.property(elements.METAL_PT_BRAS, "MenuSection", elem.SC_SOLID)
    elements.property(elements.METAL_PT_BRAS, "MenuVisible", 1)
    elements.property(elements.METAL_PT_BRAS, "Weight", 1000)
    elements.property(elements.METAL_PT_BRAS, "Temperature", 293)
    elements.property(elements.METAL_PT_BRAS, "HeatConduct", 100)
    elements.property(elements.METAL_PT_BRAS, "HighTemperature",1170)
    elements.property(elements.METAL_PT_BRAS, "HighPressure", 5)
    elements.property(elements.METAL_PT_BRAS, "HighPressureTransition",

    elem.METAL_PT_BRSS)

    (funny organiseation because of funny editor)

    Edited once by batman333. Last: 29th Sep 2014
  • jward212
    29th Sep 2014 Member 0 Permalink

    In my fuel mod I think there was a bug where creosote would'nt condense.

    It got so annoying I just wrote a function for it.

    so i'm guessing you added copper, what type of brass is it(zinc,aluminum?)

    Edited once by jward212. Last: 29th Sep 2014
  • batman333
    29th Sep 2014 Member 0 Permalink

    Zinc.

  • jward212
    29th Sep 2014 Member 0 Permalink

    added any other alloys