PF2E Playlist
  1. #1

    Does FG deal with sytem variables?

    So I have a big project that I am working on that has 3 major components. a FGU extension is the last one I need to make, then I can fold all of them together into one working ecosystem.

    I've read over some tutorials, and I have a good idea of what I need to do.

    However, I have one question about filesystem locations (for example DB.export) can I use can I use os.getEnv to pull the home directory or can I use system variables like %localappdata%\Exports for my default value.

    The idea here is there will be a text box that can be edited to specify where we are exporting our character data and combat tracker data from the database.

    Thats all I need this extension to do, as the local server then does all the operations from there after it detects the files were updated.

    Lastly, is stringfield my best option for this when I register the option?

  2. #2
    pindercarl's Avatar
    Join Date
    Jan 2015
    Blog Entries

    Maybe try dialogFileSave

    You may want to look at the API function dialogFileSave. This should pop-up a file save dialog box. You can find sample usage in CoreRPG if you search for the function name. For example, from manager_campaigndata.lua:

    function exportChar(nodeChar)
    	sExportRecordType = "charsheet";
    	if nodeChar then
    		sExportRecordPath = DB.getPath(nodeChar);
    		sExportRecordPath = "";
    	if UtilityManager.isClientFGU() then
    		local sFile = Interface.dialogFileSave();
    		if sFile then
    			CampaignDataManager.onExportFileSelection("ok", sFile);

  3. #3
    Thanks for that.

    I found the File.openTextFile and the get functions for the data and campaign folders so that will do what I want.

    Tomorrow I will finish up with the handler callback function for when that value is changed.

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
SWADE Playlist

Log in

Log in