PDA

View Full Version : API requests!



joshuha
July 21st, 2011, 16:08
I currently have 2 API requests for various projects that I want to see if they could be added in at some point.

1) A tag of some sort on the die XML tags in game_elements.xml to hide the die type from the desktop. This would allow a ruleset that only uses limited die types to "feel" a little more authentic.

2) Expose a way through the API to load resources dynamically. What I mean by this is there is currently no way to declare a framedef, icon, etc. from within LUA. The reason I would want to do this say for a generic RPG system. Rather han have extensions loaded to change say a background to a character sheet, if you let users drop a background image into a folder that your LUA script could then give them a dropdown of images they could choose from to change the framedef for the sheet. This could also be used to have user drop in images for a deck of cards, etc. without having to code each image name in separately as a resource.

joshuha
July 21st, 2011, 17:29
The reason for request #2 is I am thinking of resurrecting a project I had thought about awhile ago to allow people to build character sheets from within Fantasy Grounds. One limiting factor there was there was no easy ability to dynamically add resources if I wanted them to drop an image that I can use for a background into a directory. My goal was to not have the person have to touch any XML or LUA to create a basic sheet.

The gist of the idea here:https://www.bitsbyteswords.com/images/demo.html.

Obviously would work on cleaning up the GUI a little, adding more controls, ability to lock down the editing of the sheet so that players would see a final version, etc. Still have to work out kinks of how to add tab controls on the fly but think I could so something very rudimentary. All this would piggy back as an extension on the foundations ruleset to allow the building of quick and dirty character sheets (and eventually NPC sheets) to allow you to run most anything quickly.

Zeus
July 21st, 2011, 22:27
Sounds like an interesting concept. :) I look forward to seeing how far this can be made to work.

On a similar vein I had recently requested an API ability to pass a window instance an array of controls that could then be automatically positioned in the form using standard windows flow output, i.e. left to right and then down.

The idea being that defining a character sheet or any FGII window becomes as simple as defining the window size, field types and labels. No nonsense about anchoring to worry about etc.

I do like the idea of building a rulesets windowclasses and window elements from within the FGII GUI though, its kind of akin to the start of an integrated development environment. Very cool.

demonsbane
July 23rd, 2011, 21:39
1) A tag of some sort on the die XML tags in game_elements.xml to hide the die type from the desktop. This would allow a ruleset that only uses limited die types to "feel" a little more authentic.

I would like to see that, too.

For instance, when your game system only uses d10 or d6, the other dice certainly are a nuisance even if they are displaced to a different part of the FG2 desktop.

Moon Wizard
July 24th, 2011, 22:54
I actually tried to implement the ability to specify which die types could be used in a ruleset with v2.8. However, the assumption that the 6 dice exist is so embedded in the FG code I inherited, that it would have required a substantial rewrite of almost every system within FG. So, I had to leave it for a future revision, since that was not the focus of the v2.8 release.

Regards,
JPG

Zeus
July 24th, 2011, 23:03
Maybe it would be easier to just hide the dice that are not required as opposed to disabling them. Just a thought.

demonsbane
July 25th, 2011, 02:04
Maybe it would be easier to just hide the dice that are not required as opposed to disabling them. Just a thought.

That should be pretty possible: if you have 1 display of 1680x1050 pixels and you extend it to a second display to 2852x1050 pixels and then you use the "arrange dice" option in the FG2 desktop, the GURPS ruleset, for instance, separates the d20-d12-d10-d8-d4 from the d6 (the ones used for that rules system), placing them in a row at the right side of the screen. If after doing that, you resize the FG2 window to the dimensions of a single display (again, in this example, 1680x1050), the dice will be effectively hidden: they will remain arranged beyond of the current FG2 desktop resolution. Unfortunately, this requires at least two displays and must be done each time that the FG2 app starts.

This would be the maximized FG2 desktop in a single display, without the unused dice:


https://dl.dropbox.com/u/12554407/FG2%20-%20Unused%20Hidden%20Dice.jpg

I think that could be possible to set a command for arranging the dice to the position corresponding, let's say, to a FG2 desktop resolution of 4000x1050 pixels, or 4000x1080. If that would be doable, and that "arranged dice configuration" could be kept from session to session, the unused dice would be indeed hidden in a practical sense. It boils down to send these dice "very far away" ;)

Moon Wizard
July 25th, 2011, 06:56
I actually went that route, but there were still too many dependencies to feel comfortable with inclusion in v2.8 after the beta cycle had started. Originally, I only started looking into including in v2.8, because I thought I would be able to do something like you guys suggested.

Cheers,
JPG