My first Lua element NEON

  • ThunderSt
    1st Aug 2012 Member 0 Permalink

    @plypencil (View Post)

     

    Yea.. maybe air loss is if the element can contain air or not.. makes sence. Specially when airloss to this element is true, and the same element lets air flow.

     

    About the function I don't understand... nah. Theres a command to put properties into stuff, and one of those is 'solid', ''257 #define TYPE_SOLID 0x00004 //4 Solids''.

  • nmd
    1st Aug 2012 Member 0 Permalink

    @mrsalit0s (View Post)

    Well done. Thats pretty epic.

  • jacksonmj
    1st Aug 2012 Developer 0 Permalink
    The effects of advection, airloss, and various other variables are described in the wiki: https://powdertoy.co.uk/Wiki/W/Coding-tutorial.html.
  • ThunderSt
    1st Aug 2012 Member 0 Permalink

    @jacksonmj (View Post)

     

    Thank you, but whats with ''type=tpt.get_property("ctype",x+math.random(-1,1),y+math.random(-1,1))'' ?

  • boxmein
    2nd Aug 2012 Former Staff 0 Permalink
    @ThunderSt (View Post)
    This one gets the ctype from a random pixel around the center (x, y)
  • Plutonium84
    2nd Aug 2012 Member 0 Permalink
    This Element is partially contrast to the element neon, so no wonder you called that element neon and this is perfectly great creation!
  • ThunderSt
    2nd Aug 2012 Member 0 Permalink

    @boxmein (View Post)

     

    Clone doesn't have it, does it?

     

    Because apparently it only gets fully ctyped into an element because the element spreads on its surface..

  • mrsalit0s
    2nd Aug 2012 Member 0 Permalink

    wow :D thanks to everyone for the positive feedback! thats really motivating to make more elements with Lua.

    added some colours and a graphics function btw

  • ultibore
    4th Aug 2012 Member 0 Permalink

    I made an adaptation of your neon element: largely the same, neongraph has been removed( it gave errors so I dumped it) and if you give neon a tmp value of seven of above , it wil keep a specific color for that tmp, when you recolor your neon, it will relight in that color

     

    ( it works like this if a neon with tmp seven or above doves, the light color of every neon of that tmp is set to that color, if different from base color (allows some cool scroll effects too!))

     

    It works perfect for tmp7, but sometimes it acts a bit sturdy for tmp 8 and above ( after being sparked not recoloring) but if you recolor it after sparking, it should work as described.

     

    would you mind if I posted it? (please reply)

  • mniip
    4th Aug 2012 Developer 0 Permalink
    interesting
    but you could make source abit smaller, cleaner and understandable
    style is mostly ok, implementation ok too