Dusts Script

  • gollark8
    29th May 2015 Member 1 Permalink

    Adds in a dust version of any element listed in the 'dconv' table. All properties, excluding falldown, update function, properties property, tab, state, graphics, gravity, name, description and menu visibility are kept the same. The dust versions can be found under 'Powders' and are listed as P (first 3 letters of element name). The P stands for powdered.

    There are a lot of scripts adding dusts, but this one can do it automatically from a list of things to make a dust version of.

    Warning:powdered versions of elements added by mods with high 'weight' property may smash through things.

     

    Code:

     

    tpt.log('Dusts Script running')
    dconv = {'pscn', 'nscn'}
    for i=1,#dconv do
    elname = dconv[i]
    dconv[i] = tpt.element(elname)
    end

    for it=1,#dconv do
    local i = dconv[it]
    if i then
    tpt.log(i .. ' Processed')
    dust = elements.allocate("Dusts", elements.property(i, 'Name') .. 'Dust')
    elements.element(dust, elements.element(i))
    elements.property(dust, "Name",'P' .. string.sub(elements.property(i, 'Name'),1,3))
    elements.property(dust, "Description", 'Powdered ' .. elements.property(i, 'Name'))
    elements.property(dust, "Colour", elements.property(i, 'Color'))
    elements.property(dust, "MenuSection", elements.SC_POWDERS)
    elements.property(dust, "State", elements.ST_SOLID)
    elements.property(dust, "Properties", elements.property(i, 'Properties'))
    elements.property(dust, "MenuVisible", 1)
    elements.property(dust, "Falldown", 1)
    elements.property(dust, "Gravity", 0.3)
    end
    end

    Edited 9 times by gollark8. Last: 30th May 2015
  • EE
    30th May 2015 Banned 0 Permalink
    This post is hidden because the user is banned
    Edited 2 times by EE. Last: 30th May 2015
  • gollark8
    30th May 2015 Member 0 Permalink

    Updated: added property/update function/graphics function properties to the dust elements. Now powdered photons bounce, powdered metal conducts and (illogical) powdered water is blurred if that setting is on.

     

    (well, graphics works, update not so much, Powdered Gravitons don't work sadly)

    Edited 2 times by gollark8. Last: 31st May 2015
  • ChargedCreeper
    31st May 2015 Member 0 Permalink

    Script only adds very glitchy PSCN and NCSN and they cant even be sparked. This was with pasting into autorun on a fresh TPT.

    Edited once by ChargedCreeper. Last: 31st May 2015
  • gollark8
    31st May 2015 Member 0 Permalink

    ChargedCreeper:

    Script only adds very glitchy PSCN and NCSN and they cant even be sparked. This was with pasting into autorun on a fresh TPT.

     I updated it so they are sparkable. However, PPSC and PNSC will not activate INST and similar things. And also this line:

    dconv = {'pscn', 'nscn'}

    If you add extra items into that table, like: dconv = {'pscn','nscn','gold'} the element's powdered version is generated.

    Add the string name of whatever element you want a dust version of, and it'll add it in.

    Edited 2 times by gollark8. Last: 31st May 2015