Script goes into infinite yield

  • CloverUTY
    28th Feb 2023 Member 0 Permalink

    There seems to be no reason for it??

     

    The script is so big I can't post the whole thing in here or else the Forums will implode


    elem.allocate("CARAMEL", "CRML")

    elem.element(elem.CARAMEL_PT_CRML, elem.element(elem.DEFAULT_PT_DMND))



    elem.property(elem.CARAMEL_PT_CRML, "Name", "CRML")

    elem.property(elem.CARAMEL_PT_CRML, "Description", "Caramel, Deplaceable Solid that cannot hold any elements, Don't burn it.")

    elem.property(elem.CARAMEL_PT_CRML, "Colour", 0xb07e19)

    elem.property(elem.CARAMEL_PT_CRML, "MenuVisible", 1)

    elem.property(elem.CARAMEL_PT_CRML, "MenuSection", elem.SC_SOLIDS)



    elem.property(elem.CARAMEL_PT_CRML, "Advection", 0)

    elem.property(elem.CARAMEL_PT_CRML, "AirDrag", 0)

    elem.property(elem.CARAMEL_PT_CRML, "AirLoss", 0)

    elem.property(elem.CARAMEL_PT_CRML, "Loss", 0)

    elem.property(elem.CARAMEL_PT_CRML, "Collision", 0)

    elem.property(elem.CARAMEL_PT_CRML, "Gravity", 0)

    elem.property(elem.CARAMEL_PT_CRML, "Diffusion", 0)

    elem.property(elem.CARAMEL_PT_CRML, "HotAir", 0)



    elem.property(elem.CARAMEL_PT_CRML, "Explosive", 0)

    elem.property(elem.CARAMEL_PT_CRML, "Flammable", 3)

    elem.property(elem.CARAMEL_PT_CRML, "Hardness", 30)

    elem.property(elem.CARAMEL_PT_CRML, "Meltable", 0)

    elem.property(elem.CARAMEL_PT_CRML, "Weight", 0)



    elem.property(elem.CARAMEL_PT_CRML, "HeatConduct", 70)

    elem.property(elem.CARAMEL_PT_CRML, "Temperature", 295.15)



    elem.property(elem.CARAMEL_PT_CRML, "Falldown", 0)

    elem.property(elem.CARAMEL_PT_CRML, "State", elem.ST_SOLID)

    elem.property(elem.CARAMEL_PT_CRML, "Properties", elem.TYPE_SOLID)



    elem.property(elem.CARAMEL_PT_CRML, "LowPressure", IPL)

    elem.property(elem.CARAMEL_PT_CRML, "LowPressureTransition", NT)

    elem.property(elem.CARAMEL_PT_CRML, "HighPressure", IPH)

    elem.property(elem.CARAMEL_PT_CRML, "HighPressureTransition", NT)

    elem.property(elem.CARAMEL_PT_CRML, "LowTemperature", ITL)

    elem.property(elem.CARAMEL_PT_CRML, "LowTemperatureTransition", NT)

    elem.property(elem.CARAMEL_PT_CRML, "HighTemperature", 500)

    elem.property(elem.CARAMEL_PT_CRML, "HighTemperatureTransition", elem.CXI_PT_ACLD)

    elem.allocate("S", "SGRC")


    elem.element(elem.S_PT_SGRC, elem.element(elem.DEFAULT_PT_DMND))


    elem.property(elem.S_PT_SGRC, "Name", "SGRC")

    elem.property(elem.S_PT_SGRC, "Description", "Sugar Cube, Solid version of SUGR")

    elem.property(elem.S_PT_SGRC, "Colour", 0xd9d9d9)

    elem.property(elem.S_PT_SGRC, "MenuVisible", 1)

    elem.property(elem.S_PT_SGRC, "MenuSection", elem.SC_SOLIDS)



    elem.property(elem.S_PT_SGRC, "Advection", 0)

    elem.property(elem.S_PT_SGRC, "AirDrag", 0.0)

    elem.property(elem.S_PT_SGRC, "AirLoss", 0)

    elem.property(elem.S_PT_SGRC, "Loss", 0)

    elem.property(elem.S_PT_SGRC, "Collision", 0)

    elem.property(elem.S_PT_SGRC, "Gravity", 0)

    elem.property(elem.S_PT_SGRC, "Diffusion", 0)

    elem.property(elem.S_PT_SGRC, "HotAir", 0)



    elem.property(elem.S_PT_SGRC, "Explosive", 0)

    elem.property(elem.S_PT_SGRC, "Flammable", 15)

    elem.property(elem.S_PT_SGRC, "Hardness", 30)

    elem.property(elem.S_PT_SGRC, "Meltable", 0)

    elem.property(elem.S_PT_SGRC, "Weight", 100)



    elem.property(elem.S_PT_SGRC, "HeatConduct", 70)

    elem.property(elem.S_PT_SGRC, "Temperature", 295.15)



    elem.property(elem.S_PT_SGRC, "Falldown", 0)

    elem.property(elem.S_PT_SGRC, "State", elem.ST_SOLID)

    elem.property(elem.S_PT_SGRC, "Properties", elem.TYPE_PART)



    elem.property(elem.S_PT_SGRC, "LowPressure", IPL)

    elem.property(elem.S_PT_SGRC, "LowPressureTransition", NT)

    elem.property(elem.S_PT_SGRC, "HighPressure", IPH)

    elem.property(elem.S_PT_SGRC, "HighPressureTransition", NT)

    elem.property(elem.S_PT_SGRC, "LowTemperature", ITL)

    elem.property(elem.S_PT_SGRC, "LowTemperatureTransition", NT)

    elem.property(elem.S_PT_SGRC, "HighTemperature", 443.15)

    elem.property(elem.S_PT_SGRC, "HighTemperatureTransition", elem.CARAMEL_PT_CRML)

    elem.allocate("S", "SUGR")

    elem.element(elem.S_PT_SUGR, elem.element(elem.DEFAULT_PT_DMND))

    elem.property(elem.S_PT_SUGR, "Name", "SUGR")

    elem.property(elem.S_PT_SUGR, "Description", "Sugar, Heat it up to caramelize. Don't burn it.")

    elem.property(elem.S_PT_SUGR, "Colour", 0xd9d9d9)

    elem.property(elem.S_PT_SUGR, "MenuVisible", 1)

    elem.property(elem.S_PT_SUGR, "MenuSection", elem.SC_POWDERS)



    elem.property(elem.S_PT_SUGR, "Advection", 0.7)

    elem.property(elem.S_PT_SUGR, "AirDrag", 0.002)

    elem.property(elem.S_PT_SUGR, "AirLoss", 0.96)

    elem.property(elem.S_PT_SUGR, "Loss", 0.9)

    elem.property(elem.S_PT_SUGR, "Collision", 0.4)

    elem.property(elem.S_PT_SUGR, "Gravity", 0.1)

    elem.property(elem.S_PT_SUGR, "Diffusion", 0)

    elem.property(elem.S_PT_SUGR, "HotAir", 0)



    elem.property(elem.S_PT_SUGR, "Explosive", 0)

    elem.property(elem.S_PT_SUGR, "Flammable", 15)

    elem.property(elem.S_PT_SUGR, "Hardness", 30)

    elem.property(elem.S_PT_SUGR, "Meltable", 0)

    elem.property(elem.S_PT_SUGR, "Weight", 85)



    elem.property(elem.S_PT_SUGR, "HeatConduct", 70)

    elem.property(elem.S_PT_SUGR, "Temperature", 295.15)



    elem.property(elem.S_PT_SUGR, "Falldown", 1)

    elem.property(elem.S_PT_SUGR, "State", elem.ST_SOLID)

    elem.property(elem.S_PT_SUGR, "Properties", elem.TYPE_PART)



    elem.property(elem.S_PT_SUGR, "LowPressure", IPL)

    elem.property(elem.S_PT_SUGR, "LowPressureTransition", NT)

    elem.property(elem.S_PT_SUGR, "HighPressure", 65)

    elem.property(elem.S_PT_SUGR, "HighPressureTransition", elem.S_PT_SGRC)

    elem.property(elem.S_PT_SUGR, "LowTemperature", ITL)

    elem.property(elem.S_PT_SUGR, "LowTemperatureTransition", NT)

    elem.property(elem.S_PT_SUGR, "HighTemperature", 443.15)

    elem.property(elem.S_PT_SUGR, "HighTemperatureTransition", elem.CARAMEL_PT_CRML)



    elem.allocate("DANGER", "WEIRD")

    elem.element(elem.DANGER_PT_WEIRD, elem.element(elem.DEFAULT_PT_DMND))



    elem.property(elem.DANGER_PT_WEIRD, "Name", "WEIRD")

    elem.property(elem.DANGER_PT_WEIRD, "Description", "Weird element, A solid that diffuses into it's surroundings. Vanishes when touching ACID and other odd reactions")

    elem.property(elem.DANGER_PT_WEIRD, "Colour", 0x893f45)

    elem.property(elem.DANGER_PT_WEIRD, "MenuVisible", 1)

    elem.property(elem.DANGER_PT_WEIRD, "MenuSection", elem.SC_SOLIDS)



    elem.property(elem.DANGER_PT_WEIRD, "Advection", 0.0015)

    elem.property(elem.DANGER_PT_WEIRD, "AirDrag", 0)

    elem.property(elem.DANGER_PT_WEIRD, "AirLoss", 0.9)

    elem.property(elem.DANGER_PT_WEIRD, "Loss", 0)

    elem.property(elem.DANGER_PT_WEIRD, "Collision", 0)

    elem.property(elem.DANGER_PT_WEIRD, "Gravity", 0)

    elem.property(elem.DANGER_PT_WEIRD, "Diffusion", 0.1)

    elem.property(elem.DANGER_PT_WEIRD, "HotAir", 0)



    elem.property(elem.DANGER_PT_WEIRD, "Explosive", 1)

    elem.property(elem.DANGER_PT_WEIRD, "Flammable", 50)

    elem.property(elem.DANGER_PT_WEIRD, "Hardness", 9000)

    elem.property(elem.DANGER_PT_WEIRD, "Meltable", 0)

    elem.property(elem.DANGER_PT_WEIRD, "Weight", 100)



    elem.property(elem.DANGER_PT_WEIRD, "HeatConduct", 186)

    elem.property(elem.DANGER_PT_WEIRD, "Temperature", 295.15)



    elem.property(elem.DANGER_PT_WEIRD, "Falldown", 0)

    elem.property(elem.DANGER_PT_WEIRD, "State", elem.ST_SOLID)

    elem.property(elem.DANGER_PT_WEIRD, "Properties", elem.TYPE_SOLID, elem.PROP_DEADLY, elem.PROP_NEUTPASS, elem.PROP_BLACK, elem.PROP_LIFE_DEC, elem.PROP_LIFE_KILL_DEC)



    elem.property(elem.DANGER_PT_WEIRD, "LowPressure", IPL)

    elem.property(elem.DANGER_PT_WEIRD, "LowPressureTransition", NT)

    elem.property(elem.DANGER_PT_WEIRD, "HighPressure", IPH)

    elem.property(elem.DANGER_PT_WEIRD, "HighPressureTransition", NT)

    elem.property(elem.DANGER_PT_WEIRD, "LowTemperature", ITL)

    elem.property(elem.DANGER_PT_WEIRD, "LowTemperatureTransition", NT)

    elem.property(elem.DANGER_PT_WEIRD, "HighTemperature", ITH)

    elem.property(elem.DANGER_PT_WEIRD, "HighTemperatureTransition", NT)




    function WEIRD_Update(i, x, y, ss, nt)
        local eltemp = tpt.get_property("temp", i)

        if nt == 8 then
            sim.partProperty(i, "temp", eltemp-0.5)
            if eltemp < 190 then
                sim.partProperty(i, "temp", eltemp-7)
            end
            if eltemp < 5 then
                tpt.set_property("type", "NONE", i)
            end
        else
            if eltemp < 295.15 then
                sim.partProperty(i, "temp", eltemp+3)
            end

            sim.partProperty(i, "life", 2500)
        end
        sim.partProperty(i, "tmp", eltemp)
        sim.partProperty(i, "tmp2", eltemp)
    end

    elements.property(elem.DANGER_PT_WEIRD, "Update", WEIRD_Update)



    function WEIRD_Graphics(i, colr, colg, colb)

        -- i: particle index

        -- colr, colg, colb: color red, green, and blue channels



        -- return cache, pixel mode,

        --        alpha, red, green, blue,

        --        fire alpha, fire red, fire green, fire blue

        return 1, 0x0000001, 255, colr, colg, colb, 0, 0, 0, 0

    end