PDA

View Full Version : Making ruleset on top of corerpg question



Sancudo
December 25th, 2022, 16:01
Hi all, I've been wondering if there are any documentation on corerpg for layering on top of it (like 5E combat manager calling to corerpg manager to set custom round starts and so on) or is it more of a dive into it and have fun looking through all the codes?

Zacchaeus
December 25th, 2022, 16:36
Welcome to FG.

This is a good place to start https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644285/Developer+Guide

Sancudo
December 25th, 2022, 16:50
Thanks for the reply! tough I've gone through the dev guide before and while its good for overall familiarization it does not have much on the things that can be taken from CoreRPG, I understand if there's no docs of functions that can be used (like string manager ones) and what can be inherited (like combat manager) just figured I would ask if there is a written reference of corerpg functions before having a deep dive.

damned
December 26th, 2022, 00:20
Hi Sancudo

Building on top of CoreRPG is the correct way to go. That allows you to inherit so many things liek tables, party sheet, combat tracker, image handling and line of sight etc.

There is no doco on how to build a ruleset. In lieu of that the CoreRPG ruleset along with 3.5E, 4E and 5E are all unlocked and you can explore them and reuse or adapt code from them.

Another alternative is to look at the Ruleset Wizard - it is a 3rd party commercial tool. I do all my ruleset development in the Ruleset Wizard now. For me, for building out a ruleset (as opposed to an extension of an existing ruleset) it is a huge time saver and makes the process much easier. Of the 12 rulesets in my signature I made 11 of them in the Ruleset Wizard. That might give you some clue as to how much it has improved my output...

Xarxus
December 26th, 2022, 15:47
Yep, I'm trying ruleset wizard (https://www.rulesetwizard.com/).
There is something I do not understand. If I define for example an icon, I find the declaration in base.xml.
How can I clean code from base.xml, moving declarations to the xml I want?

damned
December 26th, 2022, 21:52
Dont.
You just have to accept that it has some predefined locations for some things.

If you really want to you can redefine it in say graphics\graphics_icons.xml but it will still be in base.xml

Xarxus
December 26th, 2022, 23:13
I've seen that you can compile to a folder rather than a compressed file (pak). This means that you can then do some cleaning by hand before the final release.
I could create some auto scripts to use in Microsoft Code... :)

damned
December 27th, 2022, 04:52
Yes you could. But you would have to remember the additional step every single time you compile.
Technically you could write the entire ruleset inside one single file. There isnt anything wrong with the RW way other than strings and graphics would normally be in other files.

celestian
December 27th, 2022, 05:04
Thanks for the reply! tough I've gone through the dev guide before and while its good for overall familiarization it does not have much on the things that can be taken from CoreRPG, I understand if there's no docs of functions that can be used (like string manager ones) and what can be inherited (like combat manager) just figured I would ask if there is a written reference of corerpg functions before having a deep dive.

Unfortunately there is no real documentation on the CoreRPG code. Some of the code is commented and that helps but your best bet is to call the function from your ruleset and log all the values and see what happens. At least thats what worked for me. A lot of it is fairly straight forward but not all of it.

Sancudo
December 29th, 2022, 22:10
Yeah I've been tinkering with the ruleset wizard and it does look pretty cool and looking forward to see how it evolves in development.
Guess i'll have to make my own simple notes of the available functions in core with blackjack and hookers since it'll be a pain to open the file where I think some function I need was or whatever.
thanks for all the answers!

damned
December 29th, 2022, 22:47
Couple of things to help.
Type in chat /debug on and this adds a panel top left that displays more information about whatever your mouse is hovering over.

Find features/interfaces/workflows in existing rulesets that you want to emulate/learn/modify/steal and then use find in files search to locate them.
Note many components will rely on multiple pieces of code/definition to make work.

Eg a button will have
(one or more) icon/graphic definitions in another file
probably (one or more) templates in another file
some positioning and anchoring where the button is used
possibly some inherited anchoring from the template
some script or functions where the button is used
possibly some script or functions from the template

So once you locate the initial code in the ruleset (CoreRPG or the ruleset on top eg 5E or other) you will also have to backtrack to find these other components.

examples:

<icons>char_attacks</icons>
do a find on files on char_attacks and find

<icon name="char_attacks" file="graphics/icons/char_attacks.png" />

or
<label_charframetop name="weapontitle">
do a find on files on label_charframetop and find

<template name="label_charframetop">
<metalplate>
<frame name="metalplate" offset="10,2,10,2"/>
<font>subwindowsmalltitle</font>
<center />
<nodrag />
<readonly />
<script file="campaign/scripts/char_labelframetop.lua" />
</metalplate>
</template>
and note that it contains a script file but also includes another template metalplate which looks like this:

<template name="metalplate">
<stringcontrol>
<frame name="metalplate" offset="10,2,10,2"/>
<font>subwindowtitle</font>
<nodrag />
<readonly />
</stringcontrol>
</template>
which also contains a frame and a font, both defined elsewhere.

Sometimes you will have to search just the layered ruleset, sometimes you will need to go back up and also search CoreRPG too.