Making new elements

  • ReallyJustDont
    4th Jun 2020 Member 0 Permalink

    How do I write a function for an element (e.g. Update) in the lua console? Or do I have to write it in a file and compile it somehow?

  • INFINITY-BOI
    5th Jun 2020 Banned 0 Permalink
    This post is hidden because the user is banned
  • jacob1
    5th Jun 2020 Developer 0 Permalink
    First, I recommend using the Script Manager to handle scripts. The easiest way to do this is to put it in a file.

    Create a file scripts/myscript.lua and put the update function in there:
    elem.property(tpt.el.sprk.id, "Update", function(i) sim.partProperty(i, "life", 4) end)

    It's better to write it in a file because it often doesn't fit in the console. Once you have the file, open the script manager and load it.

    The wiki will list all the functions you can use to interact with the particle.
    Edited once by jacob1. Last: 5th Jun 2020