Can't set the Ctype and tmp with lua

  • gs_115
    11th Aug 2020 Member 0 Permalink

    hi ,

    I recently learned how to make a snow bomb, all you have to do is put snow, put your Ctype to "sing" and set your tmp to 70. I tried to add it to one of my bombs, the script can place snow but don't want to change Ctype and tmp property. and no error is reported.

  • LBPHacker
    11th Aug 2020 Developer 0 Permalink
    No code, can't help. If you feel like posting code, use pastebin.
    Edited 2 times by LBPHacker. Last: 11th Aug 2020
  • gs_115
    11th Aug 2020 Member 0 Permalink

    here the script : https://pastebin.com/7CLJyc2K 

    don't pay attention to some variable name :/

    Edited once by gs_115. Last: 11th Aug 2020
  • LBPHacker
    11th Aug 2020 Developer 1 Permalink
    Well, you seem to be offsetting the coordinates of the call you pass to tpt.create by u and i but not those you pass to tpt.set_property. As a result, only the particle at (x, y) will get the properties assigned to it.
  • gs_115
    11th Aug 2020 Member 0 Permalink

     thank you :/, sometime some small mistake like this can make a script don't work at all 

  • LBPHacker
    11th Aug 2020 Developer 0 Permalink
    Yeah. A good way to avoid mistakes like this is to use the particle ID returned by tpt.create instead of coordinates (which may not even give you the particle you want, since multiple particles may be on top of one another). Also, you should use the new API, sim.*