PDA

View Full Version : AD&D Ruleset



vodokar
November 11th, 2016, 23:44
Ok. I'm finally taking my first baby steps into this project. Already, I'm going to need some help.

I unzipped Castles_and_Crusades ruleset to another location and inspected the base.xml file. I then made a new base.xml file inside of an AD&D directory inside the Fantasy Grounds Data Folder ruleset directory.

The original C&C base.xml file is:

<root version="3.0" release="14" logo="logo.png">
<announcement text="Castles and Crusades\rCopyright 2014 Troll Lord Games" font="emotefont" icon="rulesetlogo_cnc" />
<announcement text="Castles and Crusades ruleset v3.2.0\rfor Fantasy Grounds\rCopyright 2015 Smiteworks USA, LLC" font="emotefont" icon="rulesetlogo_CoreRPG" />

<!-- Attributes -->
<description>
<text>Castles &amp; Crusades</text>
<author>Troll Lord Games, 2013</author>
<website>https://www.trolllord.com</website>
</description>
<importinfo>
<acceptfrom ruleset="Castles_and_Crusades" />
</importinfo>

<!-- Layers -->
<importruleset source="CoreRPG" />

with a bunch of include statements underneath.

I copied the above, not including the include statements to my new base.xml file and changed <importruleset source="CoreRPG" /> to read <importruleset source="Castles_and_Crusades" />

like so:

<?xml version="1.0" encoding="iso-8859-1"?>

<!--
Please see the license.html file included with this distribution for
attribution and copyright information.
-->

<root version="3.0" release="14" logo="logo.png">
<announcement text="Castles and Crusades\rCopyright 2014 Troll Lord Games" font="emotefont" icon="rulesetlogo_cnc" />
<announcement text="Castles and Crusades ruleset v3.2.0\rfor Fantasy Grounds\rCopyright 2015 Smiteworks USA, LLC" font="emotefont" icon="rulesetlogo_CoreRPG" />

<!-- Attributes -->
<description>
<text>Castles &amp; Crusades</text>
<author>Troll Lord Games, 2013</author>
<website>https://www.trolllord.com</website>
</description>
<importinfo>
<acceptfrom ruleset="Castles_and_Crusades" />
</importinfo>

<!-- Layers -->
<importruleset source="Castles_and_Crusades" />

</root>

When trying to start a test campaign, I am getting this error message:

16291

I knew this was going to be a painful process. :confused:

Moon Wizard
November 12th, 2016, 00:18
The reason why the importruleset tag is failing is because the ruleset name is "Castles and Crusades", not "Castles_and_Crusades".

I would not suggest inheriting directly from the Castles and Crusades ruleset, but actually make a copy and start changing stuff inside. Otherwise, your ruleset could break when C&C changes are made, and you'll be replacing almost everything anyway, so no need for overhead.


Make a copy of the Castles and Crusades ruleset folder.
Rename the new folder to 2E.
Change the base.xml description and announcement tags.
Load it up, and check that the announcements are changed. Now you've made your first change.
Start slowly replacing the C&C code with your own, and checking as you go.


Regards,
JPG

Trenloe
November 12th, 2016, 00:54
I would not suggest inheriting directly from the Castles and Crusades ruleset, but actually make a copy and start changing stuff inside.
But then he wouldn't be able to distribute the resulting ruleset.

Discussed in this thread: https://www.fantasygrounds.com/forums/showthread.php?34524-Interest-Check-for-Old-School-D-amp-D-ruleset It was first mentioned that building on top of C&C might be a good idea at the bottom of post #2.

vodokar
November 12th, 2016, 01:28
Getting rid of the underscores worked. I'm up and running.

If the name of the ruleset is Castles and Crusades, then why in the accept from statement does it state it as Castles_and_Crusades? Sorry if these are really dumb questions.

I can see the wisdom in either method, and naturally, the words of the Immortal Moon Wizard carries much weight. I believe for right now, however, I'm going to stick with trying to layer on top of C&C.

And, just for the record, this is a ruleset for AD&D 1e, not 2e.

damned
November 12th, 2016, 02:29
Stick with the plan man! Dont let the crazy moon guy derail you!

Trenloe
November 12th, 2016, 02:36
If the name of the ruleset is Castles and Crusades, then why in the accept from statement does it state it as Castles_and_Crusades?
Import info registers the additional <ruleset> tagged modules that this ruleset can also open. It appears that at some point here were some modules produced for an earlier ruleset which was called "Castles_and_Crusades" rather than the current naming of "Castles and Crusades". It'd recommend you include that old one (as there are some modules that use it) and also include an importinfo statement for the current "Castles and Crusades" ruleset to allow recent modules to be opened as well.

Info here: https://www.fantasygrounds.com/refdoc/importinfo.xcp

vodokar
November 12th, 2016, 03:38
I found this picture on rpg.net as being in public domain. Thought it might work for a logo and desktop image.

MODERATOR: IMAGES REMOVED

Trenloe
November 12th, 2016, 03:51
I found this picture on rpg.net as being in public domain. Thought it might work for a logo and desktop image.

16294
There's a difference between being available "publicly" to being able to be redistributed/used in products. There's a huge amount of "stuff" posted on the internet that, legally, you can't re-use/distribute. So, be sure that the copyright owner (I'm assuming Larry Elmore) has given permission for this image to be freely used by others in any products.

vodokar
November 12th, 2016, 04:02
This is the link I found it at. As far as I can tell, it is safe to reuse. But, more experienced eyes might be able to help.

https://forum.rpg.net/showthread.php?656970-Free-Public-Domain-TSR-D-amp-Desque-Art-Repository

vodokar
November 12th, 2016, 05:50
My progress so far. Not too bad for the first night. :)

MODERATOR: IMAGE REMOVED

This is really fun; when your not ripping your hair out.

Trenloe
November 12th, 2016, 05:53
This is the link I found it at. As far as I can tell, it is safe to reuse. But, more experienced eyes might be able to help.

https://forum.rpg.net/showthread.php?656970-Free-Public-Domain-TSR-D-amp-Desque-Art-Repository
Looks like the person who posted that is breaking the license agreement: "In no case may you distribute any of the files in the software by any other electronic means..."

If you'd purchased the original product (https://www.amazon.com/Character-Clip-Color-Customizing-Studio/dp/B000WWBGPE) then you could use the clip art in your own products. This material is not in the public domain - the book was published under the OGL but it specifically calls out the artwork as not being OGL.

If you didn't buy the "Character Clip Art & coloring Customizing Studio" product then you don't have a license to use the artwork.

You could always reach out to Larry and see if he'd let you use the artwork?

vodokar
November 12th, 2016, 05:55
Absolutely, I'll do what I can to do just that. Thanks for your advice. I've definitely heard of Larry and heard he is pretty cool. And the picture is just too cool. But, even if I can't use it, at least I learned how to place a decal and icon tonight.

Trenloe
November 12th, 2016, 05:56
I've definitely heard of Larry...
I should hope so too! :-o

vodokar
November 12th, 2016, 06:10
I found Larry's website and emailed him with the request.

Andraax
November 12th, 2016, 14:56
This is the link I found it at. As far as I can tell, it is safe to reuse. But, more experienced eyes might be able to help.

Reading Larry Elmore's license in that archive, it says that it can be used and re-published as long as the "Elmore" signature remains intact (provided you purchased the clip art pack from him).

vodokar
November 12th, 2016, 16:57
Cleaning up the image a little. Sure hope I get a positive response from Mr. Elmore.

MODERATOR: IMAGE REMOVED

Andraax
November 12th, 2016, 17:55
Cleaning up the image a little. Sure hope I get a positive response from Mr. Elmore.

Here's my take on it: MODERATOR: IMAGE REMOVED

Trenloe
November 12th, 2016, 18:06
Images have been removed until vodakar gets permission from the copyright owner to use said image/s.

As I mentioned in post #11 above:
This material is not in the public domain - the book was published under the OGL but it specifically calls out the artwork as not being OGL.

If you didn't buy the "Character Clip Art & coloring Customizing Studio" product then you don't have a license to use the artwork.

Andraax
November 12th, 2016, 18:15
I own the product.

Trenloe
November 12th, 2016, 18:19
I own the product.
Would have been nice if you told us. How would we know otherwise?

Andraax
November 12th, 2016, 18:21
Also, there is this on the site vodokar linked: "Larry Elmore has graciously allowed me to upload 178 images from his Character Clip Art and Color Customizing Studio (2002) to my FreeDnDArt collection of Public Domain art. These Larry Elmore images are not in the Public Domain, but there is a very generous license to use them. They can be used for just about anything- web pages, publications, software, games, etc."
https://freedndart.blogspot.com/2013/07/178-larry-elmore-images-added-to.html

Trenloe
November 12th, 2016, 18:27
Also, there is this on the site vodokar linked: "Larry Elmore has graciously allowed me to upload 178 images from his Character Clip Art and Color Customizing Studio (2002) to my FreeDnDArt collection of Public Domain art. These Larry Elmore images are not in the Public Domain, but there is a very generous license to use them. They can be used for just about anything- web pages, publications, software, games, etc."
https://freedndart.blogspot.com/2013/07/178-larry-elmore-images-added-to.html
Actually, if you follow the link in that post the page no longer exists so we don't know what the license was. All that is left is someone's take on a license that we can't see - and we know how differing people's opinion can be on public domain/OGL/copyright, etc.. The page that vodokar linked above includes a copy of the license that came with the purchased product and it is clear that you need to own the product to use the artwork.

Andraax
November 12th, 2016, 18:39
Actually, if you follow the link in that post the page no longer exists so we don't know what the license was. All that is left is someone's take on a license that we can't see - and we know how differing people's opinion can be on public domain/OGL/copyright, etc.. The page that vodokar linked above includes a copy of the license that came with the purchased product and it is clear that you need to own the product to use the artwork.

You'll note that this link: https://forum.rpg.net/showthread.php?656970-Free-Public-Domain-TSR-D-amp-Desque-Art-Repository (by the creator of the clipart library we're discussing) has links to both the blog that includes the note that Larry Elmore has allowed him permission to upload the clipart for others to use, and to the clipart library itself. Just because that (a bit old) blog post has an outdated link within it does not mean that the permission expired when the site was moved...

Trenloe
November 12th, 2016, 18:54
OK, thanks for referring to a link that actually exists - that helps a lot, thanks. :)

Can you point me to where Larry (himself) gave permission? All I see is a post (#178 in the blog) that says Larry has allowed him to upload images, but: "These Larry Elmore images are not in the Public Domain, but there is a very generous license to use them." The only license that we see is the one we've been discussing earlier. So, do we assume that license has now been transferred to anyone, or is it still as reads and that you must have purchased the product? We can't assume...

I think I'm going to wait until vodokar hears back from Larry...

Andraax
November 12th, 2016, 19:04
OK, thanks for referring to a link that actually exists - that helps a lot, thanks. :)

Can you point me to where Larry (himself) gave permission? All I see is a post (#178 in the blog) that says Larry has allowed him to upload images, but: "These Larry Elmore images are not in the Public Domain, but there is a very generous license to use them." The only license that we see is the one we've been discussing earlier. So, do we assume that license has now been transferred to anyone, or is it still as reads and that you must have purchased the product? We can't assume...

I think I'm going to wait until vodokar hears back from Larry...

The blog post says "They can be used for just about anything- web pages, publications, software, games, etc. Please do not upload them to other Clip Art collections without Larry Elmore's permission (as listed in the license which is included in the Larry Elmore folder)." Since this is a clip art library, it would normally be against the license to add the artwork, but Larry gave his permission to have that art added to *this* library. I find it hard to believe that Larry would give permission to have these images posted in an online clip art library, but then *not* be used by people who view the library... After all, he was giving permission to someone who is hosting an online clip art library to host his clip art... The restrictions against putting the images in another clip art library and also to include his signature are still in force, which is the reason for including the license.

Also, the link I provided is the same one in this post: https://www.fantasygrounds.com/forums/showthread.php?34976-AD-amp-D-Ruleset&p=300662#post300662

Trenloe
November 12th, 2016, 19:10
I think I'm going to wait until vodokar hears back from Larry...

vodokar
November 13th, 2016, 00:44
Sorry for causing such a ruckus. I'm doing everything that I can to take care of getting the proper permissions. I don't know Larry or if he will even respond. If he doesn't, or has a negative response, I will just have to do something else. It really sucks when you don't have any artistic talent. I will be able to navigate my way thru the coding part with some hard work, but nothing can grant me the talent for the artwork; just wasn't one of god's gifts to me.

Myrdin Potter
November 13th, 2016, 00:51
The person who put up the art posted in several places that he specifically had Larry's permission to do so and to follow the license that he posted. Under the terms of the license, you are probably safe to use an image from that archive. Elmore was a little late for AD&D and there are a ton of public domain pictures out there and you learned how to do the decal, so that mission is accomplished.

vodokar
November 13th, 2016, 00:59
I evidently can't tell the difference between "actual" public domain and what is labeled as being public domain, but maybe isn't. So, that leaves me with not really knowing what to do. Artwork is so integral to the feeling that we have for our hobby; especially one so nostalgic. I had hoped to do better than just totally generic. But, there is much more work to focus on. These questions will have to wait.

damned
November 13th, 2016, 02:00
The person who put up the art posted in several places that he specifically had Larry's permission to do so and to follow the license that he posted. Under the terms of the license, you are probably safe to use an I,age from that archive. Elmore was a little late for AD&D and there are a ton of public domain pictures out there and you learned how to do the decal, so that mission is accomplished.

Larry did some interior art in the 1e Monster Manual II and Greyhawk Adventures - they are the only ines I can confirm (after rustling through a bunch of 1e books!).

vodokar
November 13th, 2016, 02:47
Whether Larry was most famous for doing AD&D artwork or not isn't the issue. We all know he was probably most famous for his picture on the D&D basic set. I didn't choose Larry Elmore and then the picture. I searched for public domain pictures, chose the picture and noticed it was drawn by Larry Elmore. In an ideal world, I would choose the picture from the AD&D 1e players handbook, cause I have always loved that picture, and it's certainly the most iconic picture I know, but I don't see ever being able to get permission to use that from David Trampier (deceased) and TSR/Wotc/Hasbro. So, I simply found something that spoke to me.

vodokar
November 13th, 2016, 03:02
On another note, though. Your idea is paying off already, Damned. I have successfully been able to load the C&C Monsters and Treasure manual into my ruleset. Next, I'm going to start trying to dig into reworking the character sheet this week.

damned
November 13th, 2016, 03:27
On another note, though. Your idea is paying off already, Damned. I have successfully been able to load the C&C Monsters and Treasure manual into my ruleset. Next, I'm going to start trying to dig into reworking the character sheet this week.

Make sure you understand the how/what/when/where/why of this...

<windowclass name="xxxxxx" merge="join">

If I was doing this I would be changing the barest minimum.
I wouldnt move things from one tab to another - just change those exact fields you identified as needing changes for AD&D like AC and THAC0...

Myrdin Potter
November 13th, 2016, 05:07
I am pretty sure you are ok in using the image you like. If you are lucky, you will get an answer from him soon enough. The mods here are really strict on things like this because it is the official Smiteworks forums and they live on IP licensing so they have no choice but to err on the side of caution.

Trenloe
November 13th, 2016, 05:14
Having time to read the full info and not random posts all over the place, I'm inclined to agree - assuming that the agreement still stands (and that the agreement was valid in the first place - we don't have any info from Larry what the agreement was).

I'd still recommend that vodokar wait for a few days to see if Larry gets back to you. If he doesn't then go ahead and use the art, but in the ruleset provide a reference to where the graphic came from.

Myrdin Potter
November 13th, 2016, 07:50
https://www.dragonsfoot.org/forums/viewtopic.php?f=97&t=64230&sid=e68a804739b73d8a32b950a0140efae2

This is the clearest post I can find that supports using the clip art - the very first post in the thread. At a certain point you start to have a defendable case that you acted in good faith. Hopefully Larry will respond but this is why most artists hate giving except permission because people always follow-up when they thought they already answered by giving permission. :-)

leozelig
November 15th, 2016, 02:10
For AC, the calculation is performed in the campaign/template_char.xml file. It might be as easy as changing a plus sign to a minus sign for the calculateSources() function. I know you thought about leaving the underlying code intact and just displaying a different value, but the hit/miss calculation can be found near the bottom of the scripts/manager_action_attack.lua file and isn't overly complicated. I don't know if anything else would really be affected.

vodokar
November 15th, 2016, 03:48
Thanks so much Leo. I haven't yet gotten into it, but I have a feeling you just saved me loads of time trying to figure out where to look. The toughest part in all of this is the sad lack of documentation of what things do and where to find things. Tips like this are gold. And regardless how I end up solving the puzzle, it is extremely useful to understand how things work as they currently exist.

Trenloe
November 15th, 2016, 04:04
No one is going to provide documentation for a ruleset's code when 99.99999% of FG users would have no use for it.

This thread should help to identify the areas to look and give other tips on where to look for info: https://www.fantasygrounds.com/forums/showthread.php?19033-Modifying-the-3-5e-PFRPG-ruleset It is for the 3.5E ruleset, but is completely relevant for Castles and Crusades.

"Find in files" is your main resource to identify where things are in a ruleset - the search string is usually related to what you're looking for: attack, ac, etc..

Then if you are looking for code to do with a specific action (action being a specific type of roll) then look in scripts\manager_action_XXXXX.lua where XXXXX is the type of action: attack, damage, ability, init, etc.. And actions are defined at the top of scripts\manager_gamesystem.lua.

vodokar
November 15th, 2016, 05:10
Here is another sneak peak. As I don't want to give my friend Trenloe a heart attack, I am not showing the decal, but picture a head of a dragon that has been cut out of the background and set onto the desktop and colorized red.

Those that have gotten to know me and played in my games know I'm very meticulous. It isn't enough for me to just make something functional. As this is a labor of love, the appearance is very important to me also. I want it to look good, but especially evoke nostalgia. For this reason, I have chosen the background to be a similar blue as the Fiend Folio. The sidebar is similar to the lavender from the Deities and Demigods. The red dragon is, of course, reminiscent of the one that was on the Monster Manual. I've only replaced one icon, so far, on the sidebar and it is definitely not finished yet (need to finish colorizing and cut out of the background). I could have just chosen a book image for the library button, but an imp sitting reading a book seemed so much cooler.

Currently, the lead developer (me) is in an argument with the art director (also me) regarding the allocation of human resources on the project (also me). I plan to return to coding in the next day or so, but wanted to clean some of the images up just a bit more first. I'm glad I did, because it's really motivating to want to take the project to fruition.

16354

damned
November 15th, 2016, 05:47
The lead developer is most assuredly in the right here.

vodokar
November 15th, 2016, 05:55
Don't you worry, Damned. The lead developer will have his day to shine also. I'm not the type that gives up.

Andraax
November 15th, 2016, 17:06
OK, word has come down from Larry Elmore. I got an email from him today:


From: Larry Elmore <[email protected]>
Date: Tue, 15 Nov 2016 10:06:55 -0600
Message-ID: <CAKnoUa2=wnOP5WQQ83GFFQy=Kxp70z0s7YBgzfVi7CJMrkTXV [email protected]>
Subject: Re: New message from LarryElmore.com visitor
To: [email protected]

Yes, it is fine with me. I made that clip art book back then and they are
basically sold out, I may have a few in my basement. So it is OK if they
are posted for everyone to use.

Thanks for letting me know about this. I depend on people like you to
inform me when my art is illegally posted for sale around the world.

Thanks again,
Larry

On Sat, Nov 12, 2016 at 1:37 PM, <[email protected]> wrote:

> From: Mario Butter
> Email: [email protected]
>
> Your 2002 clip art library has been posted to the "FreeDNDArt" clip art
> library. The creator of this library has claimed that you gave him
> permission to post your art in this library. Can you confirm that this
> means that other people can use the clip art from this library in other
> works as long as they follow the original prohibitions (keeping your
> signature with the art and not posting to other clip art libraries).
>



--
Larry Elmore

Myrdin Potter
November 15th, 2016, 17:25
You may want to edit the post to take out the email addresses, otherwise spam bots will start sending spam your way.

Andraax
November 15th, 2016, 17:29
You may want to edit the post to take out the email addresses, otherwise spam bots will start sending spam your way.

My spam filters are pretty hardy; don't know about Larry's - so I edited...

Trenloe
November 15th, 2016, 17:40
Thanks guys - we did the right thing here, checking with Larry first - and he is appreciative of us doing so. Even when, on face-value, the FreeDnDArt posts suggested it was OK - we know that anyone can post whatever they want on the Internet. It's best to check with the source.

Game on! :)

vodokar
November 16th, 2016, 00:09
I can confirm also. It's glad to know that he is as cool as I have heard. He is going to be at Gary Con this year. If anyone is going, please say thanks to him.

Re: New message from LarryElmore.com visitor
To: [email protected]

Yes, you have my permission to use this piece. Thanks for asking.
Larry Elmore

On Sat, Nov 12, 2016 at 12:09 AM, <[email protected]> wrote:
From: Charles Minars ( 98.21.109.105 )
Email: [email protected]

Mr. Elmore,

I am contacting you with regards to a request to use a piece of your artwork in a project that I am working on. I am a user of the rpg virtual tabletop software Fantasy Grounds and am currently working on a computer ruleset that will allow people to play the AD&D 1e rules via this virtual tabletop. I located one of your black and white old school type drawings that really spoke to me. It is picture 102 from Character Clip Art & Color Customizing Studio Paperback – 2002, which is a picture of a Dragon Head. I wish your permission to utilize this picture as a graphic in my ruleset. The ruleset is a non-commercial endeavor. I can send you a screenshot, if you like, so that you can see what I want to do and also that your name is prominently displayed as credit for the artwork. It would mean a great deal to us if you could grant your permission for this.




--
Larry Elmore

vodokar
November 16th, 2016, 07:51
Latest Progress. Plugging away at it.

16393

Vackipleur
November 16th, 2016, 10:28
Latest Progress. Plugging away at it.

It's great ! Thank you very much :)

vodokar
November 17th, 2016, 00:04
You're welcome Vackipleur.

I also got a compliment from Larry Elmore when I sent him a screenshot. How cool is that.

16416

Varsuuk
November 17th, 2016, 04:14
i'm so excited about this :)

I love 1e (and played lots of early 2e as well, it a snob on that - was fun too)

I wish I had time to do this, I keep wanting to. But between learning tools i don't know (I'm a C++ dev for 20+ years now) and life/work - I know it would not get finished in time. If was in C++, i could get up to speed faster :(

vodokar
November 18th, 2016, 04:22
I need some help. Most of what I have done up to this point hasn't been too hard to figure out. But, now I am starting to get into things that I have no clue about.

The first puzzle I have come across is this: I added new number fields for saving throws. I wish to make them rollable.

Here is the section of the character sheet for reference: 16445

The pre-existing saving throws were the siege engine based attribute checks, which I made unrollable, since they don't apply anymore. Also disabled the siege engine prime and secondary attribute functionality.

I examined the code for the rollable attribute modifier as example. 16446

<template name="number_charabilitybonus">
<number_chartotal>
<anchored position="righthigh" offset="15,0" width="36" height="20" />
<hideonvalue value="0" />
<rollable />
<displaysign />
<modifiersize>mini</modifiersize>
<script>
function onSourceUpdate()
local nodeWin = window.getDatabaseNode();
local nCurrentScore = DB.getValue(nodeWin, "abilities." .. target[1] .. ".score", 10);
setValue(GameSystem.getAbilityBonus(nCurrentScore) + calculateSources());
end

function onInit()
addSource("abilities." .. target[1] .. ".score");
super.onInit();
end

function action(draginfo)
local rActor = ActorManager.getActor("pc", window.getDatabaseNode());
ActionAbility.performRoll(draginfo, rActor, self.target[1]);

return true;
end

function onDragStart(button, x, y, draginfo)
return action(draginfo);
end

function onDoubleClick(x,y)
return action();
end
</script>
</number_chartotal>
</template>


My code for the new saving throws is:

<!-- Template for Class Based Saving Throw Numbers -->
<template name="number_save">
<basicnumber>
<anchored position="belowleft" offset="0,12" width="32" height="20" />
<default>10</default>
<rollable />
<script>
function onDoubleClick(x,y)
return action();
end
</script>
</basicnumber>
</template>

<number_save name="paralyzation_save" source="save.paralyzation.score" merge="join">
<anchored to="dexteritybonus" position="insidetopleft" offset="50,0" />
<description textres="char_tooltip_str" />
</number_save>

Double clicking on the rollable saving throw field results in:

Script Error: [string "paralyzation_save"]:1: attempt to call global 'action' (a nil value)

I have not been able to track down this global. I know I am missing something, but no idea what.

Trenloe
November 18th, 2016, 04:51
action was a function in the original <script> section. You need to keep that function, and I'd also recommend keeping the onDragStart so that drag/drop of rolls is also available. You'll also want to keep the other functions onInit and onSourceUpdate so that the value of the control can be updated if there are any changes to the underlying database entry.

The action function will call ActionAbility.performRoll - you'll either need to modify that global package (scripts\manager_action_ability.lua) or, better option so you can still keep ability rolls, look to create a "save" action copying the manager_action_ability.lua into a new script "manager_action_save.lua" and make this a global package called ActionSave so you can use it in the XML action with function to roll the save - using ActionSave.performRoll similar to what ActionAbility.performRoll does in the code example in your post (#52).

Note: you'll also need to register "save" as a valid action with the GameSystem global package. The easiest way to do this is to put the following code in the onInit() function of the new manager_action_save.lua file: GameSystem.actions["save"] = { bUseModStack = true }; put this before the two ActionsManager.registerModHandler and ActionsManager.registerResultHandler calls (which will need to be changed from the "ability" action to the new "save" action).

This whole "action" process is probably one of the key things to Fantasy Grounds dice rolls - which you have to remember are asynchronous. The dice are rolled and the initial FG code ends - it doesn't pause to wait for the dice to roll. There is then a result handler that is triggered when the dice finally stop rolling and this will process the result, show success/fail for the save. It takes a while to get your head around it, but it is key to all dice rolling "actions" within Fantasy Grounds.

vodokar
November 18th, 2016, 05:30
16447

Trenloe, you sir, are my hero. ;) Yeah. It rolled. Doesn't tell success/failure yet. I'll have to work that out.

This is what I did to fix:

<number_save name="paralyzation_save" source="save.paralyzation.score" merge="join">
<anchored to="dexteritybonus" position="insidetopleft" offset="50,0" />
<target>paralyzation_save</target>
<description textres="char_tooltip_str" />
</number_save>


<template name="number_save">
<basicnumber>
<anchored position="belowleft" offset="0,12" width="32" height="20" />
<default>10</default>
<rollable />
<script>
function action(draginfo)
local rActor = ActorManager.getActor("pc", window.getDatabaseNode());
ActionAbility.performRoll(draginfo, rActor, self.target[1]);

return true;
end

function onDragStart(button, x, y, draginfo)
return action(draginfo);
end

function onDoubleClick(x,y)
return action();
end
</script>
</basicnumber>
</template>

I need some time to process the other information you gave me. I know it's priceless. Just don't fully understand it all yet. Growth is painful sometimes.

damned
November 18th, 2016, 05:40
16447

Trenloe, you sir, are my hero. ;) Yeah. It rolled. Doesn't tell success/failure yet. I'll have to work that out.


Doesnt the target number vary? In that case just roll and report the roll.



I need some time to process the other information you gave me. I know it's priceless. Just don't fully understand it all yet. Growth is painful sometimes.

Yep, yep, yep and yep.

vodokar
November 18th, 2016, 05:51
Doesnt the target number vary? In that case just roll and report the roll.

Generally speaking, Target number = your saving throw score i.e. if you have a score of 14 for Paralyzation, Poison or Death Magic, then you need to roll 14 or greater for success.

vodokar
November 18th, 2016, 11:38
It was a very successful night. Figured out a lot of stuff.

Things I got done:

Made Saving Throws Rollable.
Added a secondary strength stat i.e. 18 (100).
Linked both the primary and secondary strength stat when determining your strength modifier bonus for "to hit".
Dexterity and Constitution to use unique tables different from strength when determining modifier bonuses (for descending AC adjustment and HP adjustment, respectively).
Other odds and ends regarding the layout of the main sheet.

Next will be adding separate tables for determining strength damage bonus and dexterity range "to hit" bonus. Then will try to dig into the AC thing.

Pulled an all nighter. Going to bed now.

vodokar
November 19th, 2016, 02:15
I hit a snag again. I feel I am so close I can taste it, but just out of my grasp. I've tried everything I can think of and no such luck.

In Manager_action_ability.lua, I'm trying to make attribute rolls report success/failure based on comparing the current attribute score to the nFirstDie value. It works if I set a local variable = a number. But, I can figure no way to successfully pass a variable containing the attribute score to the onRoll function.

I tried examining how the onAttack function passes the nDefenseVal to applyAttack function in manager_Action_Attack.lua, but couldn't figure out what was going on or how I could implement something similar.

This works:

function onRoll(rSource, rTarget, rRoll, nAbility)
local rMessage = ActionsManager.createActionMessage(rSource, rRoll);
local nFirstDie = 0;
local nAbilityScore = 10;
if #(rRoll.aDice) > 0 then
nFirstDie = rRoll.aDice[1].result or 0;
end
if nFirstDie >= 20 then
rMessage.text = rMessage.text .. " [CRITICAL FAILURE]";
elseif nFirstDie == 1 then
rMessage.text = rMessage.text .. " [CRITICAL SUCCESS]";
elseif nFirstDie <= nAbilityScore then
rMessage.text = rMessage.text .. " [SUCCESS]";
else
rMessage.text = rMessage.text .. " [FAILURE]";
end

Comm.deliverChatMessage(rMessage);
end

But, of course, is useless.

Varsuuk
November 19th, 2016, 02:31
Real quick question since didn't get chance to read the threads (it expands faster than I have time to grok) - are you still building this as a ruleset overlay on C&C? Or did you copy it as Moon suggested then editing it?

I expect as others said, that if you copied it then edited, you'd only be able to use this as a "private" ruleset and while it would totally still be a rewarding effort - the rest of the folks would "has a sad" :)

vodokar
November 19th, 2016, 03:08
I shot for the moon and learned how to do a layered ruleset. I don't think it would matter as far as distribution goes, because I'm still having to change a lot of the code and the look will be totally different when I'm done -- C&C is still a very different iteration of D&D, actually based on the d20/3e engine, so there are a lot of differences from AD&D 1e.

Another sneakpeak and you'll likely understand at a glance: 1647116471

damned
November 19th, 2016, 03:12
Try something like this:

local nodewin = window.getDatabaseNode();
Debug.console("nodeWin: ", nodeWin);
local nAbilityScore = nodeWin.getChild(save.paralyzation.score).getValue
Debug.console("nAbilityScore: ", nAbilityScore);

vodokar
November 19th, 2016, 16:34
Unfortunately that didn't work. It still complained about trying to access a global variable that didn't exist or some such. For now, I'm tabling this, because you were right that it isn't that important to report success or failure on something that is already obvious (TN <= your attribute for attribute checks and TN >= than your saving throw number) and certainly not worth bringing the project to a screeching halt. Perhaps we'll figure it out later -- or not.

I did get a lot done yesterday despite spinning my wheels on that problem. Added some more stuff on the main sheet, moved stuff around, made Feats of Strength ("Open Doors" and "Bend Bars and Lift Gates") rollable with a D6 using a new Feats of Strength action.lua, Saving Thows implemented with a new Saving Throw action.lua IAW Trenloe's suggestions etc.

Next up, I need to dig into AC on the character sheet and make sure it's reporting properly with descending AC and then start digging into the engine to manipulate the AC calculation so that the descending AC from the character sheet is inverted for the engine to do it's thing. Also want to link up the saving throws with character level and character class so that they automatically populate with the proper numbers based on class and level.

Trenloe
November 19th, 2016, 16:55
local nodewin = window.getDatabaseNode();
Debug.console("nodeWin: ", nodeWin);
That will raise an error as nodeWin is a databasenode not a string. You can't use Debug.console on a databasenode type. Use nodeWin.getNodeName() to return a reference string to the databasenode https://www.fantasygrounds.com/refdoc/databasenode.xcp#getNodeName e.g. Debug.console("nodeWin: ", nodeWin.getNodeName());

Trenloe
November 19th, 2016, 17:35
In Manager_action_ability.lua, I'm trying to make attribute rolls report success/failure based on comparing the current attribute score to the nFirstDie value. It works if I set a local variable = a number. But, I can figure no way to successfully pass a variable containing the attribute score to the onRoll function.
1) Don't check success or failure against the first die, check against the roll total. This allows the modifier box to be used.
2) The standard way for FG to pass data as part of a roll is to put it in square brackets in the roll description text. Then parse this data out in the onRoll function.

For example, the following code will extract the save target number from a roll description. [SAVE:XX] is used to pass data, where XX is the save target number.


-- Get the save target number, stored in the roll description as [SAVE:XX]
local nSaveTarget = tonumber(string.match(rRoll.sDesc, "%[SAVE:(%d+)%]"));

if nFirstDie >= 20 then
rMessage.text = rMessage.text .. " [CRITICAL SUCCESS]";
elseif nFirstDie == 1 then
rMessage.text = rMessage.text .. " [CRITICAL FAILURE]";
elseif nTotal >= nSaveTarget then
rMessage.text = rMessage.text .. " [SUCCESS]";
elseif nTotal < nSaveTarget then
rMessage.text = rMessage.text .. " [FAILURE]";
end

The, in the getRoll function (before rolling the dice) you can add [SAVE:XX] to your original roll description. e.g. [SAVE:18] Paralyzation, Poison & Death Magic

https://www.fantasygrounds.com/forums/attachment.php?attachmentid=16484

vodokar
November 19th, 2016, 23:00
Now, I am really close. But, still not there.

In the Saving Throw Template:
<template name="number_save">
<basicnumber>
<anchored position="belowleft" offset="0,12" width="32" height="20" />
<default>10</default>
<rollable />
<script>
function action(draginfo)
local rActor = ActorManager.getActor("pc", window.getDatabaseNode());

local nodeWin = window.getDatabaseNode();
local nCurrentScore = DB.getValue(nodeWin, "save." .. target[1] .. ".score", 10);

ActionSave.performRoll(draginfo, rActor, self.target[1],nCurrentScore);

return true;
end

I try to get the saving throw value, store it in variable nCurrentScore and pass it to ActionSave.performRoll. No errors in doing so.

In manager_action_save.lua:

function performRoll(draginfo, rActor, sAbilityStat, bSecretRoll, bAddName, nCurrentScore)
local rRoll = getRoll(rActor, sAbilityStat, bSecretRoll, bAddName);

ActionsManager.performAction(draginfo, rActor, rRoll, nCurrentScore);
end

I tried to pass the variable nCurrentScore. Still no errors.

function getRoll(rActor, sAbilityStat, bSecretRoll, nCurrentScore)
local rRoll = {};
rRoll.sType = "SAVE";
rRoll.aDice = { "d20" };

local sActorType, nodeActor = ActorManager.getTypeAndNode(rActor);
if nodeActor then
if sActorType == "pc" then
rRoll.nMod = 0;
else
rRoll.nMod = 0;

end
end

local nSaveScore = nCurrentScore

rRoll.sDesc = "[SAVE:" .. nSaveScore .. "]";

and finally, in function Onroll:

local nSaveTarget = tonumber(string.match(rRoll.sDesc, "%[SAVE:(%d+)%]"));

If I set the value of nSaveScore = to a number, it works, but if I try to set it to the variable nCurrentScore, it tells me it is nil.

I know this is probably because you can't pass a variable like that. Is there a way to declare a global variable so that you can pass it from one function to another?

damned
November 19th, 2016, 23:40
That will raise an error as nodeWin is a databasenode not a string. You can't use Debug.console on a databasenode type. Use nodeWin.getNodeName() to return a reference string to the databasenode https://www.fantasygrounds.com/refdoc/databasenode.xcp#getNodeName e.g. Debug.console("nodeWin: ", nodeWin.getNodeName());

hmmmm..... i copied that from a piece of working code....

Runtime Notice: s'nodeWin: ' | databasenode = { charsheet.id-00006.clilist2a.id-00001 }

damned
November 19th, 2016, 23:43
Hi vodokar notice in my sample code (regardless of whether it is correct or not) it is 50% debug statements...
Add these liberally thru your code until you find where you are NOT getting the right info - nCurrentScore in this case... everywhere you are retrieving, setting or modifying this value place a debug command and then work out why its not being retrieved, set or modified...

vodokar
November 19th, 2016, 23:47
I don't know how to use debug or I would likely do that.

I am not sure wether the variable is nil because the original declaration didn't work or if it is a problem that the value can't be passed to where I need it, because it is a local variable. I assume the later, as I did not receive any error when I added your code into the template to retrieve the data to the variable. Trying to put the code into a function in the manager script doesn't work, though.

damned
November 19th, 2016, 23:54
I don't know how to use debug or I would likely do that.

You'd better learn. Its my main learning tool!

Debug.console part is case sensitive.
"Stuff inside the quote" will be written to the Console verbatim when that piece of code is called
, variablename will output the value of that variable or Nil
Debug.console("nodeWin: ", nodeWin);

To view the Console (if its not up already) type /console in chat
Better yet type /reload in chat and drag to F1 key, /save to F2 key, /console to F3 key and whatever roll or wheet you are working on to F4 key.
Youw ill save yourself hours just with that tip... trust me...

I litter my code with Debug.console() - I really should clean them up later on but they help me understand a little when I go back and look.

vodokar
November 19th, 2016, 23:59
I'll get to work on that.

Ok. Tried it. Now I'm feeling stupid. I did what you said and open the console. As soon as I click out of the console to make the roll, either from the character sheet or from the hotbar, the console disappears and doesn't collect any data.

vodokar
November 20th, 2016, 03:14
Yihah! Jester's Dead. ;)

I finally figured it out. Check this out.

function getRoll(rActor, sAbilityStat, bSecretRoll) rActor and sAbilityStat is being passed to the function

local sActorType, nodeActor = ActorManager.getTypeAndNode(rActor); in that function, nodeActor is getting that data

local nAbilityScore = DB.getValue(nodeActor, "abilities." .. sAbilityStat .. ".score", 0); I am now extracting that data from nodeActor

rRoll.sDesc = "[ABILITY:" .. nAbilityScore .. "]"; and concatting it to the roll description

which get's passed to function onRoll

local nAbilityTarget = tonumber(string.match(rRoll.sDesc, "%[ABILITY:(%d+)%]")); where I remove it from rRoll and change to a number

which gets passed thru this:

if nFirstDie >= 20 then
rMessage.text = rMessage.text .. " [CRITICAL FAILURE]";
elseif nFirstDie == 1 then
rMessage.text = rMessage.text .. " [CRITICAL SUCCESS]";
elseif nFirstDie <= nAbilityTarget then
rMessage.text = rMessage.text .. " [SUCCESS]";
elseif nFirstDie > nAbilityTarget then
rMessage.text = rMessage.text .. " [FAILURE]";
end

resulting in this:

16488

The reason I was having so many problems before is that I was trying to do this for the saving throws. It doesn't work there. I believe the issue with that is actually that "save" will have to be registered in Gamesystem with the list of possible options, just like "abilities" is listed there for strength, dexterity etc. Then it might work. At least now that I know it's possible to do, i'll figure out why it's not working in the other script.

damned
November 20th, 2016, 03:48
"His fitness report says it all. Flies by the seat of his pants, totally unpredictable."
;)

damned
November 20th, 2016, 03:49
Have you tested with Modifiers?
You may need to reread Trenloes post on nFirstDie vs nTotal

vodokar
November 20th, 2016, 04:34
I would use that if I could. When I try to use nTotal instead of nFirstDie, nTotal is nil. It doesn't appear anywhere in the entire manager_action.abilities.lua script. I haven't been able to figure out what is storing the ending die roll.

Nevermind, I got it.

if nFirstDie >= 20 then
rMessage.text = rMessage.text .. " [CRITICAL FAILURE]";
elseif nFirstDie == 1 then
rMessage.text = rMessage.text .. " [CRITICAL SUCCESS]";
elseif nFirstDie + rRoll.nMod <= nAbilityTarget then
rMessage.text = rMessage.text .. " [SUCCESS]";
elseif nFirstDie + rRoll.nMod > nAbilityTarget then
rMessage.text = rMessage.text .. " [FAILURE]";
end

So, back to the problem with the saving throws.

This works:

local nSaveScore = DB.getValue(nodeActor, "save.paralyzation.score", 10);

but this doesn't:

local nSaveScore = DB.getValue(nodeActor, "save." .. sAbilityStat .. ".score", 10); always defaults to 10.

It works in the manager_ability script, but not here. Likely the problem is with sAbilityStat. Can't figure out how to duplicate the same functionality in the save action script.

Trenloe
November 20th, 2016, 07:37
1) When I try to use nTotal instead of nFirstDie, nTotal is nil. Get total with: local nTotal = ActionsManager.total(rRoll);

Use this, not firstdie + mod. Otherwise you might have issues down the line (like with effects being applied to the roll).

2) local nSaveScore = DB.getValue(nodeActor, "save." .. sAbilityStat .. ".score", 10); always defaults to 10. What is sAbilityStat? If it's not "paralyzation" then it won't find save.paralyzation.score

3) You the following the wrong way round (see post #64):

elseif nFirstDie + rRoll.nMod <= nAbilityTarget then
rMessage.text = rMessage.text .. " [SUCCESS]";
elseif nFirstDie + rRoll.nMod > nAbilityTarget then
rMessage.text = rMessage.text .. " [FAILURE]";

leozelig
November 20th, 2016, 11:29
You don't need sAbilityStat for saving throws in AD&D. These are derived from a table, not an ability score, so you can skip all of that.

Trenloe
November 20th, 2016, 18:25
You don't need sAbilityStat for saving throws in AD&D. These are derived from a table, not an ability score, so you can skip all of that.
I think vodokar has just left that variable name to be the same as the original copied code. What I was trying to ascertain was if he'd changed the value of that string to the save database field name, or still had it as the ability name.

Assuming vodokar hasn't changed anything, the save targets will be new fields in the database, displayed on the character sheet as shown in the screen in this post:
https://www.fantasygrounds.com/forums/showthread.php?34976-AD-amp-D-Ruleset&p=301520&viewfull=1#post301520

These are being stored in the character sheet portion of the FG campaign database in: save.XXXXX.score where XXXXX is the reference name of the save. e.g. save.paralyzation.score.

From the code in post #76, it looks like the XXXXX is not being substituted properly. My question 2) in post #75 was trying to work out how the sAbilityStat variable was being populated - not assuming that it was containing the ability stat name, but asking vodokar to confirm that. It's just a variable name, it could be containing anything! ;)

vodokar
November 21st, 2016, 00:52
1) When I try to use nTotal instead of nFirstDie, nTotal is nil. Get total with: local nTotal = ActionsManager.total(rRoll);

Use this, not firstdie + mod. Otherwise you might have issues down the line (like with effects being applied to the roll).

2) local nSaveScore = DB.getValue(nodeActor, "save." .. sAbilityStat .. ".score", 10); always defaults to 10. What is sAbilityStat? If it's not "paralyzation" then it won't find save.paralyzation.score

3) You the following the wrong way round (see post #64):

elseif nFirstDie + rRoll.nMod <= nAbilityTarget then
rMessage.text = rMessage.text .. " [SUCCESS]";
elseif nFirstDie + rRoll.nMod > nAbilityTarget then
rMessage.text = rMessage.text .. " [FAILURE]";

1) Ah, so that's where nTotal comes from. I'll try that. I'm sure it was obvious to you, where it came from, but I had no clue.

2) If I knew that, the problem would be solved already. :)

This is what I know. In the original ability template, it calls "perform roll" with this:

local rActor = ActorManager.getActor("pc", window.getDatabaseNode());
ActionAbility.performRoll(draginfo, rActor, self.target[1]);

Then in the original script manager_action_ability.lua :

function performRoll(draginfo, rActor, sAbilityStat, bSecretRoll, bAddName)
local rRoll = getRoll(rActor, sAbilityStat, bSecretRoll, bAddName);

sAbitilty stat shows up, from where, i don't know, but it does contain data.

because in get roll:

function getRoll(rActor, sAbilityStat, bSecretRoll)

it shows up again and then gets used:

local nBonus = DB.getValue(nodeActor, "abilities." .. sAbilityStat .. ".bonus", 0);

to extract the ability score bonus.

and then here:

rRoll.sDesc = rRoll.sDesc .. " " .. StringManager.capitalize(sAbilityStat);

to build the roll description.

Now, it's obvious that sAbilityStat contains information regarding AbilityStats. Go figure.

But, I don't know where this variable actually came from.

3) the code you quoted is from the new ability score attribute check, which is roll under your score. i.e. a dexterity of 16 succeeds on 16 or less and fails on 17 and higher. AD&D didn't have a skill system (except thieves) and didn't really use attribute checks hardly ever, but if it was needed, you rolled under your attribute score either with a d20 or 3d6 or 4d6, depending on how the DM preferred. Thus, it's roll low is good. DCC RPG does the same thing.

Saving Throws, on the other hand, will be roll high is good. Quirky, I know, but I promised to try to be faithful to the original rules, with all it's little quirks.

vodokar
November 21st, 2016, 00:55
I think vodokar has just left that variable name to be the same as the original copied code. What I was trying to ascertain was if he'd changed the value of that string to the save database field name, or still had it as the ability name.

Assuming vodokar hasn't changed anything, the save targets will be new fields in the database, displayed on the character sheet as shown in the screen in this post:
https://www.fantasygrounds.com/forums/showthread.php?34976-AD-amp-D-Ruleset&p=301520&viewfull=1#post301520

These are being stored in the character sheet portion of the FG campaign database in: save.XXXXX.score where XXXXX is the reference name of the save. e.g. save.paralyzation.score.

From the code in post #76, it looks like the XXXXX is not being substituted properly. My question 2) in post #75 was trying to work out how the sAbilityStat variable was being populated - not assuming that it was containing the ability stat name, but asking vodokar to confirm that. It's just a variable name, it could be containing anything! ;)

Yes, it obviously does contain the ability stat name, but no idea how it is populated, hence, the source of the issue.

Trenloe
November 21st, 2016, 01:09
Going backwards - for #3, I think you're missing what I'm saying, because I agree with you - the code you posted is upside down, it succeeds on rolling less than or equal to the save and fails when rolling more than the save target. It's just a case of changing <= to >= for the succeed check. Just making sure you have the right code for checking success/failures.

vodokar
November 21st, 2016, 01:18
Going backwards - for #3, I think you're missing what I'm saying, because I agree with you - the code you posted is upside down, it succeeds on rolling less than or equal to the save and fails when rolling more than the save target. It's just a case of changing <= to >= for the succeed check. Just making sure you have the right code for checking success/failures.

As it is supposed to. That's the way Attribute Checks work. The higher your Attribute Score, the better chance of success.

For saving throws, you would be correct, because that is a roll >= to you saving throw number for success. The table of saving throws starts high and the numbers get lower as you level. Thus, the lower your number, the better chance of success.

Regardless, I totally appreciate everything you have done for me. I never would have made it this far without your guidance and it's been just the right amount. Steering me in the right direction, but allowing me the thrill of busting through a solution for myself.

Trenloe
November 21st, 2016, 01:21
2) If I knew that, the problem would be solved already. :)

This is what I know. In the original ability template, it calls "perform roll" with this:

local rActor = ActorManager.getActor("pc", window.getDatabaseNode());
ActionAbility.performRoll(draginfo, rActor, self.target[1]);

Then in the original script manager_action_ability.lua :

function performRoll(draginfo, rActor, sAbilityStat, bSecretRoll, bAddName)
local rRoll = getRoll(rActor, sAbilityStat, bSecretRoll, bAddName);

sAbitilty stat shows up, from where, i don't know, but it does contain data.
I've highlighted where this comes from - in the ActionAbility.performRoll function call, self.target[1] is the "ability stat name".

Going back to the original template that we started looking at in post #52: <template name="number_charabilitybonus">

When this is used to define a strength check, for example, the XML in the C&C ruleset is:

<number_charabilitybonus name="strengthbonus" source="abilities.strength.bonus">
<anchored to="strength" />
<target>strength</target>
<modifierfield>abilities.strength.bonusmodifier</modifierfield>
<description textres="char_tooltip_strbonus" />
</number_charabilitybonus>

Note the <target> field in the XML. This is what the self.target[1] above is referencing. This is a very powerful piece of functionality - the LUA script can access parameters defined in the FG XML.

So, assuming you're still using the new template mentioned in post #52: <template name="number_save"> you could add <target>paralyzation</target> to the XML definition of the paralyzation save (which will use the "number_save" template) and then you can access the string "paralyzation" using self.target[1] - so you can make all of the 5 different saves with essentially exactly the same XML defintion, but a different <target> value which stores the name of the save.XXXXX.score DB location for the save score.

Hope that makes sense? You're very nearly there - it's really just making the XML/LUA generic so that the template can specify the save <target> DB entry - which is there already using self.target[1].

Trenloe
November 21st, 2016, 01:23
As it is supposed to. ...
I think we're talking at cross purposes here. I'll wait for your final code - I thought I was trying to help pointing something out, but I think it's getting lost in the noise. Leave it for now... :)

vodokar
November 21st, 2016, 01:44
Got it working. You were right. I did have a target in the template, but as you can see here:

<number_save name="Save vs Paralyzation Poison or Death Magic" source="save.paralyzation.score" merge="join">
<anchored to="dexterity2bonus" position="insidetopleft" offset="50,0" />
<target>Save vs Paralyzation Poison or Death Magic</target>
<description textres="char_tooltip_str" />
</number_save>

it didn't match the data being saved.

Now changed to:

<number_save name="Save vs Paralyzation Poison or Death Magic" source="save.Save vs Paralyzation Poison or Death Magic.score" merge="join">
<anchored to="dexterity2bonus" position="insidetopleft" offset="50,0" />
<target>Save vs Paralyzation Poison or Death Magic</target>
<description textres="char_tooltip_str" />
</number_save>

and it now works.

Now to fix the rest of them.


"Did you see that sAbilityStat go?"

"Where did who go?"

And your explanation made perfect sense. You are a good teacher, sir.

Trenloe
November 21st, 2016, 02:01
And your explanation made perfect sense. You are a good teacher, sir.
Cool and thanks. :)

leozelig
November 21st, 2016, 02:03
I will second what damned suggested about learning to use the Debug.console function. This is very useful for tracking down where a variable is dropping out. Placing Debug.console(sAbilityStat); at various points in the code will show you where the value becomes nil.

For saving throws, just pass the label name (for the roll description) and the value of the field, which is the value needed for success. Since ability checks in AD&D involve rolling under your ability score with a d20, you only really need the ability label and score. Maybe I am misunderstanding the issue, but the code seems more complicated than it needs to be.

Trenloe
November 21st, 2016, 02:11
For saving throws, just pass the label name (for the roll description) and the value of the field, which is the value needed for success. Since ability checks in AD&D involve rolling under your ability score with a d20, you only really need the ability label and score. Maybe I am misunderstanding the issue, but the code seems more complicated than it needs to be.
I think we're just about there. We're not actually complicating things, it's just a case of copying the ability check (SIEGE check in C&C) code and modifying it to take the save target number and roll a d20 to try to equal or exceed that, and report the result. We're doing it the right way be creating a new action, which will allow modifiers (and possibly, down the line, effects) to automatically be accounted for.

We're basically there, and I don't think we're complicating things. You mention "just pass the label name (for the roll description) and the value of the field" - we are actually doing this.

Perhaps when you just skim the thread, it appears I'm making it seem complicated because I'm taking the time to explain the process and the theory, rather than just providing code that works. I like to teach people how to fish, rather than just give them fish! :)

vodokar
November 21st, 2016, 02:36
"I like to teach people how to fish, rather than just give them fish!"

And, that's just the way I like it.


Regarding the discussion about ability rolls. I think the reason you didn't understand what I was trying to say is because you don't know that I changed the rolls from the ability modifiers (seige engine style) to the actual ability scores i.e. strength, not strength modifier. Siege engine was d20 + ability modifier rolled over a Target number set by whether it is prime, secondary or none. AD&D style is roll under your ability score with no modifier. It will make more sense when you see it.

Next project:

I want to make saving throws automatically populate based on class and level. I already had a plan on how to do this. But, that plan entailed changing the target of the saving throw (currently targeting itself) to pointing to level. That will break the functionality we just created, if I do that, if I'm understanding things correctly. So, I'm going to have to find another way of doing that.

damned
November 21st, 2016, 02:41
"I like to teach people how to fish, rather than just give them fish!"

And, that's just the way I like it.


Regarding the discussion about ability rolls. I think the reason you didn't understand what I was trying to say is because you don't know that I changed the rolls from the ability modifiers (seige engine style) to the actual ability scores i.e. strength, not strength modifier. Siege engine was d20 + ability modifier rolled over a Target number set by whether it is prime, secondary or none. AD&D style is roll under your ability score with no modifier. It will make more sense when you see it.

Next project:

I want to make saving throws automatically populate based on class and level. I already had a plan on how to do this. But, that plan entailed changing the target of the saving throw (currently targeting itself) to pointing to level. That will break the functionality we just created, if I do that, if I'm understanding things correctly. So, I'm going to have to find another way of doing that.

Its your project so do the things that you want to but.... Id probably look at the other big things on your list first.... In many rulesets for a long time this stuff was changed manually by the user when you leveled up. Consolidate the learns you are doing/making now by doing the other more similar things first.

Trenloe
November 21st, 2016, 03:24
I want to make saving throws automatically populate based on class and level. I already had a plan on how to do this. But, that plan entailed changing the target of the saving throw (currently targeting itself) to pointing to level. That will break the functionality we just created, if I do that, if I'm understanding things correctly. So, I'm going to have to find another way of doing that.
The way I'd do this is to keep it like you have it now - i.e. storing the save target value in the database under "save.Save vs Paralyzation Poison or Death Magic.score" (perhaps shorten it to save.paralyzation.score - just for ease of programming and reference) and then populate that value in the database from a script that is tied to class and level. This is the next major step in FG development and understanding: everything should be data driven, with that data being stored in the database. The save fields you see on the character sheet are simply displaying the save.xxxxxx.score value stored in the database, and then triggering a roll against that value when you double-click on the field.

It is (relatively) easy to write code that will populate the save.xxxxx.score database fields in the background based off a class and level algorithm/table and the GUI will automatically update to display the newly calculated save scores. A little thought around interface design will be needed, as you don't want to always force an automated save score - always leave the option for the GM/player to be able to adjust based off abilities and house rules that FG doesn't cover.

vodokar
November 21st, 2016, 04:10
Understood. We are working on it now. Got Sir_CF writing up the script now (ah, it's good to delegate).

What we did is break out the template_save into separate templates for each of the saving throws. That way they each can have individual scripts. Thus, the targeting issue is avoided.

From there, I am making a get database call to pull the data for class and level. Already did something like this for con bonus, because there is a different table for fighter classes vs. nonfighters), so I know how it works.

Basically, the structure is this:

get the database node
get the class
if class = fighter then
get the level
find the saving throw in a table and set the value
elseif class = thief
etc.


Easy, but will take some time.

Trenloe
November 21st, 2016, 04:25
What we did is break out the template_save into separate templates for each of the saving throws. That way they each can have individual scripts. Thus, the targeting issue is avoided.
What issue?

vodokar
November 21st, 2016, 04:41
The one I mentioned in the previous post which we avoided by not using targeting. Nevermind. :)

vodokar
November 22nd, 2016, 08:14
Have you ever been 1 second from banging your head against the wall (figuratively) and then suddenly lightning strikes and you get a crazy whako idea and you try it and it actually works. That's what just happened to me.

Well, I was trying like heck to get the auto-population of the saving throws to work. Initially, I thought I could get away with trying to avoid using targeting, but that didn't work out. I was trying to maintain the rollability of the saving throw with the sucess/failure testing we finally got to work, while still being able to pull in level data to use to set the saving throw values. Doesn't seem to way to do that, because you need to self-target for the roll, but target something else in order to determine what to go in there.

So, I got the idea of making a second box - one box containing the saving throw value and having the script that targets the level data and sets the value and the second box having the roll script. Funny thing is, I could get it to work if I put the script in the function onInit but it would not work at all if I put the script in the OnSource Update function, which is where it needed to be. Then I tried reversing which box had which script. Still didn't work.

After racking my brain for hours and pouring over the code and resources, I was about to give up. I could not figure out why it would not trigger on source update.

Then lightning struck.

I decided to see what would happen if I simply self-targeted the first box and targeted to the first box with the second box and actually pulled in the saving throws into the second box instead of the first. Got that. I'll say it 5 times fast, so maybe you'll understand. :) I put the roll on the first box. I put the data-pulliing script in the second box and the data is going in the second box.

Presto.

If you set the level manually in the first box, it populates the saving throw in the second box based on your class.

Picture is worth a thousand words, they say:

16549

And this is how i did it:

<number_paralyzationlevel name="paralyzation" source="save.paralyzation.score" merge="join">
<anchored to="dexterity2bonus" position="insidetopleft" offset="50,0" />
<target>paralyzation</target>
<description textres="char_tooltip_str" />
</number_paralyzationlevel>

<number_paralyzationsave name="paralyzationsave" source="save.paralyzation.bonus">
<anchored to="paralyzation" offset="10,0" />
<target>paralyzation</target>
<modifierfield>save.paralyzation.bonusmodifier</modifierfield>
<description textres="char_tooltip_dexbonus" />
</number_paralyzationsave>

<template name="number_paralyzationlevel">
<basicnumber>
<anchored position="belowleft" offset="0,12" width="32" height="20" />
<rollable />
<script>
function action(draginfo)
local rActor = ActorManager.getActor("pc", window.getDatabaseNode());
ActionSave.performRoll(draginfo, rActor, self.target[1]);

return true;
end

function onDragStart(button, x, y, draginfo)
return action(draginfo);
end

function onDoubleClick(x,y)
return action();
end

</script>
</basicnumber>
</template>

<template name="number_paralyzationsave">
<number_chartotal>
<anchored position="righthigh" offset="15,0" width="36" height="20" />
<hideonvalue value="0" />
<modifiersize>mini</modifiersize>
<script>
function onSourceUpdate()
local nodeWin = window.getDatabaseNode();
local nLevel = DB.getValue(nodeWin, "save.paralyzation.score", 10);
local nCurrentClass = DB.getValue(nodeWin, "classes.slot1.name", "Thief");
if nCurrentClass == "Fighter" then
setValue(GameSystem.getSavingThrowsFighterParalyza tion(nLevel));
elseif nCurrentClass == "Thief" then
setValue(GameSystem.getSavingThrowsThiefParalyzati on(nLevel));
elseif nCurrentClass == "Cleric" then
setValue(GameSystem.getSavingThrowsClericParalyzat ion(nLevel));
elseif nCurrentClass == "Magic User" then
setValue(GameSystem.getSavingThrowsMagicUserParaly zation(nLevel));
else
setValue(GameSystem.getSavingThrowsMagicUserParaly zation(nLevel));
end
end

function onInit()
addSource("save." .. target[1] .. ".score", 10);
super.onInit();
end

</script>
</number_chartotal>
</template>

and finally, in the save action lua script:

local nSaveScore = DB.getValue(nodeActor, "save." .. sAbilityStat .. ".bonus", 10);


And lastly, for Damned, I made sure that the modifier mini box works just in case someone wants to house-rule modify saving throws or has some magic item etc. that effects it.

Nighty Night. :ninja:

Trenloe
November 22nd, 2016, 17:08
OK, I see where my confusion around you mentioning "targeting" comes from. In FG actions, targeting is a quite specific thing - you target another character/NPC and make a roll against that target creature. The action process (including targeting) is mentioned at a high level at the top of the CoreRPG scripts\manager_actions.lua file - and this is what the whole FG actions process is based on. Hence my confusion when you were going on about targeting - because I don't see the usual FG targeting system being used in saves - i.e. you don't initiate a save action against another creature, you roll for a save against your own saving throw value for the saving throw type (paralyzation, spells, etc.).

Now, to get back to your code. In this case, <target> is just a custom label that you are using. It has no specific functionality within Fantasy Grounds unless *you* program that functionality into the FG code. <target> is purely a way of re-using a control template again and again, with slightly different parameters - it allows the LUA code to access target[1] to get the string that is stored in that XML parameter and use it in the code.

The original idea behind this was to allow <target> to hold the name/type of the saving throw that would allow the code to refer to the relevant saving throw type database entry to get the saving throw (target) number - hence why in my examples I used <target>paralyzation</target> which would then be used in code to get to the save.paralyzation.score field in the charsheet database - change to <target>spells</target> and the code would then look at save.spells.score based off using the LUA: "save." .. target[1] .. ".score".

I think it might be less confusing to change <target> to <savename> or <savetype> and then change the LUA code to use savename[1] instead of target[1] as this has nothing to do with any FG targeting and we're all getting confused by referring to this as targeting.

vodokar
November 22nd, 2016, 19:15
I see what your saying now.

And that probably explains why I couldn't get this to work between anything other than the same types of data records i.e. you can link an ability attribute box and an attribute modifier box thru <target> or you can link the two saving throw boxes i'm using. But, it couldn't link the saving throw box and the level box using <target> because they aren't the same type i.e. not using the same control template.

Totally makes sense now. Yes, I also got confused on the word "target" and thought it somehow had more significance and power than it does.

Ok. So, anyway, my solution certainly is a little weird and not perfect. Not what I originally intended to do. But, it is functional and still saves a user from having to look up the saving throw numbers in the book.

If there is a way to actually have OnSourceUpdate() pull the data from classes.slot1.level, run it thru a function to change the number to the appropriate saving throw number and use that number to setValue of the save.paralyzation.score every time classes.slot1.level changes, I'm stumped.

It worked in the onInit function, just not in the sourceUpdate function. I believe it was because there isn't a way I know to tell sourceUpdate what source it is supposed to be watching for update other than by the use of <target> (or savename) with a record of the same control template.

In other words, if there is a way to tell sourceUpdate to watch the control box containing the data classes.slot1.level even though it is not from the same control template, and whenever that data changes to set the value of the saving throw, I don't know it.

Trenloe
November 22nd, 2016, 19:31
If there is a way to actually have OnSourceUpdate() pull the data from classes.slot1.level and use it to setValue of the save.paralyzation.score every time classes.slot1.level changes, I'm stumped.
Register a DB Handler for onUpdate in the control's onInit() function. Something like: DB.addHandler(DB.getPath(window.getDatabaseNode(), " classes.slot1.level"), "onUpdate", onSourceUpdate);

window.getDatabaseNode() will need to point to the specific charsheet.id-XXXXX node - so check exactly what window.getDatabaseNode() returns, you may need to remove any extra references after charsheet.id-XXXXX

Info on DB.addHandler: https://www.fantasygrounds.com/refdoc/DB.xcp#addHandler Do a search in the 5E ruleset for addHandler - there are lots of examples.
On DB.getPath: https://www.fantasygrounds.com/refdoc/DB.xcp#getPath

vodokar
November 22nd, 2016, 19:50
Ok. I think I get the theory. On init, set up the database handler and tell it to update on sourceUpdate. For the specifics of the practical use, that will take some study. Be back in a few hours.

vodokar
November 23rd, 2016, 00:56
I got it. Man, I owe you so much beer, Martin. :D I've learned so much about how the database works from this exercise.

function onSourceUpdate()
local nodeWin = window.getDatabaseNode();
local nLevel = DB.getValue(nodeWin, "classes.slot1.level", 0);
nSavingThrow = GameSystem.getSavingThrowsFighterParalyzation(nLev el)
setValue(nodeWin, "save.rod.score", "number", nSavingThrow);
end

function onInit()
local nodeWin = window.getDatabaseNode();
DB.addHandler(DB.getPath(nodeWin, "classes.slot1.level"), "onUpdate", onSourceUpdate);
end

Now to add all the if, then, else structure to it.

Trenloe
November 23rd, 2016, 01:09
Cool! :)

vodokar
November 23rd, 2016, 07:34
Wahoo! :D

Saving Throws are done. 16563

They auto-populate on source update of "class name" and/or "level number". They roll and check for success / failure. They even display in the chat in a user friendly expression i.e. "paralyzation" gets converted to read "Paralyzation, Poison or Death Magic Save" before sending to chat window. And they have a mini-modifier in case they need to be house-ruled.

Next project: Eat Turkey.

After that: on to tackle AC.

LordEntrails
November 23rd, 2016, 15:47
Congrats :) You should feel good. Enjoy your Turkey, just watch out for the pumpkin pie!

Trenloe
November 23rd, 2016, 16:42
Wahoo! :D

Saving Throws are done. 16563
Fantastic! :D

vodokar
November 24th, 2016, 00:07
just watch out for the pumpkin pie!

That's what the saving throws are for. :D

vodokar
November 26th, 2016, 02:41
If I want to delete this:

<number_charflatfootedac name="flatfootedac" source="ac.totals.flatfooted" merge="delete">
<anchored to="acframe" position="insidetop" offset="-15,100" height="30" />
</number_charflatfootedac>

How do I get rid of this?

<label_fieldtop>
<anchored to="flatfootedac" />
<static textres="acff" />
</label_fieldtop>

It doesn't accept "merge = "delete".

And doing something like:

<label_fieldtop>
</label_fieldtop>

does not get rid of it either.

Trenloe
November 28th, 2016, 16:37
Yeah, you can only use "merge" rules if the XML definition you want to modify has a "name" attribute - so FG can identify the exact XML definition to act on.

You could do a merge at the higher (named) level, replacing the whole of the XML within that XML definition section. At worst, replacing the whole <windowclass> entry.

vodokar
November 29th, 2016, 00:12
This was but one of many examples of labels that I can not delete. I can easily delete the object they were attached to, but not the label. So, If I am understanding correctly, the only way to delete them is to merge = delete the entire windowclass? Because there is no higher (named) level other than that.

Is there any way to keep the label, but make it not display the string text? The closest I have gotten is to change the string text to ".", but if you remove it completely "", it pulls the text from the lower ruleset.

The more deeply I get into this, I'm starting to realize that maybe Moon Wizard was right about his approach, simply because merging has issues that there don't seem to be good solutions for.

damned
November 29th, 2016, 00:57
This was but one of many examples of labels that I can not delete. I can easily delete the object they were attached to, but not the label. So, If I am understanding correctly, the only way to delete them is to merge = delete the entire windowclass? Because there is no higher (named) level other than that.

Is there any way to keep the label, but make it not display the string text? The closest I have gotten is to change the string text to ".", but if you remove it completely "", it pulls the text from the lower ruleset.

The more deeply I get into this, I'm starting to realize that maybe Moon Wizard was right about his approach, simply because merging has issues that there don't seem to be good solutions for.

There is sooooooooo much more work involved in building this ruleset from scratch. Sooooo much. The work required to modify this and basically extend it to support AD&D is tiny in comparison.
However you do have an issue with some fields as you have found.
This is a crappy hack but you could create an (one or many) object with very small dimensions and position it on a frame edge out of the way and anchor these objects with values of . to this object to keep them also out of the way.

Probably though you should replace the whole windowclass copying the class into your ruleset and removing those bits that are not needed.

Trenloe
November 29th, 2016, 01:14
Probably though you should replace the whole windowclass copying the class into your ruleset and removing those bits that are not needed.
Do this.

Then, keep a copy of the original file that you took the windowclass from - include it in your layered ruleset as <original filename>_C&C_320.xml. Then, when a future version of C&C comes out, you (or someone else down the line) can do a quick file compare to see if there are any changes a later C&C ruleset has introduced that might be worthwhile migrating into the AD&D ruleset.

Replacing the whole windowclass entry is probably less work now (you're not spending time working out how to get merge rules to work) and probably only a little bit more work keeping it compatible down the line. In a lot of respects, it might even be easier to keep a windowclass up-to-date, rather then working out (remembering?) how the merge rule should operate for the changes you made.

vodokar
November 29th, 2016, 01:28
Damned. Don't fret. I was just venting some frustration. I'm sticking with the plan, man.

Trenloe, at this point, I have changed so much stuff in the record_char_main.xml file anyways, I might as well just go ahead and make it a different file, so I'll do just what you said. Will most likely end up doing the same with the combat tab, as well.

Trenloe
November 29th, 2016, 01:36
Merge rules are handy for small changes. They get too complex (and have limitations) to use them to make a lot of changes within a windowclass.

Varsuuk
November 29th, 2016, 03:28
yes, when I rewrite portions of 3rd party libraries at work to do something we need specifically, I check the original file into Perforce so can do doffs anytime there is an update then I can hand merge from the new code to my mods if it applies.

Correct me if I am wrong, but simply copying the code from C&C (again, not to be confused with C+C ... I'm looking at you, sandwich lady...) wholesale to use as your base (NOTE: not referring to copying a window class to fix the merge issue, meant if you didn't do as an extension on C&C - I'm asking, not to be picky on something you are NOT doing anyway, but to be clear in case in future I thought too use such a commercial ruleset as a base and know the deal - but seemed obvious to me)

damned
November 29th, 2016, 05:31
Damned. Don't fret. I was just venting some frustration. I'm sticking with the plan, man.

Trenloe, at this point, I have changed so much stuff in the record_char_main.xml file anyways, I might as well just go ahead and make it a different file, so I'll do just what you said. Will most likely end up doing the same with the combat tab, as well.

Its much faster the second time around :)
And its only the XML you have to redo. The LUA is copy and paste.

damned
November 29th, 2016, 05:34
yes, when I rewrite portions of 3rd party libraries at work to do something we need specifically, I check the original file into Perforce so can do doffs anytime there is an update then I can hand merge from the new code to my mods if it applies.

Correct me if I am wrong, but simply copying the code from C&C (again, not to be confused with C+C ... I'm looking at you, sandwich lady...) wholesale to use as your base (NOTE: not referring to copying a window class to fix the merge issue, meant if you didn't do as an extension on C&C - I'm asking, not to be picky on something you are NOT doing anyway, but to be clear in case in future I thought too use such a commercial ruleset as a base and know the deal - but seemed obvious to me)

Yes - copying the whole commercial ruleset to use as a base for your new ruleset would not be cool.
The way you are doing it the authors of that original code are getting paid for their efforts and IP too.
It is still gray if you are copying larger chunks but I think you will probably be ok... you still have the +2 battle axe if they send goons after you... dont you?

vodokar
November 29th, 2016, 06:53
I'm not really worried about making new files for the two or three xml files we are referring to, because I have already modified the code in those files about 75% anyway, which is why it makes more sense to make them new files. The more I have learned about the code, the more I have realized how different the two games are. Just because C&C has an old school feel doesn't mean it actually has much in common with AD&D. By the time I am done with the project, you will not see much of anything that is from C&C, because many of the systems that were coded just don't apply. Despite this, I never could have done this without having a solid example of code to work from. It is the trying to decipher what they did that has taught me the greatest lessons. And, regardless, it will still be a layered ruleset having the dependency of the C&C ruleset, because I am only going to start new files on the things that are absolutely necessary and the reason it is necessary is because I want to delete things that I can't otherwise delete.

Varsuuk
November 29th, 2016, 07:23
No, I definitely did not mean to imply that YOU were doing anything that could be construed that way. You may recall I was like ??? when Moon suggested to just copy it (probably expecting you to use it for your own use not to publish to community or the like) - so was trying to better understand in case I played with coding in future.

Ya, first off - you are making an extension which, if anything, may get folks to buy their ruleset that might otherwise never play it. Secondly, you are copying window asset to modify it because cannot use the extension mechanism to do it cleanly, but it is a small amount and not being use as a "new standalone" ruleset - again, they need to also have C&C ruleset.

My non-legal-knowledge opinion says cannot find fault as extensions are allowed anywho.
Can't wait for this :) I wish I could have started on it myself. I actually bought the C&C ruleset to look at it and learn some to help me write one sometime. Turns out I got interested in playing C&C also :) Since then, I've bought both FG and TL modules/pdfs. All because I wanted to see if could make an AD&D ruleset someday.

vodokar
November 29th, 2016, 07:47
Yeah, C&C is a great game. I play it, Swords and Wizardry, DCC RPG, AS&SH. All great games. But, AD&D 1e is a void in my soul that screams to be filled. Hence, why I am putting myself through such torture. :)

And, speaking of which, I have been puzzling thru the code for the last few hours trying to find a seam in the wall to the solution for how to incorporate the Attack Matrix's, cause just nothing will do except doing things the authentic 1e way. Finally hit on the method. Now to fill in all the detail. I'll give more details once I'm closer to finishing. Going to bed now. Have to get up in 3 hours to go to work.

damned
November 29th, 2016, 11:11
Yeah, C&C is a great game. I play it, Swords and Wizardry, DCC RPG, AS&SH. All great games. But, AD&D 1e is a void in my soul that screams to be filled. Hence, why I am putting myself through such torture. :)

And, speaking of which, I have been puzzling thru the code for the last few hours trying to find a seam in the wall to the solution for how to incorporate the Attack Matrix's, cause just nothing will do except doing things the authentic 1e way. Finally hit on the method. Now to fill in all the detail. I'll give more details once I'm closer to finishing. Going to bed now. Have to get up in 3 hours to go to work.

When you get stuck its ok to go with a more manual method.
if later on you solve the problem lying awake in bed at 3.30am you can redo it the following day :)

vodokar
November 29th, 2016, 23:51
Absolutely, I find most of my best solutions when I give up and go to bed and it just pops out at me in a dream. Anyways, as I stated. I already located the secret door thru that wall (how to utilize the AD&D DMG class/level based attack matrixes instead of base to-hit bonus for combat). Got it working for the test case. Now to get it fully implemented. I'll give some more insight into it once I'm done.

vodokar
November 30th, 2016, 07:32
Here is a snapshot of the re-wiring of the combat system.

16704

As you can see, it is checking success based on the Descending AC of the target vs. the level (with class factored in) or HD of the attacker to arrive at the target number, per the DMG. If you have your books handy, you can check for accuracy.

It is also reporting Level or HD of the Attacker and the target number vs. the AC of the defender. I used our example from the saving throw text parsing to extrapolate how to extract that data and send it to chat. While that data isn't strictly necessary to play, I wanted to give people a warm fuzzy that all the math is done correctly, so being transparent enough that you can look it up in the book to double check should suffice.

All the coding is done on the combat system and functioning. But, now I have to actually fill out all those combat tables.

I feel as though I have reached the peak of the mountain (having tackled the combat system and AC System) and from here the journey will be downhill.

Trenloe
November 30th, 2016, 16:08
Very nice.

Do you plan on having the LVL and HD labels visible to the players?

Trenloe
November 30th, 2016, 16:09
Development note: remember to fire up a player instance and test out stuff you've done on the player side. Functionality that works on the DM side can very often not work on the player side - especially when database record access is concerned.

vodokar
December 1st, 2016, 00:05
Very nice.

Do you plan on having the LVL and HD labels visible to the players?

Ideally, I would make it an option for the DM to turn on and off. That likely wouldn't be too hard to work out, as there are lots of examples of that. Allowing it to show on the DM screen, but not visible to players, though, might be harder. I think it's important to give that information, at least to the DM, so he doesn't think little gnomes are just pulling numbers out of a hat. :)

Incidentally, I worked completely around the issue of C&C monsters having Ascending AC while AD&D monsters having Descending by simply converting everything to descending under the hood. No need to even worry about where the source of the monster is coming from, the software knows what to do with it.

Believe it or not, all of this turned out pretty simple. The main issue that I was having was finding where to insert my code at in the combat script. The combat script is written in two halves. In the first half, it gets the die roll, gets the data for the attacker to determine what to add to the die roll, then passes to the second half, where it forgets all about the attacker and looks at the defender to determine his defense value.

That works fine if your working with a bth bonus being added to the attack roll and the defenders AC and defense bonuses, because those things are totally independent of each other.

In AD&D, however, determining the target number requires information about the attacker and defender, both, at the same time. So, I needed to find a place in the script where both rSource and rTarget existed simultaneously. As it turns out, there is only one place in the script where that is true: function onAttack(rSource, rTarget, rRoll). Every other place in the script either didn't recognize who the attacker was or didn't recognize who the defender was, but in that one place, it knows both simultaneously, so it was fairly straightforward to piece together the code once I figured that out.

Also a great idea regarding testing from the player side.

vodokar
December 2nd, 2016, 07:24
I got all of the combat tables entered. Combat is pretty much nailed down and solid.

There is still much to work on, but, at this point, if a couple people would like to volunteer to run what I've got thru a playtest of the combat and abilities section --> try your hardest to break the thing and report back to me. I think we might be ready for that. Whomever might wish to do that should have their AD&D manuals handy so they can verify that all the math is correct and features working according the the manual.

Myrdin Potter
December 2nd, 2016, 08:31
I have the manuals and can help this weekend.

vodokar
December 2nd, 2016, 23:45
Awesome, Myrdin. PM me with your email and I'll send you the pak file.

Myrdin Potter
December 4th, 2016, 17:11
The ruleset loads up and basic combat seems to work ok so far. I am going to try each class and a variety of levels today. Takes a little while to make a character. My mind has converted to 5e now and I have to have my trusty PHB in hand as I do it.

That is always the unfortunate thing about the older editions. Since Smiteworks does not have the license for it, you can only make the frame and cannot include the details, the DM needs to slowly enter in. At least they did PDF of older modules and books.

leozelig
December 4th, 2016, 22:46
That is always the unfortunate thing about the older editions. Since Smiteworks does not have the license for it, you can only make the frame and cannot include the details, the DM needs to slowly enter in. At least they did PDF of older modules and books.

I ran an AD&D campaign for a couple years using the old OSRIC ruleset (but AD&D rules), and I entered the info a little at a time. I didn't do story entries or items, but my FG prep time was maybe 1 hour per module, if that, for 1-2 months of weekly games. It really is not a big deal with all the other ways FG saves time.

Myrdin Potter
December 4th, 2016, 23:13
I am slowly entering things like treasure tables and detailed encounter tables I can accumulated over the years. Each one takes a while, but once entered is always there to use.

I agree that, over time, you can slowly make what you have more and more detailed. But each GM needs to do it and there really are no legal shortcuts.

5e was super easy to start playing. Pay for the books and adventures and I was ready to go.

leozelig
December 5th, 2016, 12:51
If 5e was your first FG experience, it will definitely create high expectations. That sort of thing is a huge commitment that probably no other ruleset will offer. Maybe Unity will be different, but I think a lot of people who started with the 5e ruleset want the other rulesets to be "more like 5e."

Myrdin Potter
December 5th, 2016, 15:14
There is nothing wrong with wanting. :-) market realities are that 5e vastly outsells other systems with only Pathfinder being close and FG is not even "official" for PF. 5e not only attracted the most in company attention, a lot of the coding of off limits due to encryption (which is my understanding, I could be wrong) so harder to emulate in other rulesets.

There are three tiers - 5e with very full automation and parsing inside the program, the officially backed systems where the books are available and the community rulesets where the books are not.

Many of the community rules are quite good, there is just less online information available from the start.

Varsuuk
December 5th, 2016, 20:11
If 5e was your first FG experience, it will definitely create high expectations. That sort of thing is a huge commitment that probably no other ruleset will offer. Maybe Unity will be different, but I think a lot of people who started with the 5e ruleset want the other rulesets to be "more like 5e."


Not having much cross ruleset play experience, what are some examples of the 5e ruleset features that are not available on ones like 3.5,PFRPG,C&C/SW, etc?

I know for situations like 3.5, AD&D & AD&D 2.0 that you need to type in your own "content" as rules only are allowed not things like monsters, items etc.

leozelig
December 5th, 2016, 23:31
I assume things like dragging a class shortcut onto your character sheet when you gain a level and having all the abilities auto-populate, parsing spell descriptions into rollable attacks/damage/effects/healing, etc.