PDA

View Full Version : How to learn to program a ruleset or extension for Fantasy Grounds (tips thread)



lokiare
July 4th, 2017, 05:36
I received a PM asking about how to do this kind of thing and I thought the reply might be helpful to the community at large so I put this together. If its useful it might get stickied, so tell me what you think and if it helped you.

The best way to learn how to work with Fantasy Grounds LUA code is to look at all the tutorials and examples in: https://www.fantasygrounds.com/forums/forumdisplay.php?42-The-Workshop

Once you've done that take a look at the wiki pages: https://www.fantasygrounds.com/wiki/index.php/Developer_Guides

Particularly: https://www.fantasygrounds.com/refdoc/ and https://www.fantasygrounds.com/modguide/

Then to learn what everything does grab your IDE (I use notepad++) and extract the CoreRPG ruleset as if it were a zip file into a folder and do a "find in files" search for what you are looking for. For instance rActor or rSource.

You can also extract the ruleset to its native folder and do some debugging to see what a variable contains by adding "Debug.console(<variable>);" to the code. Where <variable> is the variable you want to see the internals of. Then open the console within Fantasy Grounds by typing /console in chat.

If after all that, you still have questions you can post for help in the Workshop of the forums. There are many people that would love to help you out here.

Trenloe
July 4th, 2017, 18:15
Thanks for posting.

For those reading, there's also a lot of info (and links) here: https://www.fantasygrounds.com/forums/showthread.php?20651-Modifying-the-CoreRPG-ruleset