Results 1 to 4 of 4

Thread: "Execute Lua Code" Editing outside of NRD?

  1. #1
    Join Date
    Nov 2005
    Location
    Redditch, UK
    Posts
    957

    Default "Execute Lua Code" Editing outside of NRD?

    Is there any way to edit the lua attached to the action "Execute Lua Code" outside of NRD and link it back to the button. I know you can externally edit the System lua code as it's the same name as the ccf but with the lua extension.

    Using that tiny unsizable text entry box is a pain to say the least.

  2. #2
    Join Date
    Mar 2006
    Location
    Sydney, Australia
    Posts
    787

    Default

    Quote Originally Posted by NeoMorph View Post
    Is there any way to edit the lua attached to the action "Execute Lua Code" outside of NRD and link it back to the button.
    There most certainly is.

    In your ccf's .lua file create your Lua code as a function like
    Code:
    function myfirstfunc(var1,var2)
      print('button pressed')
    end
    then on the button itself simply put the line
    Code:
    myfirstfunc('var1', 'var2')
    now when you press the button you should see the line 'button pressed' in your Lua console.
    Remember if your function will manipulate the button it is executed from or a parent of that button you should use execute on release.
    Hope that helps
    Dan
    XP + G4 + Lua = :)

  3. #3
    Join Date
    Nov 2005
    Location
    Redditch, UK
    Posts
    957

    Default

    Cheers Dan... That's what I was looking for.

    Unfortunately at the moment NR is refusing to load so I can't try anything.

    I swear I'm jinxed!

  4. #4
    Join Date
    Mar 2006
    Location
    Sydney, Australia
    Posts
    787

    Default

    sometimes if it does that, you can just delete (or rename) the currently loaded .ccf file then re-open NR, it should ask you to specify a new .ccf and your away.
    Cheers
    Dan
    XP + G4 + Lua = :)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •