How do you make something cooler repeatedly?

  • carrots123
    25th Sep 2012 Member 0 Permalink

    For example, an element starts off at 200C

    It then repeatedly takes 1 degree off it.

    Help, anyone?

  • Catelite
    25th Sep 2012 Former Staff 2 Permalink

    Moo replaced by empty text

  • mniip
    25th Sep 2012 Developer 0 Permalink
    @Catelite (View Post)
    considering it is posted in lua section...
  • Catelite
    25th Sep 2012 Former Staff 4 Permalink

    <.<    >.>

    *considers moving it to general section to make self look less silly*

  • boxmein
    25th Sep 2012 Former Staff 0 Permalink
    @carrots123 (View Post)
    local curTemp=0 -- Current temperature of the particle, don't edit this value, nothing will happen
    local changeBy = 1 -- The amount to change by in a single tick. Use negative values for decreasing temperature. Change this if you want to.

    function derp(index, x, y, ss, nt)
    curTemp = tpt.get_property("temp", x, y)
    tpt.set_property("temp", curTemp+changeBy, x, y)
    end
    -- Attaches this behaviour to element GLOW.
    tpt.element_func(derp, tpt.element("glow"))

    To use:
    1. Copy everything red-ish.
    2. Open a suitable plain-text editor, such as Notepad, Notepad++, TextEdit, nano, gvim, vi, gedit, Sublime Text 2. WordPad or Office products aren't plain-text.
    3. Paste the red-ish text into your editor.
    4. Select Save As, and save (Suitable name: "derp.lua") as a "lua" file if you have the option. If not, save as All Files and enter ".lua" to the end manually.
    5. Put the file inside your TPT folder, at the same level to your powder.exe.
    6.
    dofile("derp.lua")