Particles launching brush

  • juh9870
    20th Aug 2017 Member 2 Permalink

    Hi everyone! Recently i played Dust 2 game, and thought: "It will be good if TPT also have special tool that let create particle and accelerate it in deeded direction", so i made a small script that adds new tool to game that create partocle and launches it in particular direction. To use it just press "ALT" and drag from the point you want to spawn particle to direction oposite to particle lauch direction, the farest you drag, the bigger acceleration particle get (Angry birds like).

     

    UPD1 - Fixed this working in zoom mode. Redownload script.

     

    Known bugs:

    • This tool only launches one particle at time
    • This tool doesn't work with some particles and solids(except SPNG, SPNG can fly!)
    • This tool doesn't work in zoom mode FIXED! Redownload the script
    • Changes made by this tool don't writes to UNDO history, in other worlds, you can't undo them

    script

    Question to modders: is there any way to write particles creation to UNDO history?

    I'm creating particles by using simulation.createParts

    Edited 5 times by juh9870. Last: 20th Aug 2017
  • jacob1
    20th Aug 2017 Developer 0 Permalink
    Fun script!

    To fix zoom mode, you can use sim.adjustCoords(x, y) to get the position in zoom coordinates.
  • juh9870
    20th Aug 2017 Member 0 Permalink

    @jacob1 (View Post)

     Oh, i fixed it and chsnged link to pastebin, but is there any way to change code stored in starcatcher?

  • jacob1
    20th Aug 2017 Developer 0 Permalink
    @juh9870 (View Post)
    Yes. And looks like you already figured it out. I'll approve it very soon

    Edit: update approved. You should probably switch the link back to starcatcher now
    Edited 2 times by jacob1. Last: 20th Aug 2017
  • juh9870
    20th Aug 2017 Member 0 Permalink

    @jacob1

    also, is there any API to write/read game state from UNDO history?

     

     

    Edited 2 times by juh9870. Last: 20th Aug 2017
  • jacob1
    20th Aug 2017 Developer 0 Permalink
    @juh9870 (View Post)
    There is no API for that but i'll probably add one in the future
  • docRoboRobert
    20th Aug 2017 Member 0 Permalink

    I like this script too.