nonsense errors

  • AlgoPowdo
    5th Oct 2021 Member 0 Permalink

    <name> expected near (

    stupid nonsense errors 

    whole code

    local unobt = elements.allocate("ELEMENT", "UNBT")
    elements.element(unobt, elements.element(elements.DEFAULT_PT_SING))
    elements.property(unobt, "Name", "UNBT")
    elements.property.(unobt, "Description", "Unobtainium, So cold and hardened.")
    elements.property(unobt, "Colour", #231F20)
    elements.property(unobt, "MenuSection", elem.SC_SOLIDS)
    elements.property(unobt, "HotAir", -0.009)
    elements.property(unobt, "Weight", 560)
    elements.property(unobt, "Temperature", -237)
    elements.property(unobt, "HighPressure", 200)
    elements.property(unobt, "HighPressureTransition",
    elements.DEFAULT_PT_ICE)
    number elements.allocate(solid, unobtanium)
    local function graphics1(i, colr, colg, colb)
    return 1,ren.ICE_ADD,255,100,155,210,255,255,255,255
    end
    elements.property(unobt, "Graphics", graphics1)

  • Lord_Bowserinator
    5th Oct 2021 Member 0 Permalink

    @AlgoPowdo (View Post)

     elements.property.(unobt, "Description", "Unobtainium, So cold and hardened.") you have an extra . before

  • AlgoPowdo
    6th Oct 2021 Member 0 Permalink

    @Lord_Bowserinator (View Post)

     malformed number near "231F20"

  • suibian
    6th Oct 2021 Member 0 Permalink

    @AlgoPowdo (View Post)

     Try 0x231F20

  • AlgoPowdo
    6th Oct 2021 Member 0 Permalink

    @suibian (View Post)

     lua:13 : = expected near elements

  • Hecker
    13th Nov 2021 Member 0 Permalink

    Code:

     

    local unobt = elements.allocate("ELEMENT", "UNBT")
    elements.element(unobt, elements.element(elements.DEFAULT_PT_SING))
    elements.property(unobt, "Name", "UNBT")
    elements.property(unobt, "Description", "Unobtainium, So cold and hardened.")
    elements.property(unobt, "Colour", 0x231F20)
    elements.property(unobt, "MenuSection", elem.SC_SOLIDS)
    elements.property(unobt, "HotAir", -0.009)
    elements.property(unobt, "Weight", 560)
    elements.property(unobt, "Temperature", -237)
    elements.property(unobt, "HighPressure", 200)
    elements.property(unobt, "HighPressureTransition",
    elements.DEFAULT_PT_ICE)
    local function graphics1(i, colr, colg, colb)
    return 1,ren.ICE_ADD,255,100,155,210,255,255,255,255
    end
    elements.property(unobt, "Graphics", graphics1)
     
    errors: 
     
     
    number elements.allocate(solid, unobtanium)
    local unobt = elements.allocate("ELEMENT", "UNBT")
    you used elements.allocate twice.
    second
    removing number elements.allocate(solid, unobtanium)
    works 
    third
    to use colors simpy use the hex
    #231F20
    replace the # with 0x
    0x231F20
    Edited once by Hecker. Last: 13th Nov 2021