PF2E Playlist
Page 2 of 2 First 12
  1. #11
    Quote Originally Posted by Varsuuk View Post
    If anyone knows any other cool trace/debug (other than console printing hehe) commands - feel free!

    So I recently learned about Debug.chat() and Debug.console() that can be used instead of print() that gives different information about variables and what is in them. I was constantly getting blank lines for variables that obviously had information in them, but when I switched from print() to Debug.chat() I was able to see what was in them.

  2. #12
    The print function purely outputs a string; so it doesn't know anything about the different variable types in Fantasy Grounds Lua. (And it's the oldest debug function from before my time.)
    The Debug.chat and Debug.console functions are designed to accept any number of parameters, and attempt to output some information on every object type passed as a parameter.

    Also, Debug.printStack will output the current Lua stack at the time the function is called. Useful for figuring out how a particular script function is getting called.

    Regards,
    JPG

  3. #13
    Quote Originally Posted by Moon Wizard View Post
    ...

    Also, Debug.printStack will output the current Lua stack at the time the function is called. Useful for figuring out how a particular script function is getting called.

    Regards,
    JPG
    OMG is it!
    Learning about this from that offhand comment made such a difference in my being able to speedily figure out code

    Thanks for like 3rd or 4th time Trenloe

  4. #14
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    23,865
    Blog Entries
    1
    Ahem... the Moon Wizard is not the AI driven Trenloe.

    MoreCore - Generic Ruleset
    --- Projects ---
    Extensions | Tutorials | MoreCore | MoreCore Themes | Call of Cthulhu | Maelstrom | FG Con

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Fantasy Grounds Fridays Pre

Log in

Log in