SWADE Playlist
Page 1 of 2 12 Last
  1. #1

    Where to find information on all APIs and functions usable for custom FG coding?

    While developing in lua within FG, besides googling, extracting and digging through modules and extensions to see sample code I've found these two resources.

    http://www.fantasygrounds.com/refdoc/
    http://www.fantasygrounds.com/wiki/i...eveloper_Guide

    While they are good they still seem to miss a large amount of more specific information on various functions and API calls within FG that are available.

    As just one example the, OptionsManager (ex OptionsManager.addOptionValue()) function. Found this in a reply to a forum question some years back, "OptionsManager.isOption(<option name>, <option value>) or OptionsManager.getOption(<option name>)". Found calls to this in CoreRPG.pak\scripts\data_options_core.lua, but so far been unable to find the original source of this information.
    That's just one example of course, but there are any number of functions or calls such as those, and as I can't exactly walk/step through the code during execution to trace the source and keep an eye on the variables during the process it leads me to the following questions.

    Is there some other document source I'm missing that details all of these?
    Or do I need to search for them manually in for example the CoreRPG.pak and do my best to guess the parameters and make sense of them from there?
    Are some of these encrypted away in the data\vault, if so how do I find these details if there?
    How do I find the pipeline of function calls?

    In other words, where/how do I find out what purpose, parameters, return values etc. all the inbuilt FG functions have?
    Last edited by Styrmir; January 4th, 2019 at 10:30.
    Extension writer, FGU Backer, Ultimate License holder.

    5E Enhancer (limited support for FGU)

    Combat Enhancer 5E Classic (no longer officially supported)

    ps. Do not send PM's for support for the extensions I write, I will not not be able to respond there. Use the relevant forum threads instead so the community can benefit from the replies, thank you.



  2. #2
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    21,260
    Blog Entries
    1
    https://www.fantasygrounds.com/refdoc/ and examples in other rulesets is what I use.

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

  3. #3
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    10,656
    Blog Entries
    9
    In short, you have already found the two best sources. There is no complete and comprehensive documentation. I believe you can also look at some online LUA documentation, but I don't remember which version of LUA FG uses. Other than that, search the forums here, especially the Workshop, and ask when you have questions.

  4. #4

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,086
    The best thing is to study corerpg ruleset. Look at the scripts directory. All the managers are in there. Look at the base.xml and it will show you the manager names and the associated script file.

  5. #5
    You found the weakest part of FG
    The past is a rudder to guide us, not an anchor to hold us back.

  6. #6
    It seems I'm on the right track in that case. I'll keep digging into the CoreRPG code, other extensions and the reference documents.

    Thank you all for your replies, I appreciate them.
    Last edited by Styrmir; January 5th, 2019 at 04:00.
    Extension writer, FGU Backer, Ultimate License holder.

    5E Enhancer (limited support for FGU)

    Combat Enhancer 5E Classic (no longer officially supported)

    ps. Do not send PM's for support for the extensions I write, I will not not be able to respond there. Use the relevant forum threads instead so the community can benefit from the replies, thank you.



  7. #7

    Join Date
    Jun 2013
    Location
    Isanti, MN
    Posts
    2,903
    Quote Originally Posted by Styrmir View Post
    In other words, where/how do I find out what purpose, parameters, return values etc. all the inbuilt FG functions have?
    You would look in base.xml to see what script file is being pointed to by the name "OptionsManager" ("scripts/manager_options.lua") and then go find the function "isOption" in that file.

  8. #8
    Is there a way to determine what diagonal distance has been selected in the options,
    IE Standard, Variant, Raw

    From in code of course.

  9. #9
    I believe it is defined in the gameelements.xml under the distance tag.
    How to provide an Unity Connection issue?-Connection Issues and What to Provide

    Unity Updater issue?-Updater Issues

    Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained

    Comcast or Cox ISP User?-Comcast XFinity and Cox Users

    Have a suggestion?-Idea Informer

  10. #10
    Yes it is, But im talking about when you change it in the options menu from standard to variant to raw.
    Can you detect that in code.
    Im hoping so as it affects the value of a pointer arrow or distance between targets.

    So changing the option is changing distance values

    distance option.PNG

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