Tools

  • DanielsRevenge
    21st Jul 2021 Member 0 Permalink

    How would one go about making lua tools? I personally want to create a tool that, whenever you click on an element, tells you its ID.

  • LBPHacker
    21st Jul 2021 Developer 0 Permalink
    There's currently no API for tools, so you have to resort to hacks. How straightforward these hacks are depends on how complex a tool you have in mind. Yours is not too complex, the abstract would be: register an element, put it in the tools section, then register a mousedown event handler that checks if tpt.selectedl (or selecteda or selectedr, depending on the button parameter of the event) is the element's identifier, and if it is, print(sim.partID(sim.adjustCoords(tpt.mousex, tpt.mousey))), then return true to prevent the element from being drawn.
  • Hecker
    6th Aug 2022 Member 0 Permalink

    @DanielsRevenge (View Post)

     I made a tool using custom graphics that made the particle invisible and thats it, if you want try setting a life value and use properties to kill it after its life runs out then in that particles loop you could grab the id of the nearest particle