FG Spreadshirt Swag

Thread: Lost in LUA...

  1. #1

    Lost in LUA...

    Ok. i need some data from within FG that can be used in LUA scripting...

    Path_to_open_campaign

    since FG knows the proper folder to save the campaign to when it /saves there must be an internal global variable to the LUA scripting engine that contains this environment variable. standard LUA script_path() function returns {a nil value}.

    So would this be something in a ruleset script i can find or is it something only internal to the program itself and not accessible to LUA scripts?

    So is there a quick and easy way within FG scripting that i can access this environment variable since it isnt responding to standard LUA io.open globals?

    i checked the refdocs and could find nothing on this.

    if it is in a ruleset or extension already that uses this, then please link me to such so i can find this environment global.

  2. #2
    according to the wiki

    The following standard libraries are NOT available in the FG sandbox

    • io
    • os (except os.clock, os.date, os.time, and os.difftime)
    • debug
    • package

      but i am a noob, not sure if that helps...
    Last edited by madman; November 18th, 2018 at 17:04.
    "Over thinking, over analyzing separates the body from the mind."...MJK... Tool frontman




  3. #3
    right, saw that.

    but FG has to know where to save files otherwise it would not be able to save the correct db.xml in the correct campaign folder.

    is it LUA or FG core that loads a backup session if the db.xml is corrupt? if it is a LUA that does it, then which LUA file does it so i can find the environment variable?

  4. #4
    Not sure if this helps any at all but:

    HKEY_CURRENT_USER\Software\Fantasy Grounds\2.0\DataDir

    Not sure if there is a way to grab that within a extension and/or FG API via lua tho.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  5. #5
    i wouldn't touch the registry with LUA if Doug paid me $100 million for this extension.

Thread Information

Users Browsing this Thread

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
5E Character Create Playlist

Log in

Log in