PDA

View Full Version : Foundations Core version 1 released



joshuha
September 20th, 2011, 18:24
I am releasing my attempt at a new foundations ruleset that keeps updated with newer functionality that is introduced by both Smiteworks and the community at large.

Some concepts about the ruleset are below:

The ruleset was largely derived from the 4E 2.8 ruleset. I stripped out most everything related to 4E itself and left the character sheet with just a name and token field, same with the NPC sheet, and the combat tracker just has a name and init number field (but still supports targeting and roll dropping, etc.).
This ruleset is designed to be used as a template for new game systems. It would be vastly preferable to have these as extensions because I expect to be updating base functionality with newer features as time goes on but if you want to fork it that is up to you but any bug fixes and new features are your responsibility to integrate into your new fork.
I eventually plan to put this up in sourceforge or other repository so that work can be done by the community at large to update the ruleset.
As permission is granted I will try to incorporate other great community additions into the base ruleset as makes sense. The first two I have incorporated are Dr. Zuess's layers code and ronnke's range indicator code.


As a side note, the first extension I plan on releasing for the foundations_core ruleset is the Strands of FATE RPG. The second extension planned is one that allows more of a generic RPG feel that will allow for the character/NPC sheet to be mostly freeform entries.

Included with the base ruleset is new functionality I am calling Token Extensions. These allow a few new features to tokens on maps including:

Token Frames
This allows you to advance a token through a series of "states" of the token. It can be used to represent open/closed doors, PC tokens in various states, damage to objects, etc.

This is accessed by right-clicking the token -> Token Options -> Advance frame. The shortcut is to ctrl+left click on the token.
Tokens must be named tokenname[1o5].png, tokenanme[2o5].png, etc. in order for the code to recognize the frames.


Token Overlays
This allows you to drop another token denoted as an overlay that will scale and sit on top of the base token and follow it around. This can be to simulate cloaking fields, a separate turret on top of a base tank token, etc.

Tokens must be named overlay_tokenname.png for it to recognize it as an overlay.
You need to drag the overlay token onto the center of the base token to attach it.


Token Slots
This allows you to drop another token onto a base token and they then anchor themselves in slots around the token. This is good to denote status/condition indicators on the base token such as wounded, blinded, etc.

Tokens must be named slot_tokenname.png for it to recognize it as a slot token.
There are 8 slots around a token starting with slot 1 at the SW corner, slot 2 S of the token, and so on counter-clockwise around the token.
A token can be removed from an invidiual slot by right-clicking the base token -> Token Options -> Delete Specific Slot and then choosing a slot number.


Short demo video
Demonsbane has put up a short demo video of the Token Extension functionality here: https://dl.dropbox.com/u/12554407/Token%20Frames%20Overlays%20Status%20Icons.mp4. I will create a more in-depth one as time allows.

Known issues/limitations

Overlays can sometimes fall underneath a token on the client side. Resharing the image will fix this. This seems to be an issue with how the client processes updating token positions via the API.
Slot tokens can sometimes change from their anchored position when token scaling is locked and the map is zoomed. This is due to the fact I have no API method of knowing when the token scaling is locked so still performed math based on zoom level of map when I shouldn't be.
You can "de-synch" the slot tokens from the base tokens if you drag the base token off the map and this will generate an error. Try not to do this, just delete the base token.
Overlays and slot tokens work best with base tokens that are closer to square than rectangular. Math needs a little updating to handle non-square tokens.


Planned future updates for Token Extensions

Let overlays have a scale value in the name to determine if they scale to the base token or not (or how much they scale). This would allow for things like torch radii and what not.
Provide an API function to add slot tokens by a given name to allow for things to be automatically added via a combat tracker.
Roll the combined layer, token extension, range indicator into it's own extension for use with non foundations_core rulesets.


Planned future updates for foundations_core

Roll in Dr. Zuess's table extension.


ronnke's range indicator
For those who haven't seen this before, above each image is a small little checkbox. If you check this off you will see a spot to indicate a scale and a measurement unit. If you change these then drawn pointers (line, box, etc.) will change their scale value and description text to match.

Dr. Zuess's layer extension (Enhanced Images)
I will refer to this thread as it has more detail than I can get into https://www.fantasygrounds.com/forums/showthread.php?t=14916. However, in general, each token on each layer has access to the Token Extension functionality. So you can place token frames for open/closed doors on the feature layer and change the frames between open and closed without players being able to interact with the token. Makes for great atmosphere.

Where to get it
Finally, the ruleset can be downloaded here: https://dl.dropbox.com/u/4606305/foundations_core.zip. To install extract the contents to your Fantasy Grounds 2 application data\Rulesets folder.

Please note that while I did release this for limited testing and tried to iron out any bugs there still may be errors/use cases I didn't forsee. Please report any bugs you find here as well as any feature requests that make sense in a non-specific RPG way.

Herodian
September 20th, 2011, 19:40
Great, thank you! I've got some ideas for extensions already, going to start tinkering with it right away.

Valarian
September 21st, 2011, 09:15
Thanks Joshuha. Hopefully this Foundation core project will continue well in to the future. I will need to start converting the extensions from the old core/base rulesets and, possibly, a few new ones.

Zeus
September 21st, 2011, 09:34
Nice work Joshuha. This should provide a nice springboard for new ruleset development.

Emrak
September 21st, 2011, 18:40
Excellent work Josh

phantomwhale
September 22nd, 2011, 14:00
***Thunderous applause***

If we can get this into a git repository on sourceforge, github or similar, then I'd be happy to jump on as a commiter or contributer.

Interesting to see how many rulesets can now be added simply as extensions - I found SWEX quite closed for extension and have done much work in 3.2 trying to reopen it to allow less brittle extensions to be made. Perhaps we can ensure similar work is done to the foundation ruleset ?

gmkieran
September 23rd, 2011, 15:55
Excellent! Been trying to do this via Unicore and SWEX and the old Basic and not really getting anywhere with any of them. *Wanders off to try building a Cortex Extension*

RosenMcStern
September 24th, 2011, 12:07
Cool! Now the big question:

- how compatible is this with the old Foundation?

I mean, I have a ruleset in development, say 70% complete. It is currently implemented as a Foundation (old ver) extension. The ruleset is extremely simple, as it is for a rules-lite game. How much work do I need, presumably, to switch to the new ruleset?

drahkar
September 24th, 2011, 13:19
I would say not at all. It is built from the 4E Ruleset, stripped down and made 'Generalized'. As such it is not likely to be directly compatible. Joshuha would need to confirm this though.

joshuha
September 24th, 2011, 15:14
I would say not at all. It is built from the 4E Ruleset, stripped down and made 'Generalized'. As such it is not likely to be directly compatible. Joshuha would need to confirm this though.

Most likely not. The easiest way to test would be to roll your work into an extension onto the ruleset and try it out. But it really depends on what files you were touching and what resources in the old foundaitons you were using.

RosenMcStern
September 24th, 2011, 15:24
Done. Charsheets and NPC sheets are 95% functional (custom checkboxes and such goodies work erratically), two or three hammer blows on the lua scripts should be enough to bring them back to full effectiveness.

Combat Tracker is a total mess, but I had to redo it in any case.

Map and Tokens I had not yet done, and the ones in F_core are way, way better than the ones in the old foundation.

Response: thank you joshuha, you have just saved my day :D

If everything goes smooth, you should be able to see the new custom ruleset in three weeks or so. P.S., Joshuha, if you wish to peek into a playtest session, just ask.

VenomousFiligree
September 27th, 2011, 21:41
I can't seem to open modules from with the ruleset. If I try and drag the module book icon "open" the whole Library Module pane moves?

Zeus
September 27th, 2011, 21:52
I can't seem to open modules from with the ruleset. If I try and drag the module book icon "open" the whole Library Module pane moves?
A pure guess; the recent introduction of the new onDragStart() method in 2.8 requires all 2.8 rulesets to update onDrag actions to use the new onDragStart() method to capture the initial drag event.

Adding the following code to scripts/moduleselection_load.lua should sort any compatibility issues for 2.8 rulesets and activating modules.



function onDragStart(button, x, y, dragdata)
return onDrag(button, x, y, dragdata);
end
More information on the new method, onDragStart can be found here (https://www.fantasygrounds.com/refdoc/windowcontrol.xcp#onDragStart) in the library.

VenomousFiligree
September 27th, 2011, 22:20
Thanks DrZ, that fixed it :)

Valarian
September 28th, 2011, 13:23
I've found that the initial size of the chat frame is too big for my screen and breaks the minimum 1024x728 resolution support. It's easily fixed as the bottom of the frame is still visible (just overlapping the dice and modifier box), but perhaps would be better to have the initial value supporting a 728 resolution height (or even the 600 resolution height for netbooks). The chat frame can always be enlarged, whereas it may be difficult to shrink if the screen is small.

joshuha
September 28th, 2011, 14:39
I've found that the initial size of the chat frame is too big for my screen and breaks the minimum 1024x728 resolution support. It's easily fixed as the bottom of the frame is still visible (just overlapping the dice and modifier box), but perhaps would be better to have the initial value supporting a 728 resolution height (or even the 600 resolution height for netbooks). The chat frame can always be enlarged, whereas it may be difficult to shrink if the screen is small.

Alright will make a note on the default size. Although since its now a windowclass it should remember the size you have so should be a one time resize that you have to do.

Valarian
September 28th, 2011, 22:47
It stores in the main setting database then? I'd assumed it would be for each campaign.

VenomousFiligree
September 30th, 2011, 13:01
I'd like to tweak the class referencefeat, but can't find it in the ruleset, is it taken from the FG default? If so where's that?

Edit:
The Library also appears to sort chapters alphabetically by Name rather than Tag, is this intentional?

phantomwhale
September 30th, 2011, 14:24
I'd really like to see if we can get this into source control somehow - e.g. GitHub - so core tweaks and fixes can get added to the core files and keep them evolving.

Josh - any thoughts around that ?

joshuha
September 30th, 2011, 19:29
I'd like to tweak the class referencefeat, but can't find it in the ruleset, is it taken from the FG default? If so where's that?

Edit:
The Library also appears to sort chapters alphabetically by Name rather than Tag, is this intentional?

Yeah anything reference feat, power, etc. was removed from the core as feat is a D&D concept. It's up to the extension creator to create new reference windowclasses to handle the types of information their ruleset can handle.

joshuha
September 30th, 2011, 19:30
I'd really like to see if we can get this into source control somehow - e.g. GitHub - so core tweaks and fixes can get added to the core files and keep them evolving.

Josh - any thoughts around that ?

Should have it somewhere in the next few days.

VenomousFiligree
September 30th, 2011, 19:49
Yeah anything reference feat, power, etc. was removed from the core as feat is a D&D concept. It's up to the extension creator to create new reference windowclasses to handle the types of information their ruleset can handle.
OK. However I haven't created referencefeat, but have used it and it is working, so where would it be getting it from?

Edit:
Scratch that, I just remember I added a host of classes so is probably there! I'll go and check :)

VenomousFiligree
October 2nd, 2011, 09:48
A pure guess; the recent introduction of the new onDragStart() method in 2.8 requires all 2.8 rulesets to update onDrag actions to use the new onDragStart() method to capture the initial drag event.

Adding the following code to scripts/moduleselection_load.lua should sort any compatibility issues for 2.8 rulesets and activating modules.



function onDragStart(button, x, y, dragdata)
return onDrag(button, x, y, dragdata);
end
More information on the new method, onDragStart can be found here (https://www.fantasygrounds.com/refdoc/windowcontrol.xcp#onDragStart) in the library.


For info, this is also needed for the Character Selection window and the Combat Tracker.

VenomousFiligree
October 5th, 2011, 23:46
If a player resizes his chat window, should the GMs chat window be resized too?

Valarian
October 6th, 2011, 05:15
I'd say no, as the player and GM could have different screen sizes. I think everyone ought to be able to set their own size. Does the dice drop frame work if the screens are different sizes, or is it dependent on the GM's frame size?

joshuha
October 6th, 2011, 05:23
I'd say no, as the player and GM could have different screen sizes. I think everyone ought to be able to set their own size. Does the dice drop frame work if the screens are different sizes, or is it dependent on the GM's frame size?

The GM and player chat sizes should be independent. As far as the dice area, it adjusts as well but different sizes can lead to other players besides the rolling player seeing a different result.

Since the dice graphics are redrawn on each players screen but the physics is dependent on the local borders its possible to get a different die face on the 3D dice than the roller but FG always correctly report's the roller's die result to the chat.

Valarian
October 6th, 2011, 10:36
Thanks Joshuha. I go with what comes up in the chat box anyway. The 3D dice rolling is for effect.

Valarian
October 17th, 2011, 13:19
Had a couple of funny behaviours using the ruleset last night.

First, the chat window sizes changed on everyone's PC whenever one of us changed the window size. This sort of confirms what MurghBpurn was saying about the screens. Very strange.

The second is with the module activation window. I'm unable to click-drag on the book to open it as it moves the window. Also with the Force load/Don't load/Allow load icons. Can't drag them as it moves the window instead. Unable to double-click on the module book to open it.

VenomousFiligree
October 17th, 2011, 18:00
DeZ posted a fix for the opening/closing of the book, further up in the thread. I too was unable to select the load icons and manually entered them in the xml file.

joshuha
October 17th, 2011, 18:04
Yeah I will fix the onDragStart thing in the next version. The chat thing I have seen every now and then when a player is trying to adjust at the same time as the host. I may need to look into the filtering I am doing a bit better. It also may be a moot point once a noclose tag gets implemented by the devs.

Just got back from a SQL Server conference this weekend so catching up on work/other stuff but will try and have the code uploaded to a repository of some sort soon. Is GitHub the current go-to for open source stuff or are there others people would recommend?

VenomousFiligree
October 18th, 2011, 06:40
From this thread (https://www.fantasygrounds.com/forums/showthread.php?t=15533), I also had this issue:
One player commented on having duplicate icon buttons on the right hand side, only one player had this (they were lite, everyone else was full), I had seen this a couple of times when using a second instances as unregistered, however it went away when I logged out and back in.

joshuha
November 1st, 2011, 05:17
Setup a github account. Will get code up there in the next day or so. Have been distracted from Fantasy Grounds stuff recently but getting back into it.

Valarian
November 1st, 2011, 07:59
As a note, to remind me as much as any. The unmask function of the map is currently not working. Not yet had time to investigate.

joshuha
November 1st, 2011, 13:42
As a note, to remind me as much as any. The unmask function of the map is currently not working. Not yet had time to investigate.

Remember it is rolling in Dr Z's layer extension so make sure you are on the background layer.

Valarian
November 2nd, 2011, 09:39
Remember it is rolling in Dr Z's layer extension so make sure you are on the background layer.
Doh! That could well be it. I hadn't changed the layers so was probably on the play layer. Have to give it a try.

joshuha
November 2nd, 2011, 18:53
Setup a github account. Will get code up there in the next day or so. Have been distracted from Fantasy Grounds stuff recently but getting back into it.

Ok new at this but I think I successfully committed the base code for Foundations Core here: https://github.com/joshuha/Fantasy-Grounds-foundations-core. I need to add some documentation and what not but this will be the repository for upcoming bug fixes/feature adds.

VenomousFiligree
November 3rd, 2011, 01:46
Nice to see :D Whilst I probably won't be able to physically add to the ruleset I can definitely help on testing!

VenomousFiligree
November 12th, 2011, 17:57
I'm trying to make an extension for Foundation Core and I want to modify chat_chat.lua. The extension loads fine before I add chat_chat.lua but when I add it, I get the following script error:

Script Error: [string "scripts/chat_chat.lua"]:21: attempt to call global 'addMessage' (a nil value)

The message that it points to would appear to load however.

Zeus
November 12th, 2011, 22:27
When you are calling methods or functions defined within the same LUA script you can reference them directly by name.

When you are calling a method or function from another LUA script, you need to proceed the function name with the registered name of the script.

In this case, the addMessage() function is defined within the chatmanager.lua script which is registered with the ruleset base.xml file as ChatManager.

Therefore, edit your chat_chat.lua and change the reference to addMessage(msg) to ChatManager.addMessage(msg). That should clear the error your seeing.

VenomousFiligree
November 22nd, 2011, 18:01
Hi Dr Z I missed your post, thanks I'll try that. I don't see why it would make a difference between the Ruleset version and the Extension version though?


When you are calling methods or functions defined within the same LUA script you can reference them directly by name.

When you are calling a method or function from another LUA script, you need to proceed the function name with the registered name of the script.

In this case, the addMessage() function is defined within the chatmanager.lua script which is registered with the ruleset base.xml file as ChatManager.

Therefore, edit your chat_chat.lua and change the reference to addMessage(msg) to ChatManager.addMessage(msg). That should clear the error your seeing.

VenomousFiligree
December 2nd, 2011, 15:51
The Library also appears to sort chapters alphabetically by Name rather than Tag, is this intentional?
This is quite annoying, now that I'm trying to setup some modules, any ideas how to fix?

joshuha
December 2nd, 2011, 16:06
This is quite annoying, now that I'm trying to setup some modules, any ideas how to fix?

I haven't touched any code in there so this must be default behavior. Having said that the sorting logic looks to be in library_booklist.lua

VenomousFiligree
December 3rd, 2011, 09:06
Thanks for the pointer, I'll take a look.

VenomousFiligree
December 4th, 2011, 11:39
Some possible ruleset issues here (https://www.fantasygrounds.com/forums/showpost.php?p=117478&postcount=4).

VenomousFiligree
December 11th, 2011, 09:52
I haven't touched any code in there so this must be default behavior. Having said that the sorting logic looks to be in library_booklist.lua
Is this not the sorting logic for the category names? Its the Index entries that I'd like to change.

Edit:
If I take out the onSortCompare function from the library_pagelistentry windowlist in reference_library.xml it appears to work.

Blackfoot
December 16th, 2011, 16:14
Since this particular ruleset pretty much needs an extension for full functionality... it would be cool if there was some way to choose an extension when loading up a campaign.. actually.. it would be better if the campaign's extension were somehow loaded automatically as part of the manage characters function since the campaign items would have been built using those rules.
If that makes any sense. I'm not sure how much of this is possible... and Manage Characters is a pretty tweaky part of the whole program... but.. it would be cool if it were useful.

VenomousFiligree
December 17th, 2011, 10:54
A request:
An option to choose between FG default chat window and the resizeable/moveable chat window.

Thanks. :)

JMOxx75
December 27th, 2011, 21:35
Was wondering why the tab icon for the main tab works but adding new tab using tab_notes as the icon name, it doesn't show up. Its in the same folder as main.

Also I only designated 4 tabs. They show up but so do the rest of them all the way to the bottom of the character sheet but they don't work and don't have labels. Just wondering how to make them not show up.

phantomwhale
December 30th, 2011, 05:39
I submitted a pull request to the Github repo to move everything out of the enclosing folder - this allows you to have the ruleset checked out inside the FGII ruleset folder and ready to use. It's also a check to see how well the collaborative github thing will work !

Can start looking at patching some of the issues raised above afterwards.

joshuha
December 30th, 2011, 07:36
I will look at it tomorrow phantomwhale. Just had a baby 2 weeks ago and tomorrow is my first day back at work.

phantomwhale
December 30th, 2011, 09:36
*tsk* there's always an excuse

Congratulations :)

VenomousFiligree
December 30th, 2011, 11:31
Congrats Joshuha :D

VenomousFiligree
December 30th, 2011, 19:47
Request

I'm playing around with town frames. It would be nice if subsequent frames in a series could be placed in a sub directory to keep the main directory uncluttered.

Emrak
December 30th, 2011, 20:26
I will look at it tomorrow phantomwhale. Just had a baby 2 weeks ago and tomorrow is my first day back at work.

Congrats on the baby! :)

Moon Wizard
January 1st, 2012, 20:30
Congratulations! You've entered a whole new world of experience and sleeplessness. ;)

Cheers,
JPG

phantomwhale
January 1st, 2012, 22:55
Congratulations! You've entered a whole new world of experience and sleeplessness. ;)

Cheers,
JPG

Hilariously, for about 2-3 seconds, I thought you were referring to ruleset ownership...

joshuha
January 2nd, 2012, 18:27
I submitted a pull request to the Github repo to move everything out of the enclosing folder - this allows you to have the ruleset checked out inside the FGII ruleset folder and ready to use. It's also a check to see how well the collaborative github thing will work !

Can start looking at patching some of the issues raised above afterwards.

Approved and merged.

peterb
January 29th, 2012, 21:31
I've downloaded the latest code from GitHub and it seems like this ruleset uses a new mechanism for adding new sheets to a character sheet. Some of the functions are documented (in manager_charsheet.lua) but it would help (me at least) with a code snippet that shows how the new functions in charsheet_toplevel.lua are supposed to be used.

TIA,

Peter

Tokuriku
January 30th, 2012, 11:32
/emote prods phantomwhale

phantomwhale
January 30th, 2012, 11:56
Charsheet_toplevel.lua has no functions you'll want to change, the ones there just ensure new sheets get correctly added, it's all done via the manager_charsheet.lua functions.

So one example is the onInit() method from that very same file, which has:


function onInit()
registerSheet("main", "mainsheet", "main_charsheet", "tab_main")
registerSheet("mini", "mainsheet", "main_minisheet", "tab_main")
end

This registered a tab for the "main" and "mini" tab set -you may opt for a much simpler, tab-less minisheet for your ruleset extension, in which case you only want to register sheets for the "main" tab set. Either way, the calls are identical.

As documented, the other parameters are the "name" - in this case "mainsheet", which is just a unique identifier for the sheet within that tab set. And then come the name of the windowclass you want to use as that tab's sheet, and finally the icon name of the tab text image (e.g the image that prints "main" onto the empty tab)

The middle parameter is where you hook back into your new code. This windowclass (main_charsheet in the example) should be a subwindow that contains another windowclass that has the content you want, and that fits into the character sheet area.

The easiest way to do this is to extend the charsheet_sheet template in charsheet_toplevel.xml, which is infact what the main_charsheet windowclass does:


<template name="charsheet_sheet">
<subwindow>
<bounds>0,0,-28,-22</bounds>
</subwindow>
</template>

<template name="main_charsheet">
<charsheet_sheet>
<class>charsheet_main</class>
</charsheet_sheet>
</template>

And then the charsheet_main windowclass is a regular windowclass that contains all the widgets for the main sheet.

So how to ADD more tabs ? Simply add more lines to the onInit() method, or if creating you own extension, just create any script file (I create one called CharsheetManager to match the base ruleset, but that's just naming to remind me what it does) and call it in your extension.xml. And then in THAT file, just have a single onInit() method that creates the extra sheets, such as:


function onInit()
registerSheet("main", "itemssheet", "items_charsheet", "tab_items")
registerSheet("main", "notessheet", "notes_charsheet", "tab_notes")
end

Hopefully that helps explain it a bit more ?

peterb
January 31st, 2012, 11:07
Thanks for the info phantomwhale! I'll give it a try.

/Peter