PDA

View Full Version : The Basics



CelineSSauve
October 9th, 2012, 15:02
Hello everyone!

As many of you are already aware, I'm trying to make a Ruleset for Pokémon Tabletop Adventures (https://forums.pokemontabletop.com/site/) by modifying the 4e D&D ruleset to suit the game. (It's clearly based on it.)

Here's my problem: I think the scripts and such in the 4e ruleset are getting in my way when they don't match what I want to do. So I'm wondering what's the most basic way I can set up a ruleset to work with? I'd like the background to remain the same as it is, and the chat window and such. I have no need for the tower/box.

I can then just code the very few calculations needed on the sheet into it and then have the Combat Tracker reference the sheet, if it needs to. The various bonuses (level, training and such) in 4e are--I believe, though it's hard to tell--a big reason for the errors I am getting. (As well as several other Scripts, I'm sure.)

Also, If there was some way to overlay any tokens that are connected to a PC or NPC with a "frame" of their colour, that would help an incredible amount for Pokémon battles...

Any and all help is welcome here. I may be in College currently, but the work load is nothing too large so far and I'd like to see if I can't at least get a first version of this out in the wild before it does.

dr_venture
October 9th, 2012, 16:38
I'm kinda stumbling in the dark myself in terms of learning FG development - I'm just starting to learn how to tweak an existing unfinished ruleset... so take this all with a big grain of salt.

I think you're in a tough spot, in that the scripts you mention are really the heart of the ruleset in many ways. 4e is a pretty evolved ruleset, and I'm guessing that pulling out the unwanted scripts from it is not going to be an easy task, in that unless you know what you are doing, yanking out one thing over here may break 3 or 4 or 5 things a bunch of other places. On the other hand, starting with one of the simpler 'generic' rulesets (others will no doubt chime in - I'm unfamiliar with them) means you're going to have to wire in the specialized functionality you want, which has it's own set of difficulties. Tearing out significant functionality from the existing ruleset or starting from scratch are both options that are fraught with their own difficulties. I'm not sure what to suggest.

For what it's worth, I would suggest that the easiest thing to start with is to make a copy of the 4e ruleset, then begin by commenting out the code that displays the fields and text for the features you're not interested in. This leaves all of the underlying scripts and mechanics in place. It can cause it's own problems, but it's a relatively gentle approach to mucking with the ruleset. You can always rearrange the layout of the window elements to look better. Then adding a handfull of new features might get you through the process with as little mysterious and endless debugging as possible.

Hope that helps!

CelineSSauve
October 9th, 2012, 16:45
For what it's worth, I would suggest that the easiest thing to start with is to make a copy of the 4e ruleset, then begin by commenting out the code that displays the fields and text for the features you're not interested in. This leaves all of the underlying scripts and mechanics in place. It can cause it's own problems, but it's a relatively gentle approach to mucking with the ruleset. You can always rearrange the layout of the window elements to look better. Then adding a handfull of new features might get you through the process with as little mysterious and endless debugging as possible.

Hope that helps!
I believe that's similar to what I've already tried, but thanks for the quick reply :)

I already have figured out (for the most part) which parts of 4e to keep and even how to modify the existing bits, somewhat, to reflect the system I want to work with.

I haven't tried starting with, say, 4e, though, but that's mainly because I'd like to code Contests in where Skill Challenges are currently.

Moon Wizard
October 9th, 2012, 18:27
The best way I've found is to start with small changes, such as fields shown within windows such as character sheets and combat tracker, and keep chipping away. I would even start with one or two fields at a time, and make sure they are what you want.

Given that PTA is a d20 system, it seems like 3.5E and 4E are a decent starting place. You could also try the old d20 ruleset on the Downloads page, but it doesn't have any of the bells and whistles. (It is essentially the 3.5E ruleset from 4 years ago.)

Make sure to use a good text editor with a multi-file search capability. Those rulesets use control templates heavily, so you will find yourself looking up the control types within the ruleset when they are not one of the standard types (stringfield, numberfield, tokenfield, etc.).

I would only change files as you need them, and deal with script errors as they appear. Make sure to keep the /console open as you are working, and the /reload command is your friend (since it reloads the ruleset files while you are already running).

Also, check out the Debug package in the Ruleset Reference material. You can insert one of these functions to spit out the contents of variables at any point in your script while it is running. Very useful for debugging scripts that aren't working like you expect.

Feel free to post questions as you are working either about the structure of the ruleset, what pieces of code do, or anything. I wrote the 3.5E and 4E rulesets, so I'm very familiar with how they work. Also, the community is great, and often answers before I do.

Regards,
JPG

CelineSSauve
October 9th, 2012, 19:20
<snip>

Feel free to post questions as you are working either about the structure of the ruleset, what pieces of code do, or anything. I wrote the 3.5E and 4E rulesets, so I'm very familiar with how they work. Also, the community is great, and often answers before I do.

Regards,
JPG
Thanks. I do have a program that's great for finding the specific bits of code "String Finder" (or something along those lines).

It seems like I was on the right track after all, though I will certainly post any new concerns as they come up. Likely regarding errors I can't solve. (I shall also be sure to track down that debugger when I get home.)

As it is, I have no clue why my character sheet's ability mods suddenly reverted to the old way. PTA has the same rules above 10 but different rules if under 10. I'd had it set up a while back, but managed to undo that somehow. :confused:

I will try to chip away at this a bit each night, and I'll reply here if I get any snags that I can't figure out. :)

Thanks again for the quick and friendly replies and advice! :D

Moon Wizard
October 9th, 2012, 20:15
Here's the link to the Debug package (https://www.fantasygrounds.com/refdoc/Debug.xcp) from the Ruleset Reference (https://www.fantasygrounds.com/refdoc/), if you haven't found it already.

Regards,
JPG

CelineSSauve
October 9th, 2012, 20:22
Here's the link to the Debug package (https://www.fantasygrounds.com/refdoc/Debug.xcp) from the Ruleset Reference (https://www.fantasygrounds.com/refdoc/), if you haven't found it already.

Regards,
JPG
Thank you. I was heading to class when I sent my last reply, so hadn't had a chance to look. I did have the reference bookmarked before, I think, but I shall look at the debugger when I get home.

CelineSSauve
October 17th, 2012, 01:19
Okay... I had forgotten this little thing called "midterms", but now that those are out of the way, I have a question about two separate tabs on a character sheet.

The second Tab will be where Players can bump their stats due to Features or with their increase in Levels. Those stats final stats will be shown on the first page and used there to calculate their mods and HP, amongst a few other things.

What is the best way to go about that coding to minimize the amount of errors I'll have to deal with? (I'm using the 3.5 ruleset as the one to modify.)

Moon Wizard
October 17th, 2012, 20:45
The Main and Combat tabs in the 3.5E ruleset are a good example of that use case. The combat modifiers are broken out into their component parts on the Combat tab, but only the totals are shown on the Main tab. (See Initiative, Melee Attack, Ranged Attack, saving throws, AC).

Each tab of the character sheet has the same base data node, so they all share the same data space. If you have a field on two different pages with the same name (or source attribute), then they will point to the same data value and update accordingly.

Regards,
JPG

CelineSSauve
October 17th, 2012, 23:38
The Main and Combat tabs in the 3.5E ruleset are a good example of that use case. The combat modifiers are broken out into their component parts on the Combat tab, but only the totals are shown on the Main tab. (See Initiative, Melee Attack, Ranged Attack, saving throws, AC).

Each tab of the character sheet has the same base data node, so they all share the same data space. If you have a field on two different pages with the same name (or source attribute), then they will point to the same data value and update accordingly.

Regards,
JPG
Oh! Okay. That works. So now I just need to ensure I know what I'll be naming everything before I start.

Thank you so much for the help!:)

CelineSSauve
October 18th, 2012, 23:00
If I make a spreadsheet for my players to use now with the Name, Type, Range, Target, Keywords, Damage, Effects and such as their own columns, will there be an easy way to plug that into the Moves section of the ruleset, or would I just be doing a bunch of busy work for nothing?

Moon Wizard
October 18th, 2012, 23:15
I'm not following your question, but I'll go based on what I think you are asking.

You could have a window class in the ruleset which displayed each "Move" record with all of the fields you mentioned. Then, you could create a module of "Moves" available to the players in XML, which could be loaded into any campaign using your ruleset. Finally, you could enable GM and players to drag and drop Moves from your module onto your character sheet.

This all assumes you are trying to build something like drag and drop abilities, similar to feats and spells in 3.5E.

CelineSSauve
October 18th, 2012, 23:20
I'm not following your question, but I'll go based on what I think you are asking.

You could have a window class in the ruleset which displayed each "Move" record with all of the fields you mentioned. Then, you could create a module of "Moves" available to the players in XML, which could be loaded into any campaign using your ruleset. Finally, you could enable GM and players to drag and drop Moves from your module onto your character sheet.

This all assumes you are trying to build something like drag and drop abilities, similar to feats and spells in 3.5E.
Yes and no.

I am in fact looking to make the Drag and Drop (I am actually looking to do that for Pokémon, Features, Items and Moves), but I was talking about how some people use a PDF to input Powers into 4e D&D's ruleset.

If I make an Excel (outside of FG II) could I then later somehow have that transformed into the correct code for the Moves (or Items, or whatever) in FG II, or would I have to code each of them manually?

[I do hope that's a little clearer. :o]

Moon Wizard
October 18th, 2012, 23:28
You would basically have to convert the spreadsheet into the FG XML format. I'm not aware of any tools that do this kind of transformation generically, so it would require a custom app like the 4E parsers. This is probably out of scope for this project.

So, I would suggest waiting to build the full module until you have nailed down the fields you are going to end up with in the Move data records by entering examples and seeing how they look and work in the ruleset.

Also, I would suggest gutting a 3.5E basic rules module down to a single list and a set of data records. (Feats would be a good one to leave.) Then, change the list and data records to have a single entry which you then modify to fit the data you want to have. Use the records in the original basic rules file as an example.

Then, I would create a handful of Move record entries using copy and paste on the XML, and set some example data in there. Use this as your examples while building your ruleset. Since there are only a few records, they'll be easy to adjust (add/remove fields, change data types, etc.) during development.

Regards,
JPG

CelineSSauve
October 18th, 2012, 23:48
Also, I would suggest gutting a 3.5E basic rules module down to a single list and a set of data records. (Feats would be a good one to leave.) Then, change the list and data records to have a single entry which you then modify to fit the data you want to have. Use the records in the original basic rules file as an example.

Then, I would create a handful of Move record entries using copy and paste on the XML, and set some example data in there. Use this as your examples while building your ruleset. Since there are only a few records, they'll be easy to adjust (add/remove fields, change data types, etc.) during development.

Regards,
JPG
Okay. That sounds doable. Where would I get a 3.5e Basic Rules Module? Is that in the data I extracted for the ruleset itself?

Moon Wizard
October 19th, 2012, 00:53
It's a separate file located in the modules subfolder in the FG data directory. (3.5E-basicrules.mod)

Regards,
JPG

CelineSSauve
October 19th, 2012, 00:58
It's a separate file located in the modules subfolder in the FG data directory. (3.5E-basicrules.mod)

Regards,
JPG
Okay. I found it... I can't open it in Text. Do I need to work on that in FG II itself?

Moon Wizard
October 19th, 2012, 01:35
No, just add .zip to the entire file name (3.5E-basicrules.mod.zip). Then, you will be able to open and extract the files inside. The definition.xml file defines the name of the module, and which ruleset it is designed for. The client.xml file is the XML data contained in the module. This is the file you want to edit.

Regards,
JPG

CelineSSauve
October 19th, 2012, 01:41
No, just add .zip to the entire file name (3.5E-basicrules.mod.zip). Then, you will be able to open and extract the files inside. The definition.xml file defines the name of the module, and which ruleset it is designed for. The client.xml file is the XML data contained in the module. This is the file you want to edit.

Regards,
JPG
Okay. Thank you very much! :)

I won't have anymore questions until I actually dive into this now. And with MonkeyCon the next two days, that won't be until at least Sunday.:o

CelineSSauve
October 20th, 2012, 18:24
No, just add .zip to the entire file name (3.5E-basicrules.mod.zip). Then, you will be able to open and extract the files inside. The definition.xml file defines the name of the module, and which ruleset it is designed for. The client.xml file is the XML data contained in the module. This is the file you want to edit.

Regards,
JPG
Would using WinRAR be the cause for the file, once returned to a .mod file, no longer showing up in FG II?

Thankfully, I did save a copy of the file before converting it the first time, so I should be able to recover that and start over.

EDIT: Confirmation that my recovery of the copied .zip of the original .mod worked. So it must have something to do with having to turn it into .rar before .mod since I don't have WinZip. *sighs*

I shall keep you posted if I don't figure this out.

EDIT 2: I was able to find WinZip on my desktop. Using that instead seem to let me remove stuff from the .mod file without killing it. Whoot!

CelineSSauve
October 20th, 2012, 22:05
How do you use the debugger? I removed everything from the list but Feats, and then removed all but a handful of Feats so that I could play around with them. Unfortunately, I'm getting an error about an end tag.

Oddly, I've checked the file several times and can't seem to find the error... Also, it keeps referencing different lines most of the time... :confused:

CelineSSauve
October 25th, 2012, 00:30
And fixed that...somehow.

I have found that Feats may not fit my needs, but the Monsters may very well hold some keys to how the Pok&#233;mon might be coded. Unfortunately, I have midterms tomorrow and next week (then my operation the week after that), so I can't do more coding than I have until that's done.

I will return here, though, if I have my sheets working once more, so that I can get advise on how to get the code to drag/drop and either auto-fill a field or "move" an item from one inventory to another, or from one location to another.

CelineSSauve
November 11th, 2012, 00:17
So I've returned from my operation and am feeling well enough (read: restless enough) to take a few pokes at the coding.

As what I had previously done didn't translate to 3.5 from 4e for some reason, I've decided to keep trying with that ruleset. I'm not 100% sure which version I was using, but I do know that the current 4e ruleset has a different file structure than the one I'm using.

Here's my main issue: Pokémon
Strangely, it's not the calculation of damages, and that's a simple "if/then" situation, but rather having their information available. Currently, I have all three types of Pokémon in the same NPC pop-up. (Trained, Wild and NPC Trained.)

The problem is that I need the PC and NPC fields to act differently... but I also need them to interact.

Here's what I have in mind, and perhaps someone will have a solution.

All Pokémon have Moves and Types and Natures Abilities and such.
Trained Pokémon keep track of their current XP (some NPC Trained may as well).
When a 'mon is captured, I need to be able to (as the GM) grab that critter and drop it in the proper section of the PC's sheet. At that point, I want all fields that match to copy themselves over. Base Stats, Lv (and base XP to get to that level), Abilities and such should all match. Of course, the GM should be able to edit this information, in case the PC has certain Features that would allow them to modify a captured 'mon, but the PCs should not be able to edit this information.

I figure I need to start by splitting at least the PC and NPC sheets from each other. (At the moment, they're on the same sheet with bullets separating them, like item, weapon and such in D&D.)

I am unsure how to do the copying. I suspect it'll be a drag-drop function of some sort...

This will also be the mechanic used for Trades. I will allow either party to drop their 'mons into the "Trading Machine" (along with any money or items they might be offering, much like the betting mechanic before a match) and it should display the basic information like it will on a sheet (at a glance). Then, if the Trade is made, it should copy the 'mons to their new owner's sheets.


Hopefully, I've made a bit of sense there... I'm going to poke around at the PC Trainer's sheets now, as I have a slight idea of what I'm doing there at least.

Any and all help would be greatly appreciated. My medical note forbids me from attending classes until the 26th and there's only so much I can do to maintain my sanity at home until then.

Moon Wizard
November 11th, 2012, 10:19
I'm not sure if I followed completely, but I think I got a rough idea of what you want to do.

Here's what I would do:
* Define a windowclass for individual Pokemon to view/edit
* Within the character sheet, provide a tab containing a list of Pokemon (sort of like the inventory tab)
* You can drag and drop individual Pokemon using the link box in the upper left corner.
* Unless you need to modify the Pokemon records as they are dropped on lists (i.e. campaign lists, character sheet lists, etc.), you can use the acceptdrop tag for your windowlists to automatically create a new list record and copy all the fields.

In the 3.5E ruleset, check out the "itemlist" windowclass and the "list_items" windowlistcontrol definition contained within that class. It is an example of how it would work. In fact, items are a good example to get started for what you want to do, since the implementation is simpler than creatures.

If you are dropping individual Pokemon on the combat tracker, you may need to have a scripted drag and drop handler, unless the combat tracker entries and the Pokemon have the same underlying data format. I would tackle that later, after you have the other bits working. There's a onDrop handler in the ct.lua script that you can check out when you are ready for a scripted drop example.

Regards,
JPG

CelineSSauve
November 11th, 2012, 12:45
It is an example of how it would work. In fact, items are a good example to get started for what you want to do, since the implementation is simpler than creatures.
The last few times I tried to copy items from a mod to an item (in the 4e ruleset, at least) the info kept erasing itself. Will that be an issue if I follow the 3.5 item example?

I'll admit, it's been a while since I tried to run anything in 4e, so the item issue might have been fixed there...


I am hoping to have the Tracker deal with both 'mons and Humans, but yes, that is lower in the list of my priorities. I'll start playing with the layout of the various tabs today. After that, I'll starts seeing about how to make the Pokémon tab function similarly to the 3.5 items.

Thanks for the feedback :)

CelineSSauve
November 26th, 2012, 18:57
Hopefully someone can help me out with this:

I am still working on the character sheet, but I had to use a work-around for a bug I found relating to the tabs. I am using the 4e ruleset (an older version of it, though...) as my previous work can be carried over.

I have 6 tabs instead of 7 on my sheet. The first issue is how to remove that 7th tab.
Another issue is that even if I rename the tabs in the charsheet_toplevel, the program will not open the new tabs.

The tabs should appear in this order on the sheet (top to bottom) Main, Features, Pok&#233;mon, Inventory, Notes, Update.

As it is, I have completed the Main tab, and have modified the Notes tab. The others will be in the works a bit later, as I need to figure out how to make lists that include images in them for everything but Updates (and perhaps Inventory).

[For those wondering, since I made mention of it earlier, my operation went well.]

Moon Wizard
November 26th, 2012, 19:24
The control that displays and controls the tabs is actually a custom control defined right in the 4E ruleset. In the latest 4E ruleset, this control is called "buttongroup_tabs".

To change the tabs, you need to define the icon resource that will be used to identify the tab, and the subwindow that will be activated when the tab is selected. If you want to add/remove tabs, you just need to add/remove XML tab entries for the custom control in your windowclass. Finally, the control will automatically activate the first tab on initialization unless you specify an alternate value in the activate XML tag.

Here is an example of how the control is used for tabs on the 3.5E mini character sheet.



<buttongroup_tabs name="tabs">
<tab>
<icon>tab_main</icon>
<subwindow>main</subwindow>
</tab>
<tab>
<icon>tab_abilities</icon>
<subwindow>abilities</subwindow>
</tab>
<tab>
<icon>tab_inventory</icon>
<subwindow>inventory</subwindow>
</tab>
<tab>
<icon>tab_actions</icon>
<subwindow>actions</subwindow>
</tab>
<activate>1</activate>
</buttongroup_tabs>


Regards,
JPG

CelineSSauve
November 26th, 2012, 21:09
The control that displays and controls the tabs is actually a custom control defined right in the 4E ruleset. In the latest 4E ruleset, this control is called "buttongroup_tabs".

To change the tabs, you need to define the icon resource that will be used to identify the tab, and the subwindow that will be activated when the tab is selected. If you want to add/remove tabs, you just need to add/remove XML tab entries for the custom control in your windowclass. Finally, the control will automatically activate the first tab on initialization unless you specify an alternate value in the activate XML tag.

Here is an example of how the control is used for tabs on the 3.5E mini character sheet.

<snip>

Regards,
JPG
Thanks. I thought that's what I'd already done, but I may have missed something. (I think I may have only edited the charsheet_ files and not the buttengroup_tabs.) I'll go and check if the version of 4e I'm using has that file and will be able to check hopefully within the next few days if that corrects the issue.

CelineSSauve
November 27th, 2012, 19:05
Is there a way to set the code so that the rectangles with "Name" and the other information is automatically there, on each tab, without having to include it in the code for those tabs?

Moon Wizard
November 27th, 2012, 19:33
I'm not sure I understand your question. Which rectangles are you talking about?

Every tab needs to have a subwindow defined for it and an icon for the tab text. Each subwindow needs a windowclass definition. Each windowclass needs all the fields defined that you want to see on that tab page.

Regards,
JPG

CelineSSauve
December 31st, 2012, 22:20
Well, I'm giving up on this. Likely for good this time. Each time I think I've found a bit of code that's finally fixed, it messes up another handful of things.

Oh well, I'll have to run PokTA with Excel and Google docs. Simpler, much cheaper.

Willot
December 31st, 2012, 23:37
Like reformatting your hard drive and re installing windows sometimes you just have to start from the beginning.

Rather than trying to modify an existing application, maybe try writing one from scratch that way it works the way you want it too.
Of course im not sure how far your skills at programming go.
But maybe start with excel write some macros and take it from there.

CelineSSauve
January 1st, 2013, 00:32
I had previously tried to find out what the very basics you need as far as files are concerned for a Ruleset, but no one seemed to know.

Even the help files for creating one work on the premise that you're modifying an existing one...

Herodian
January 24th, 2013, 21:18
Hey, Celine. I share your frustration at trying to make something new for Fantasy Grounds. I gave up on the two projects I had going, as well. The reference rule sets are years old and confusing. Every time I see a new version post I get excited, then I see it's just more new features for D&D only and feel kind of let down.

Trenloe
January 24th, 2013, 23:06
Have you tried using the Foundations Core ruleset as the starting point?

https://www.fantasygrounds.com/forums/showthread.php?t=15866

Herodian
January 25th, 2013, 00:38
Yes, I did, when it was first released, but there is so much there, and no comments in the XML to explain what's going on in it. Using the API docs and going more or less line by line through the character XML files, I was able to figure out how to get a character sheet set up that correctly saved and loaded characters from the DB, but I fell flat when I tried to figure out how to link my characters into the combat tracker. I might have been able to muscle through it eventually, but I ran out of stubbornness after wrestling it for a week and played gurps instead. :)