lua makes me ashamed

  • GreekGuy
    17th Jun 2011 Member 0 Permalink
    if i type in console:

    tpt.register_step tpt.create 25, 25, MERC

    in console i expect it to keep making MERC in the coordinates 25, 25 for every frame but it doesnt and says:

    [string "tpt.register_step tpt.create 25, 25, MERC"]:1: '=' expected near 'tpt'



    WHATS HAPPENING?
  • limelier
    17th Jun 2011 Member 0 Permalink
    I believe it wants tpt.register_step=tpt.create 25, 25, MERC
    Edited by tudoreleuu, 2011-06-15 20:28:48
  • GreekGuy
    17th Jun 2011 Member 0 Permalink
    here let me check


    EDIT: it says unexpected symbol near '25'

    whats wrong
    Edited by GreekGuy, 2011-06-15 20:31:46
  • MasterMind555
    17th Jun 2011 Member 0 Permalink
    @GreekGuy (View Post)
    You forgot the end
  • GreekGuy
    17th Jun 2011 Member 0 Permalink
    what?
  • MasterMind555
    17th Jun 2011 Member 0 Permalink
    @GreekGuy (View Post)
    search for tpt.register_step
    Edited by MasterMind555, 2011-06-15 20:35:10
  • GreekGuy
    17th Jun 2011 Member 0 Permalink
    it says:
    "
    tpt.register_step

    Register a function to be run on every frame
    tpt.register_step(function func) "

    i did that right?
  • MasterMind555
    17th Jun 2011 Member 0 Permalink
    @GreekGuy (View Post)
    I mean in the search bar
    https://powdertoy.co.uk/Discussions/Thread/View.html?Thread=7876

    COUNTLESS Threads about this..
    Edited by MasterMind555, 2011-06-15 20:40:51
  • GreekGuy
    17th Jun 2011 Member 0 Permalink
    whenever i search stuff with the search bar on this website my mac just shows the site loading forever and it never works... so can you tell me some other way?








    ok so how should i write it?

    ???

    tpt.register_step=(tpt.create (25, 25) MERC)

    NOT WORKING OUT!!!
    Edited by GreekGuy, 2011-06-15 20:52:08
  • MasterMind555
    17th Jun 2011 Member 0 Permalink
    From what I've read : In Notepad, write
    function mycode()
    //Code here
    end
    tpt.registerstep(mycode())

    Save at .lua

    Then in the console write : dofile("myfile.lua")

    "mycode" and "myfile" are example names

    And don't write "//" before your code...
    Edited by MasterMind555, 2011-06-15 21:01:25