PDA

View Full Version : Creating some automation for a new TTRPG



lotevenstar
July 2nd, 2019, 06:05
Hello there. At this moment I am hoping to find the right direction to take to develop some more automation in my CoreRPG. I am looking for things like tethering together Attributes with certain rolls/weapons and abilities, as well as being able to connect damage rolls with a location based attack table. I am using a system that needs to be able to keep track of hit locations (both arms, legs, torso and head) so that when a character takes damage these locations automatically reduce in number, after being soaked by armor. Tethering abilities to attribute rolls would be great as well. I just...don't know what the heck I am doing at the moment.

damned
July 2nd, 2019, 06:57
welcome lotevenstar

you are going to need to dive into some Lua and XML programming.
you might start with these videos.
they are based on MoreCore but a lot of the content applies equally to CoreRPG

lotevenstar
July 2nd, 2019, 07:18
I appreciate the direction, but I am looking for a little more in-depth. I am lightly familiar with both XML and Lua, novice for sure, but I am not sure what section to start with within some of the code that will impact the automation I am looking for. I need to figure out how to check for location, check for armor, and then subtract from health after all that nonsense. Sigh.

damned
July 2nd, 2019, 07:34
I appreciate the direction, but I am looking for a little more in-depth. I am lightly familiar with both XML and Lua, novice for sure, but I am not sure what section to start with within some of the code that will impact the automation I am looking for. I need to figure out how to check for location, check for armor, and then subtract from health after all that nonsense. Sigh.

You are going to need to experiment with various controls and UI elements until you find something that fits your design objectives.
There is probably several ways to do it.
Dive in. Start playing.

Trenloe
July 2nd, 2019, 15:23
The main areas you will have for data is the FG database and the FG GUI. Usually the controls in the FG GUI directly link to database fields as their source for data, but not always.

I’d recommend doing what @damned suggests - start experimenting with some controls. Just try something small first, maybe a couple of hit locations and the other fields you need as a minimum to try what you’re wanting to do. Make sure these controls have database fields as their sources of data.

Then start looking at what "action" you want to code and how that needs to work. If you’re using purely CoreRPG then you’re going to need to code at least one new action, as CoreRPG really only has a basic throw dice action. Details on creating a new action here: https://www.fantasygrounds.com/forums/showthread.php?35531-Fantasy-Grounds-v3-X-CoreRPG-based-Actions-(dice-rolling)

Let’s be clear - you’ve a lot of work to do as you’re essentially building most of this from scratch in CoreRPG. A good approach is to look at other rulesets and see how they have done things similar to what you want to do and use that code. I believe the Warhammer 40K community ruleset has hit locations in it, for example.

lotevenstar
July 2nd, 2019, 20:00
Thank you Trenloe, this helps a lot.

Trenloe
July 2nd, 2019, 23:18
And welcome to the FG forums!

Ask any questions you have. Sometimes a few of us old hands don't have time to write long responses, so please forgive us if all we do is give you links to other stuff! :)

lotevenstar
July 3rd, 2019, 02:53
So my work is going well, but I am struggling with something. I would really like to have the abilities section of CoreRPG contained in a frame on the Main sheet. I have a Details frame with name/class/race etc, an Attributes frame linked to dice rolls, a location based damage chart and then to the side I am looking at a blank window and can't figure out how to add the base implementation of CoreRPG into that smaller window. Any assistance on this?

Trenloe
July 3rd, 2019, 03:00
So my work is going well, but I am struggling with something. I would really like to have the abilities section of CoreRPG contained in a frame on the Main sheet. I have a Details frame with name/class/race etc, an Attributes frame linked to dice rolls, a location based damage chart and then to the side I am looking at a blank window and can't figure out how to add the base implementation of CoreRPG into that smaller window. Any assistance on this?
I *think* I know what you're trying to do. FG has the concept of a subwindow - info here: https://www.fantasygrounds.com/refdoc/subwindow.xcp Subwindows allow you to embed other windowclass objects into an existing window.

Or.... if the control you're looking at is a windowlist (https://www.fantasygrounds.com/refdoc/windowlist.xcp) then you should be able to just move that control into your window. (Sorry, I haven't delved into the code to check if what you're looking at is a windowlist of a full windowclass).

So, at a basic level - if you want to move a windowclass from another ruleset into your custom ruleset, think of a subwindow, but if all you need to migrate is the windowlist control, then just move that, and include it's associated windowclass XML - because each line in a windowlist is a window, hence it's a list of windows, and windows are defined in windowclass entries.

I hope I haven't thrown too many FG terms at you in one go! :)

lotevenstar
July 3rd, 2019, 03:48
Not at all, thanks for the Assistance!

lotevenstar
July 3rd, 2019, 05:46
New but related question: How do I set a specific size and/or potential like a window size of something like a character sheet or notes on opening them? I am thinking an extension, but does someone have a little knowledge to impart? 27730 this is the wrong size I am talking about, and the correct: 27731

Trenloe
July 3rd, 2019, 14:21
I am thinking an extension, but does someone have a little knowledge to impart?
See the <placement> -> <size> section of the windowclass definition: https://www.fantasygrounds.com/refdoc/windowclass.xcp Also look at <sizelimits> if the window is re-sizeable.


I am thinking an extension, but does someone have a little knowledge to impart?
How are you developing your ruleset? Are you directly modifying CoreRPG (not a good idea in the long run), or are you layering your ruleset on top (better idea) or are you doing an extension to CoreRPG? Whatever you're doing, make your size changes to the windowclass used to create the PC sheet - in CoreRPG this is the <windowclass name="charsheet"> entry in campaign\record_char.xml - you can see the <placement> and <sizelimits> tags at the top of that entry.

lotevenstar
July 3rd, 2019, 17:31
I am directly modifying a copy of CoreRPG, is that not how new rulesets are created? What is the issue with doing so? Thank you for the information.

Trenloe
July 3rd, 2019, 17:36
I am directly modifying a copy of CoreRPG, is that not how new rulesets are created? What is the issue with doing so? Thank you for the information.
New rulesets are usually layered on top of CoreRPG. All of the main FG rulesets (D&D 2E, 3.5E, 4E and 5E; PFRPG, etc.) are all layered on top of CoreRPG. This allows them to make use of generic FG functionality and also allow future generic CoreRPG functionality and bug fixes to be inherited.

See the third last paragraph here: https://www.fantasygrounds.com/forums/showthread.php?20651-Modifying-the-CoreRPG-ruleset

Modifying CoreRPG directly means you're stuck with that level of code forever (unless you want to spend lots of time adding in new future CoreRPG functionality), which might not seem much of an issue now, but it might in a year or more (especially with FG Unity on the horizon).

And, sidenote, if you are modifying CoreRPG, make a copy of it and modify the copy - so that your code isn't overwritten by a CoreRPG update. But, you really don't want to be modifying even a copy of CoreRPG direct.