changes to get_property et cetera

  • DerpLord
    25th Jun 2011 Member 0 Permalink
    The wiki happens to be defaced at the moment, but I have a suggestion. The entry for tpt.get_property says it returns an object. Why not simply return a string that we can check it against? if I call tpt.get_property("type",x,y) it should simply return a string containing the type of the particle at (x,y). The same would occur for all properties.
    The main reason I ask for this is that we would have virtually infinite wifi channels, but there are other uses.

    In addition, we should be able to upload a save along with a few lines of optional code, so we can use Lua commands to temporarily tweak the game for our save. When the user saves the creation to disk, the commands would be saved as well.

    I think this would be a great way to encourage all users, not simply the adept ones, to know at least a little bit about the lua console. Please tell me what you think!
  • ief015
    25th Jun 2011 Former Staff 0 Permalink
    Some properties like "x" or "vx" return numbers. So there's multiple types of variables that it returns.
  • JH-Darkfire
    25th Jun 2011 Member 0 Permalink
    If you could upload code to your save, I would bother learning lua.
  • mniip
    25th Jun 2011 Developer 0 Permalink
    @DerpLord (View Post)
    i have a problem becos if there is no particles in (x,y) it returns some strange nums
    shudnt it return 0 in this case?
  • boxmein
    25th Jun 2011 Former Staff 0 Permalink
    @JH-Darkfire (View Post)
    @DerpLord (View Post)
    upload code to your save
    Write lua exploits and viruses, attach to your save, then upload your save.
    @ post below
    Because of the chaos that would happen. You could move the mouse to the upvote button and force click it etc.
    Edited by boxmein, 2011-06-27 16:15:30
  • Thimo
    25th Jun 2011 Banned 0 Permalink
    This post is hidden because the user is banned
  • pilojo
    25th Jun 2011 Member 0 Permalink
    The second they allow lua scripts to be inside of saves. I will not play powdertoy.
  • DerpLord
    25th Jun 2011 Member 0 Permalink
    @boxmein (View Post)

    Uh sorry, but I don't think you can write to files or access things outside of TPT with the console. If you can, the devs' implementation of the console is really poor.

    @pilojo (View Post)

    Why the hell would you do that?


    Edited by DerpLord, 2011-06-26 05:15:21
  • Neospector
    25th Jun 2011 Member 0 Permalink

    DerpLord:

    @boxmein!130589

    Uh sorry, but I don't think you can write to files or access things outside of TPT with the console. If you can, the devs' implementation of the console is really poor.

    @pilojo (View Post)

    Why the hell would you do that?



    You cannot. I believe the directory is limited to the Powder Toy folder.
    He will leave because it might be a cause of viruses. But with all the noobs not knowing how to use Lua and not reading the wiki at all, I highly doubt a virus could be created by anyone who isn't a good guy.
    Edit: And I use "Good guy" lightly there, mods.
    Edited by Neospector, 2011-06-26 05:20:36
  • Pilihp64
    25th Jun 2011 Developer 0 Permalink
    https://powdertoy.co.uk/Discussions/Thread/View.html?Thread=7963
    yes there are possible security issues with lua, this is why you cannot embed scripts into saves.
    I don't know if it could easily be fixed, just read the script before you run it.
    Edited by cracker64, 2011-06-26 05:34:57