AURL (Aurelium): Error with Lua

  • Gustavo6046
    7th Mar 2015 Member 0 Permalink

    The code:

    local AURL = elements.allocate('CJB', 'AURL')
    elements.element(elements.CJB_PT_AURL, elements.element(elements.DEFAULT_PT_[AURL]))
    elements.property(elements.CJB_PT_AURL, 'Name', 'AURL')
    elements.property(elements.CJB_PT_AURL, 'Description', 'Warm, heavy particles. Generates pressure when heated. Flammable and radioactive. Fissile under pressure
    like PLUT.')
    elements.property(elements.CJB_PT_AURL, 'Color', '0xC9B316')
    elements.property(elements.CJB_PT_AURL, 'MenuSection', '[60461]')
    elements.property(elements.CJB_PT_AURL, 'Gravity', '0.4')
    elements.property(elements.CJB_PT_AURL, 'Flammable', '1')
    elements.property(elements.CJB_PT_AURL, 'Explosive', '0')
    elements.property(elements.CJB_PT_AURL, 'Loss', '0.95')
    elements.property(elements.CJB_PT_AURL, 'AirLoss', '0.99')
    elements.property(elements.CJB_PT_AURL, 'AirDrag', '0.01')
    elements.property(elements.CJB_PT_AURL, 'Advection', '0.4')
    elements.property(elements.CJB_PT_AURL, 'Weight', '65')
    elements.property(elements.CJB_PT_AURL, 'Diffusion', '0')
    elements.property(elements.CJB_PT_AURL, 'Temperature', '330.6')
    elements.property(elements.CJB_PT_AURL, 'HotAir', '0')

    local function AURL(index, partx, party, surround_space, nt)
    if nt > 0 then
    for fx = -1, 1, 1 do
    for fy = -1, 1, 1 do
    if (tpt.get_property('temp', partx + fx, party +fy) < 293.15 then (
    sim.partProperty(index,"pv",tpt.get_property('pv', partx, party)+0.1)))
    end
    end
    end
    end

    The errors: Expected and unexpected symbols.

  • FeynmanLogomaker
    7th Mar 2015 Member 0 Permalink

    This part:

    if (tpt.get_property('temp', partx + fx, party +fy) < 293.15 then (
        sim.partProperty(index,"pv",tpt.get_property('pv', partx, party)+0.1))) 
    end

    should be this:

    if (tpt.get_property('temp', partx + fx, party +fy) < 293.15) then
        sim.partProperty(index,"pv",tpt.get_property('pv', partx, party)+0.1)
    end

     

    You had some parentheses in weird places.

  • Gustavo6046
    7th Mar 2015 Member 0 Permalink

    Also 'end' expected (to close 'function' at line 19) near '<eof>'...

  • DanielGalrito
    8th Mar 2015 Member 0 Permalink

    There must be a end for each "if" , for each "for" and for each function and you need something like this:

    tpt.element_func(Oxyg, tpt.element('oxyg'))

    to tell the function which element it was made for, so:

     

    local AURL = elements.allocate('CJB', 'AURL')
    elements.property(elements.CJB_PT_AURL, 'Name', 'AURL')
    elements.property(elements.CJB_PT_AURL, 'Description', 'Warm, heavy particles. Generates pressure when heated. Flammable and radioactive. Fissile under pressure like PLUT.')
    elements.property(elements.CJB_PT_AURL, 'Color', '0xC9B316')
    elements.property(elements.CJB_PT_AURL, 'MenuSection', '[60461]')
    elements.property(elements.CJB_PT_AURL, 'Gravity', '0.4')
    elements.property(elements.CJB_PT_AURL, 'Flammable', '1')
    elements.property(elements.CJB_PT_AURL, 'Explosive', '0')
    elements.property(elements.CJB_PT_AURL, 'Loss', '0.95')
    elements.property(elements.CJB_PT_AURL, 'AirLoss', '0.99')
    elements.property(elements.CJB_PT_AURL, 'AirDrag', '0.01')
    elements.property(elements.CJB_PT_AURL, 'Advection', '0.4')
    elements.property(elements.CJB_PT_AURL, 'Weight', '65')
    elements.property(elements.CJB_PT_AURL, 'Diffusion', '0')
    elements.property(elements.CJB_PT_AURL, 'Temperature', '330.6')
    elements.property(elements.CJB_PT_AURL, 'HotAir', '0')

    local function AURL(index, partx, party, surround_space, nt)
    if nt > 0 then
    for fx = -1, 1, 1 do
    for fy = -1, 1, 1 do
    if (tpt.get_property('temp', partx + fx, party +fy) < 293.15) then
    sim.partProperty(index,"pv",tpt.get_property('pv', partx, party)+0.1)
    end
    end
    end
    end
    end
    tpt.element_func(AURL, tpt.element('aurl'))

     

    Now you can use the element, but if on the screen a message will say: aurl.txt:22: Particle does not exist.

    I dont understand what the function does.

  • Gustavo6046
    9th Mar 2015 Member 0 Permalink

    Thank you for the help but yeah, line 21: particle does not exist.

    The function should turn temp to pressure (alas simple!), by e.g.:

     (pseudocode)

    if AURL.temp > 293.15 then {

    tpt.pressurize.('0.95');

    tpt.cooldown('1C');

    }

    Also I was planning for an later update where it could mix with WATR to make ARLC, aurelic acid (turns temp into pressure like AURL and corrodes like ACID at a slower rate), which can be boiled into WTRV and BOYL, and also can be heated to turn LAUR (liquid aurelium), which in turn can generate pressure from temp (again, alas!), can be boiled into BOYL and DESL, can be mixed with PSTE to make LBOY (liquid boyle) which is more viscous, have one weaker pressurization effect, can be mixed with WATR to produce ACID, CAUS, LAUR, GAS, DESL, WTRV, ARLC and DUST, and LBOY can be boiled into 2 BOYL and 1 GAS and can mix with OIL to liberate one BOYL, CAUS and GAS while conservating itself and can be mixed with URAN under NEUT influence to generate TBAS (tritium-boyle acidic solution), which has fission power of 5 DEUT particles for each particle, is corrosive and can be mixed with EXOT and ISOZ (or ISZS) to make a powerful blast, 2.5x as powerful as hydrogen fusion, unless stabilized by PROT within 15 frames (which generate HBTR, hyperblaster, one very powerful liquid fuel which is though to be Xan's Hyperblast spaceship fuel).

     Here(by) I seriously need help from Mojang guys! XD

    Edited 3 times by Gustavo6046. Last: 9th Mar 2015
  • DanielGalrito
    9th Mar 2015 Member 0 Permalink

    Ah nice, gonna rewrite the function.

     

    Edit: I said this before you edited your post to add a ton of text :P.

    Edited once by DanielGalrito. Last: 9th Mar 2015
  • Antoine18
    28th Mar 2015 Member 0 Permalink

    @Gustavo6046 (View Post)

    You dont must do: 

    elements.element(elements.CJB_PT_AURL, elements.element(elements.DEFAULT_PT_[AURL]))

    or you have a error!

    Use this: 

    elements.element(elements.CJB_PT_AURL, elements.element(elements.DEFAULT_PT_PLUT))

    This is a solution from your problem!

    Another solution from your error... I see.

    The menu section number 15 or more doesnt exist, use this:

    elements.property(elements.CJB_PT_AURL, 'MenuSection', ---)

    The symbol "---" is the menu section of your element.

    "tpt.pressurize()" doesnt exist. Use this: 

    tpt.set_pressure(x/4, y/4, ---)

    The symbol "---" is what pressure your element throws in function.

    And also "tpt.cooldown()" doesnt exist. Use this: 

    tpt.set_property("temp", tpt.get_property("temp", i) - NUM, i)

    The letters "NUM" is what speed your element cooldowns in function. In inversed version: 

    tpt.set_property("temp", tpt.get_property("temp", i) + NUM, i), heats your element in function.

    Heavy powders have weight of 90 to 99.

    Light powders have also weight of 50 to 80.

    And the medium weight have weight of 80 to 90.

    Edited 3 times by Antoine18. Last: 28th Mar 2015