PDA

View Full Version : Ruleset Wizard - The new Ruleset development environment



Pages : 1 2 [3] 4 5

psicodelix
August 30th, 2021, 10:31
I'm afraid that's beyond the scope of the wizard, at least in the current state, since it involves campaign data.

Lensman
August 30th, 2021, 21:19
This is not something that can be done by extension/ruleset.

Thanks for the reply psicodelix & damned! While that is a bit disappointing, I understand. Hopefully, this will be something added to Fantasy Grounds in the not too distant future. :)

jharp
September 27th, 2021, 18:03
Feature request:

Ability to double-click a line in the code explorer (or maybe ctrl-double-click) and have the file with that line open and highlight as appropriate. So for lua it is that line. For a gui element it would be that element.
For lua files the ability to name the registration name instead of it being forced to be the name of the file. It could default to the name of the file.
Ability to turn off inclusion of RulesetWizardDiceRoller.lua in the build.


As always thanks for such a great tool.

Jason

psicodelix
September 28th, 2021, 08:14
Feature request:

Ability to double-click a line in the code explorer (or maybe ctrl-double-click) and have the file with that line open and highlight as appropriate. So for lua it is that line. For a gui element it would be that element.
For lua files the ability to name the registration name instead of it being forced to be the name of the file. It could default to the name of the file.
Ability to turn off inclusion of RulesetWizardDiceRoller.lua in the build.


As always thanks for such a great tool.

Jason

Requests s 1 and 3 are ok, added to the wish list.

Regarding the second, for me one of the most annoying things about the CoreRPG design is that the names of the files do not correspond to the names of the classes they contain, or to the name of the registered script. In my opinion it is something that only serves to cause confusion to beginner developers. As an example, what is the reason that the CombatManager script is in the manager_combat.lua file?


why do you want to have different names?

jharp
September 28th, 2021, 08:45
I've started to support some legacy code and it would be nice to be able to retain the structure as defined by the original developer rather than rename the files. For me I tend to want to name them the same but having a choice when needed would be nice.

Jason

psicodelix
October 4th, 2021, 08:30
I've started to support some legacy code and it would be nice to be able to retain the structure as defined by the original developer rather than rename the files. For me I tend to want to name them the same but having a choice when needed would be nice.

Jason

ok, I will think about it and see what I can do.

psicodelix
October 4th, 2021, 08:32
There is a new update! And version 0.7.7 is reached:

https://www.rulesetwizard.com/0-7-7-update/

damned
October 4th, 2021, 13:34
Some nice features man!

swest
October 15th, 2021, 23:45
Greetings,

On your website, on the 'disclaimer' page for the pre-release, under the free version limitations section, it states:

You donít receive automatic updates on new releases.

This implies that the paid-for version of Ruleset Wizard has automatic updates...

However, I just looked at the version number of my current Ruleset Wizard, and it is still back at 0.7.5.

So... how do we update Ruleset Wizard?

On a different topic, I am wondering if there might be a tutorial forthcoming on using the Radio List control? I haven't found one in your current collection of videos.

Having said that, I will also mention that I only just now noticed damned's extensive collection of tutorial videos. I definitely need to browse through those, as well.

Anyway, I'm only just getting started with this. While it is a daunting task (learning how to adapt a ruleset), I am making progress, and this tool is really helping.

Thanks!!

- s.west

shadoe42
October 15th, 2021, 23:48
Open up the Ruleset Wizard, You will see the button that is the Double arrow circle with have a red exclamation point... click that.





Greetings,

On your website, on the 'disclaimer' page for the pre-release, under the free version limitations section, it states:


This implies that the paid-for version of Ruleset Wizard has automatic updates...

However, I just looked at the version number of my current Ruleset Wizard, and it is still back at 0.7.5.

So... how do we update Ruleset Wizard?

On a different topic, I am wondering if there might be a tutorial forthcoming on using the Radio List control? I haven't found one in your current collection of videos.

Having said that, I will also mention that I only just now noticed damned's extensive collection of tutorial videos. I definitely need to browse through those, as well.

Anyway, I'm only just getting started with this. While it is a daunting task (learning how to adapt a ruleset), I am making progress, and this tool is really helping.

Thanks!!

- s.west

swest
October 16th, 2021, 00:00
Open up the Ruleset Wizard, You will see the button that is the Double arrow circle with have a red exclamation point... click that.

Hmmm... I don't see any anything that looks like that: 49487

(I've forgotten how to inline images...)

shadoe42
October 16th, 2021, 00:01
Interesting, my version is 0.7.8

psicodelix
October 16th, 2021, 08:32
Greetings,

On your website, on the 'disclaimer' page for the pre-release, under the free version limitations section, it states:


This implies that the paid-for version of Ruleset Wizard has automatic updates...

However, I just looked at the version number of my current Ruleset Wizard, and it is still back at 0.7.5.

So... how do we update Ruleset Wizard?

On a different topic, I am wondering if there might be a tutorial forthcoming on using the Radio List control? I haven't found one in your current collection of videos.

Having said that, I will also mention that I only just now noticed damned's extensive collection of tutorial videos. I definitely need to browse through those, as well.

Anyway, I'm only just getting started with this. While it is a daunting task (learning how to adapt a ruleset), I am making progress, and this tool is really helping.

Thanks!!

- s.west

Hi,

as shadoe42 pointed, if the wizard finds a newer version to download in its web site it should show the update icon. I you can't see it, it could be that the program is not able to resolve the URL https://www.rulesetwizard.com for some reason.Try again by holding down the Alt key right after clicking on the program icon to open it. This will force this update button to show up.
In any case you can download the latest version of the program from the website (direct link (https://www.rulesetwizard.com/wp-content/uploads/2020/09/RulesetWizardSetup.zip)) and install it yourself, the installer is the same for the demo version and the registered version.


Regarding the radio button control, the problem is that the CoreRPG version of that control is very limited, and it is somewhat disappointing when trying to use it. My plan was to make an improved version in a future update.

I'm glad you found the tool helpful.

swest
October 16th, 2021, 19:53
Hi,

as shadoe42 pointed, if the wizard finds a newer version to download in its web site it should show the update icon. I you can't see it, it could be that the program is not able to resolve the URL https://www.rulesetwizard.com for some reason.Try again by holding down the Alt key right after clicking on the program icon to open it. This will force this update button to show up.
In any case you can download the latest version of the program from the website (direct link (https://www.rulesetwizard.com/wp-content/uploads/2020/09/RulesetWizardSetup.zip)) and install it yourself, the installer is the same for the demo version and the registered version.


Regarding the radio button control, the problem is that the CoreRPG version of that control is very limited, and it is somewhat disappointing when trying to use it. My plan was to make an improved version in a future update.

I'm glad you found the tool helpful.

Thanks for responding.

I can't get the "Alt" key method to work... I have tried many, many times.

Yesterday, I tried multiple times to download your 'demo' version, but the download would not get past the first block. I tried to use the direct link you provided (above) and it behaves the same way. The download progress shows "0.1/17.5 MB" in the bottom bar, and that's where it stays.

So, there is clearly something wrong with my ability to get to that URL... I'll try a different browser (be right back) I tried the 'brave' browser, but it behaved the same way.

I have checked my security suite. I turned off the firewall. I have completed several other downloads during this period. For instance, my copy of paint.net automatically updated itself yesterday afternoon, after downloading its update package... so I know I can download data, in general.

I'm stumped here.

Thoughts?

- s.west

swest
October 16th, 2021, 20:09
Interesting... I just tried to do the download several times in a row, in rapid succession. The first time it hung at .2MB, the second time it hung at .3MB, the third time... it succeeded.

So, I have the RulesetWizardSetup.zip...

(I tried numerous additional times after that, and they all download immediately... weird.)

I have completed the update, and now it correctly shows version 0.7.8.

The 'update' icon is still not present, nor does the 'alt' key work to force the update icon to show up.

Anyway, I'm updated. Thanks for your attention to this.

Cheers,

- s.west

psicodelix
October 16th, 2021, 22:57
It's strange... anyway, if you finally managed to update it's fine.


As for forcing the update, you have to hold alt while the program loads, it seems strange that it doesn't work for you. In any case I will post in the forum the next update so you can check again if it works.

DarkKat
October 25th, 2021, 22:29
Is there a way to lock the vertical tabs on a sheet when you click the lock button?

Frodie
October 26th, 2021, 01:26
New to making mods. I want to add new spells to P2e. Will this help with that?

damned
October 26th, 2021, 02:27
Spells are mostly text...

psicodelix
October 28th, 2021, 15:22
Is there a way to lock the vertical tabs on a sheet when you click the lock button?

The locking is usually handled by the onLockChanged() function in your windowclass. In this function you could set the vertical tab readonly property as with any other control.

damned
October 28th, 2021, 15:55
This is a great product psicodelix - thank you for all your work on this and continuing to develop and improve it.

swest
November 13th, 2021, 21:52
@psicodelix

FYI, there appears to be a problem if you try to change the underlying image for a given 'frame'. No matter what you do, RSW wants to hang on to the original image. It will change the offset values just fine, but it won't change the image. It's not until you exit FG and RSW and come back in that it gets corrected.

(I have a much longer tale to go with this, if you're interested, but as I have a tendency to write excessively long posts, I'm trying to get better and just state the minimum facts.)

Thanks for a great tool!!

Cheers!

- s.west

psicodelix
November 15th, 2021, 08:13
@psicodelix

FYI, there appears to be a problem if you try to change the underlying image for a given 'frame'. No matter what you do, RSW wants to hang on to the original image. It will change the offset values just fine, but it won't change the image. It's not until you exit FG and RSW and come back in that it gets corrected.

(I have a much longer tale to go with this, if you're interested, but as I have a tendency to write excessively long posts, I'm trying to get better and just state the minimum facts.)

Thanks for a great tool!!

Cheers!

- s.west

Yes, that is a known issue. Keep in mind that RSW is continuously rendering frames, so graphics files are cached to gain speed. The problem is that without a file name change the system cannot easily detect that a file has changed. Including such a control would negatively affect performance.


However it is true that when you are working on the design of the ruleset it is necessary to make adjustments to your frames and have them reflected in the editor, and having to close the Wizard is annoying. Maybe the solution would be to add a button to tell the Wizard to reload one (or all) frames from disk.


What do you think?

swest
November 15th, 2021, 17:18
Yes, that is a known issue. Keep in mind that RSW is continuously rendering frames, so graphics files are cached to gain speed. The problem is that without a file name change the system cannot easily detect that a file has changed. Including such a control would negatively affect performance.


However it is true that when you are working on the design of the ruleset it is necessary to make adjustments to your frames and have them reflected in the editor, and having to close the Wizard is annoying. Maybe the solution would be to add a button to tell the Wizard to reload one (or all) frames from disk.


What do you think?

Thanks for the response, and the explanation.

If you're keen to 'fix' it (rather than leave it as a known consequence of file-caching), I would vote for the easiest, on you, fix you can think of. Perhaps just a 'clear caches' button?

Cheers,

- s.west

psicodelix
November 19th, 2021, 09:29
There is a new update!

https://www.rulesetwizard.com/0-7-9-update/

greybeardgunner70
December 6th, 2021, 03:56
My Harnmaster build is working great! A couple campaigns the last year or so, lots of fun!
I'm starting a new project, so get ready for some really knuckle dragger questions...

I would like to know if there is a setting or script I can include in a String Field that will have any entered text centered in the box. I have tried using the Frame Offset setting (ie 5,0,0,0) but all that does is push the entire box to the right 5 pixels, revealing the background color behind the box.
50209
50210

greybeardgunner70
December 6th, 2021, 04:05
Here are a few screenshots of the CS and CT changes I made, using Ruleset Wizard. These are for the Harnmaster ruleset, published by Columbia Games.
Main CS Tab:
50211
Combat Tab:
50212
Combat Tracker, pulling data from CS and NPC sheets.
50213

damned
December 6th, 2021, 04:06
Hey GBG

AFAIK you cannot centre string fields - only LABELS.
Have you shared your Harnmaster build?

greybeardgunner70
December 6th, 2021, 04:19
Its not a well enough refined product to "share," but it works for my group just fine. I have posted some screenshots. I am happy to share with anyone who wants to use what I have, and have done so in the past. But not a good enough product to post to the Forge, for example.

And just so I'm sure, there isn't a way to make a LABEL editable by the player, correct?

damned
December 6th, 2021, 04:47
Its not a well enough refined product to "share," but it works for my group just fine. I have posted some screenshots. I am happy to share with anyone who wants to use what I have, and have done so in the past. But not a good enough product to post to the Forge, for example.

I promise you - you are wrong. There are many people who would relish the opportunity to give it a try.


And just so I'm sure, there isn't a way to make a LABEL editable by the player, correct?

There are some editable labels on the MoreCore Character sheets.
I wouldnt use those in place of string fields though.
The MoreCore ones are meant to be Labels/Headings - but as its a multi purpose tool the headings need to be changeable.

psicodelix
December 6th, 2021, 08:59
My Harnmaster build is working great! A couple campaigns the last year or so, lots of fun!
I'm starting a new project, so get ready for some really knuckle dragger questions...

I would like to know if there is a setting or script I can include in a String Field that will have any entered text centered in the box. I have tried using the Frame Offset setting (ie 5,0,0,0) but all that does is push the entire box to the right 5 pixels, revealing the background color behind the box.



Hi GBG, just add a custom property to your string field and set the property name to center:

https://imgur.com/a/AlMOZEb

damned
December 6th, 2021, 09:09
What the!

psicodelix
December 6th, 2021, 09:18
:) yes, there are a few properties that are not included in the wizard because they have a very limited use. Perhaps this one could be included...

greybeardgunner70
December 6th, 2021, 14:56
I am working on a mashup of mechanics from a few different systems to create a modern combat system for homebrew use. The basis for small arms combat will be the Phoenix Command Combat System (PCCS). PCCS is a 90's game that's usually in the top 5 of any list you can find online for "most complex RPG ever." Its really more of a simulation than an RPG, and looks like the mechanics you would find behind the ballistics engine of a modern combat computer game or sim. Having almost 30 years of military and law enforcement experience, I can say however, that PCCS is the most accurate and "realistic" combat system I have found. Bottom line, it is very detailed with lots of tables, charts, and multiple steps to get to a "to hit" roll or "damage" roll. It will definitely put to the test any VTT development program (not to mention the developer). So I will be reaching out to tap into all the great experience and knowledge the folks in the community have. Feel free to send me a PM if you need any advice on how to setup a night ambush.

First hurdle. This is more of a question to get me pointed in the right direction. I haven't kept track of the great work psicodelix has done since I was able to use RW to create a viable Harnmaster platform in FGU (been too busy playing it), so this functionality may be in the myriad new features and options he has included and I am just not aware of them.

The process to determining a hit chance in PCCS is multi-layered, but one of the main steps is determining the number of modifiers that would affect the roll (range, target size, target movement, environment, etc). I want to list these modifiers on the CS and give the player the option of selecting them to determine a modifier total. (Kinda like the modifier window and the modifier box in CoreRPG, but on the CS.) I imagine this consisting of a list of modifiers and a total box. Each modifier would have a radial button next to it that tells the CS to add that particular modifier to the modifier total. My question is this: Does RW have the functionality to do this built in now or do I need to script it?

psicodelix
December 6th, 2021, 18:48
you can easily design the interface with all the CS options, but you will probably need a script to process those options.

damned
December 6th, 2021, 22:49
I dont think that will be too challenging greybeardgunner70
Complex resolution systems can be made so much easier for the GM and Players using a VTT - it sounds like a great project.

greybeardgunner70
December 7th, 2021, 15:51
Hi GBG, just add a custom property to your string field and set the property name to center:

https://imgur.com/a/AlMOZEb

This worked great thanks!

As to the other, I will continue to build out the combat tab and work out the scripting once all the pieces are in place.

1. I do have a question related to my Harnmaster build. I currently have the Order column on the combat tracker linked to the CS initiative box. However, in HM initiative is dynamic in that your initiative number can change with injuries, fatigue, etc. So tokens are constantly bumping up and down on the combat tracker during a round, making it difficult to keep straight who's turn it is and who's already had a turn that round. I would like to know if there is an example or tutorial that exists that shows how to replace the Order (initresult) function in CoreRPG and insert a function where I can assign each token a number for initiative order and then rearrange them by initiative at the end of the round (manually).

2. @damned Actually I see your MoreCore ruleset has some of the CT functionality I am looking for. How do I get a peek at how you created those? Do I just need to download it and export to RW? Or would I need your pak file?

3. PCCS uses lots of tables. I want to create a couple boxes the player can input data (say "Arc of Fire" and "Rate of Fire") and have the result from a chart in the ruleset appear in a third window ("Auto Fire Chance to Hit"). Do I create a table and script the CS to refer to the table? Or do I have to essentially script a response to each possible input from the chart? Any idea where I might find an example of either solution? Of course, the preferred method would be to have all of that scripted to a single button, say on the weapons list, but I feel like that's the Mariana Trench right now.

4. Is it possible to setup a "reset button" that clears the data from a given set of boxes, so they can be reused with different data?

Again, I feel like a lot of these answers are out there, and I am making my way through the tutorial vids, but if I can discover a shortcut to a resource or example by asking a couple questions, I'm going to. Really appreciate the product and your time!

damned
December 7th, 2021, 21:28
You can use the Init/Order that exists in this same way. You could set up an End of Round function to zero out everyones init and then retype them back in.

MoreCore has a no init option where you can put a flag against each actor as they act and you keep going until they are all ticked. The ruleset is unencrypted.

You can use the FG tables functionaility if you want dice to roll - look at rollon otherwise create Lua tables and use math.random under the hood.

Yes, again just right a function to zero out those values on click release.

greybeardgunner70
December 9th, 2021, 01:03
I think I will focus on expanding and refining the Harnmaster ruleset rather than creating the one for PCCS. It's probably just not possible given all the tables and charts that have to be consulted just to get to a single die roll. Maybe later when I have a better idea of how all this coding works. I would like to publish the HM ruleset but right now its a real mishmash of ruleset, extensions, and modules that would probably confuse rather than entertain. So I will try to clean all that up and have a more streamlined product. Plus I want to add some enhancements to the CS given what I have seen Damned do and what Psicodelix has added to the app.

Given that, I had a friend code the Harn rolls into an extension for the ruleset. I would like to integrate it into the ruleset, rather than have it as an extension. Can you provide some pointers on how I can add the scripts to the CS and ruleset? The extension he built includes 2 xml sheets with each button on charsheet_abilities and charsheet_notes defined. He then added a short script with directs how the d100 roll will display in chat as either a marginal success/failure or a critical success/failure. I have added images of some of his work below.
50250
50251
50252

If I follow along with Damned's tutorial on adding scripts and linking them to the CS, will the products from the extension work or will I need to do significant edits? I'm not knowledgeable enough to look at the script and see if it will link correctly. I think I will not need the data in the xmls and can just use the script.

damned
December 9th, 2021, 02:54
Hi greybeardgunner70

Without trying to read thru all your scripts please explain the roll mechanics to me in Plain English.

What dice do you roll?
What do you click to roll?
Then what do you do with the dice result?
What are you comparing it to?
What other factors come into play (modifiers, attributes etc)?

greybeardgunner70
December 9th, 2021, 03:05
Is there a specific way you have to add multiple functions to a window? Harn uses an average of three attributes to establish the skill base for a skill. Below you can see the script I added for endurance, acrobatics, and climbing. But it will only display in one (climbing, the last one), which makes me think it will only do one function without some added text. These work individually, so I know the scripts are correct. I just dont how to get them to all run at once.

function onValueChanged()
local nodeWin = window.getDatabaseNode();
local nstrength = DB.getValue(nodeWin,"strength_attribute",0);
local nstamina = DB.getValue(nodeWin,"stamina_attribute",0);
local nwill = DB.getValue(nodeWin,"will_attribute",0);
local nendurance = math.ceil((nstrength+nstamina+nwill)/3);

nodeWin.getChild("endurance").setValue(nendurance);

end

function onValueChanged()
local nodeWin = window.getDatabaseNode();
local nstrength = DB.getValue(nodeWin,"str_attribute",0);
local nagility = DB.getValue(nodeWin,"agl_attribute",0);
local nagilitytotal = math.ceil(nagility*2);
local nacrobaticstotal = math.ceil(nstrength+nagilitytotal);
local nacrobaticsaverage = math.ceil(nacrobaticstotal/3);

nodeWin.getChild("acrobatics_average").setValue(nacrobaticsaverage);

end

function onValueChanged()
local nodeWin = window.getDatabaseNode();
local nstrength = DB.getValue(nodeWin,"strength_attribute",0);
local ndexterity = DB.getValue(nodeWin,"dexterity_attribute",0);
local nagility = DB.getValue(nodeWin,"agility_attribute",0);
local nclimbingaverage = math.ceil((nstrength+ndexterity+nagility)/3);

nodeWin.getChild("climbing_average").setValue(nclimbingaverage);

end

greybeardgunner70
December 9th, 2021, 03:18
Hi greybeardgunner70

Without trying to read thru all your scripts please explain the roll mechanics to me in Plain English.

What dice do you roll?
What do you click to roll?
Then what do you do with the dice result?
What are you comparing it to?
What other factors come into play (modifiers, attributes etc)?

What dice do you roll? d100 with a modifier acquired from another part of the sheet (encumbrance penalty, for example) or the modifier dice roll box.

What do you click to roll? buttons and number fields depending on type of roll (button for attack rolls, number fields for skill rolls). Though I could make them all the same.

Then what do you do with the dice result? It just needs to display in the chat, nothing else.

What are you comparing it to? If dice roll result ends in a 5 or 0 it is a crit. Every other result is marginal. (Crit Success, Marginal Success, Marginal Failure, Crit Failure)

What other factors come into play (modifiers, attributes etc)? For skills its just a single penalty (usually encumbrance), but need to be able to add modifier from dice modifier window in FGU. Attack rolls can have multiple modifiers, most off the weapon table on the CS (attack modifier for the weapon, 1 or 2 handed modifier, etc), but again, need to be able to add a modifier to the modifier dice roll box.

damned
December 9th, 2021, 03:32
Is there a specific way you have to add multiple functions to a window? Harn uses an average of three attributes to establish the skill base for a skill. Below you can see the script I added for endurance, acrobatics, and climbing. But it will only display in one (climbing, the last one), which makes me think it will only do one function without some added text. These work individually, so I know the scripts are correct. I just dont how to get them to all run at once.

function onValueChanged()
local nodeWin = window.getDatabaseNode();
local nstrength = DB.getValue(nodeWin,"strength_attribute",0);
local nstamina = DB.getValue(nodeWin,"stamina_attribute",0);
local nwill = DB.getValue(nodeWin,"will_attribute",0);
local nendurance = math.ceil((nstrength+nstamina+nwill)/3);

nodeWin.getChild("endurance").setValue(nendurance);

end

function onValueChanged()
local nodeWin = window.getDatabaseNode();
local nstrength = DB.getValue(nodeWin,"str_attribute",0);
local nagility = DB.getValue(nodeWin,"agl_attribute",0);
local nagilitytotal = math.ceil(nagility*2);
local nacrobaticstotal = math.ceil(nstrength+nagilitytotal);
local nacrobaticsaverage = math.ceil(nacrobaticstotal/3);

nodeWin.getChild("acrobatics_average").setValue(nacrobaticsaverage);

end

function onValueChanged()
local nodeWin = window.getDatabaseNode();
local nstrength = DB.getValue(nodeWin,"strength_attribute",0);
local ndexterity = DB.getValue(nodeWin,"dexterity_attribute",0);
local nagility = DB.getValue(nodeWin,"agility_attribute",0);
local nclimbingaverage = math.ceil((nstrength+ndexterity+nagility)/3);

nodeWin.getChild("climbing_average").setValue(nclimbingaverage);

end

Combine them into one function onValueChanged()
Declare your variables one time only in the function and then do all the Math and setValues

greybeardgunner70
December 9th, 2021, 03:49
Ok thanks.

damned
December 9th, 2021, 04:16
What dice do you roll? d100 with a modifier acquired from another part of the sheet (encumbrance penalty, for example) or the modifier dice roll box.

What do you click to roll? buttons and number fields depending on type of roll (button for attack rolls, number fields for skill rolls). Though I could make them all the same.

Then what do you do with the dice result? It just needs to display in the chat, nothing else.

What are you comparing it to? If dice roll result ends in a 5 or 0 it is a crit. Every other result is marginal. (Crit Success, Marginal Success, Marginal Failure, Crit Failure)

What other factors come into play (modifiers, attributes etc)? For skills its just a single penalty (usually encumbrance), but need to be able to add modifier from dice modifier window in FGU. Attack rolls can have multiple modifiers, most off the weapon table on the CS (attack modifier for the weapon, 1 or 2 handed modifier, etc), but again, need to be able to add a modifier to the modifier dice roll box.

Start with something like this:

click on the field that will be rollable and enter the dice string in the bottom right (sorry not at my PC)
enter something like 1d100+{encumbrace_penalty}
tell it to use modifiers
tell it to clear modifier stack
publish and test rolls
do they work to that point?
rolling d100+penalty+modifiers?
if so then we work on the next bit

damned
December 9th, 2021, 14:54
hi greybeardgunner70

I made a video for you that will hopefully explain a few things for you and show you how you can break the tasks down into small bite sized chunks and work your way through it. It has examples of your current crop of questions.

https://youtu.be/COl8-_mRRHs

Also see the .pak file and a .zip of teh rulesetwizard project file

greybeardgunner70
December 9th, 2021, 16:44
Damned, great stuff, thank you! I was able to get the attribute calculations for Skill Base to work, so that's solved.
The vid and attached files are immensely helpful as well. I am not ready to tackle the actions (Notes) tab, so I tried to edit your managerRolls.Attack and create a managerRolls.Skillcheck. Note I took out the bit about subtracting encumbrance penalty, because the character sheet does that before the roll is made (the target number is pre-determined when the rollable field is populated). Please see below my script attempt and a screen shot of the error I received.

function Skillcheck(rSource, rTarget, rRoll)

Debug.chat("rSource: ", rSource);
Debug.chat("rTarget: ", rTarget);
Debug.chat("rRoll: ", rRoll);

Debug.chat("nSkilllevel: ", nSkilllevel);

local nResult = rRoll.aDice[1].result;
local sResult = '';

if nResult > nskilllevel then
Debug.chat("miss: ", nResult);
if nResult % 5 == 0 then
sResult = ' - Critical Failure ' .. nResult;
else
sResult = ' - Marginal Failure ' .. nResult;
end
else
Debug.chat("hit: ", nResult);
if nResult % 5 == 0 then
sResult = ' - Critical Success ' .. nResult;
else
sResult = ' - Marginal Success ' .. nResult;
end
end

Debug.chat("Result: ", sResult);

local rMessage = ActionsManager.createActionMessage(rSource, rRoll);

rMessage.text = rMessage.text .. sResult;
Comm.deliverChatMessage(rMessage);

return true
end

50259

damned
December 9th, 2021, 23:29
My example using the penalty was just an example and not necessarily your furnishings as in unfamiliar with it

Please spell out your skill check in plain English in detail and also provide a list of skills and also what dB fields you already have eg
Skill
Skill_mod

greybeardgunner70
December 10th, 2021, 00:02
Do images not work? Do you need me to paste in the actual text from the numberfields? Are you wanting to re-create it? I can send my rwp file if that works.

Three images: 1-3 are the three number fields that make up the Acrobatics skill. 1. skill base, 2. skill mastery level, 3. effective skill level (derived when physical and other penalties are applied to #1 x #2.)

Image 4 is the skillcheck script I wrote based on your attack script. I think, based on the error message I received, I am missing a command that points the function to #3.

50267
50268
50269
50270

greybeardgunner70
December 10th, 2021, 03:47
Is there a significant difference between these two lines? Is one more preferable? Seems I remember one of them won't cause you to get an error when its looking for a value (say an attribute) that hasn't been filled yet.

DB.setValue(nodeWin, "jog_range", "number", nJogtotal);

nodeWin.getChild("acrobatics_average").setValue(nacrobaticsaverage);

damned
December 10th, 2021, 04:19
I dont believe there is any real difference between the two methods - other than setting a default value.
I used to use the top version all the time and now it seems I use the second version all the time.

damned
December 10th, 2021, 13:57
Video Part 2

https://youtu.be/CH8hyImRBCE

In this video Im building a Skill List where the roll correctly references the Skill Name and Skill Score.

Below is the PAK and the RWP files.

TriOpticon
December 11th, 2021, 21:55
I have not watched all your tutorials yet but do any of them cover using the combat tracker? Thanks.

damned
December 12th, 2021, 01:00
Import the Combat Tracker Example.
I think some of the Advanced Fighting Fantasy videos get into the CT.

damned
December 12th, 2021, 05:08
Video Part 3

In this video we extend our skill list by making it into a campaign tool, setting up drag and drop, and linking to the skills from the character sheet.

https://youtu.be/sYbCr45BXZI

PAK and RWP files attached.

greybeardgunner70
December 12th, 2021, 14:05
Video Part 3

In this video we extend our skill list by making it into a campaign tool, setting up drag and drop, and linking to the skills from the character sheet.

https://youtu.be/sYbCr45BXZI

PAK and RWP files attached.

Damned, thanks for the great vids! These go a long way in helping with the code, which is the next learning point, once someone has RW more or less figured out. I am revamping my abilities tab and this will take awhile, but I hope to be applying what you've taught here in a few days.

damned
December 12th, 2021, 14:57
Damned, thanks for the great vids! These go a long way in helping with the code, which is the next learning point, once someone has RW more or less figured out. I am revamping my abilities tab and this will take awhile, but I hope to be applying what you've taught here in a few days.

Very good... cos I did them for you!

greybeardgunner70
December 12th, 2021, 23:18
Ghost of Buttons Past.

This is probably one for Psicodelix. I have gone back into my Harnmaster ruleset CS and deleted the "roll action" buttons on the skills tab and replaced them with rollable "numberfields." However, when the CS displays in FGU, the buttons are still visible. They aren't visible in RW and aren't listed in the Object Explorer.

Here is a screenshot of the CS in FGU:
50305

Here is a screenshot of the same page in RW:
50306

Any ideas?

damned
December 13th, 2021, 00:34
I dont know what is causing that issue but I do have a comment...

They way you have designed things works but it is very much the long way with you having to define each and every field for each and every skill.
The advantage is ofc that all your skills are already there on the sheet.
There is a way to programmatically populate skill lists also and that would be the best way I think (if you wanted to revisit this).

greybeardgunner70
December 13th, 2021, 01:51
I dont know what is causing that issue but I do have a comment...

They way you have designed things works but it is very much the long way with you having to define each and every field for each and every skill.
The advantage is ofc that all your skills are already there on the sheet.
There is a way to programmatically populate skill lists also and that would be the best way I think (if you wanted to revisit this).

I'm assuming you mean with a drag and drop method. I want to do that with weapons and armor, so after I tackle that, I might come back and redo the skills tab. I think the armor and weapons I can do pretty easily, as the drop would just fill in some pre-determined blanks on the CS. However, the skills require some math functions for each drop and I'm not ready to get that complicated yet. I'm still low crawling through getting the skills on the sheet to average a set of attributes and compute the EML when given a certain skill level. Baby steps. (And I've got tiny little baby feet. Adorable, but not really made for walking upright.)

Perhaps you discussed how to do this in your last vid post, I haven't watched all of it yet.

psicodelix
December 13th, 2021, 08:00
Ghost of Buttons Past.

This is probably one for Psicodelix. I have gone back into my Harnmaster ruleset CS and deleted the "roll action" buttons on the skills tab and replaced them with rollable "numberfields." However, when the CS displays in FGU, the buttons are still visible. They aren't visible in RW and aren't listed in the Object Explorer.

Here is a screenshot of the CS in FGU:
50305

Here is a screenshot of the same page in RW:
50306

Any ideas?

There is no reason for that problem, other than FG not picking up the updated ruleset file. First make sure you are generating the ruleset file in the correct folder. Also make sure you don't have a folder with the same name as the ruleset in the rulesets folder.

Naurthoron
December 13th, 2021, 14:51
Hi, I have an issue when trying to use the update button from the Ruleset Wizard interface.
The tool displays a screen that it is downloading the new version and then switches (likely at install) to this screen instead of executing the update install: 50313 and then nothing happens.
I end up downloading the installer for the new version myself from your website and install overwriting the old version.

damned
December 13th, 2021, 14:57
This might be fixed after you install this build...

damned
December 13th, 2021, 15:06
Or maybe not...

psicodelix
December 13th, 2021, 15:16
Hi, I have an issue when trying to use the update button from the Ruleset Wizard interface.
The tool displays a screen that it is downloading the new version and then switches (likely at install) to this screen instead of executing the update install: 50313 and then nothing happens.
I end up downloading the installer for the new version myself from your website and install overwriting the old version.

that window is an error when running the installer of the new version, I will check it.


In any case downloading the installer and running it as you have done has the same effect.

Naurthoron
December 13th, 2021, 15:18
Thank you, yes indeed it is just a convenience.

greybeardgunner70
December 13th, 2021, 17:35
Video Part 3

In this video we extend our skill list by making it into a campaign tool, setting up drag and drop, and linking to the skills from the character sheet.

https://youtu.be/sYbCr45BXZI

PAK and RWP files attached.

How would I script the "skilldetail" window to grab three designated attributes and average them and place that number in the first box (labeled "skillname_average" in my CS)? I have been using the script "onValueChanged" to have "skillname_average" grab the numbers but what would I need to script to have it simply go and retrieve what is currently in the attribute boxes? "getChild" or "getValue"?

Never mind... I looked at your RWP file and think I can figure it out.

greybeardgunner70
December 13th, 2021, 21:15
See image below for where I am at with abilities tab. This next question pertains to a nice to have but isn't necessary. I would like to divide the skills by category as they are in the published ruleset. Would this be as simple as renaming each skill_list? IE combat_skill_list, comm_skill_list, etc, so they use the same skillist/skilldetail functions, they are just seperated by the window they are dropped/created on?

50314

I am guessing to get the drag and drop to work with the Skill Base formula (attribute+attribute+attribute/3 = Skill Base), I will need to build "skill cards" with the correct script for each skill in the Skills library.

damned
December 14th, 2021, 00:48
Yes. 4 lists.
Do something like this:



function onInit()
onValueChanged();
end

function onValueChanged()
local nodeSkill = window.getDatabaseNode();
local sSkill = nodeSkill.getChild("name").getValue();
local nSkillBase = nodeSkill.getChild("skill_base").getValue();
local nSkillLevel = nodeSkill.getChild("skill_level").getValue();
nodeSkill.getChild("skill").setValue(nSkillBase*nSkillLevel);
end


then it will run through them all when you loa dup for the first time, i think it will also do it on creation then too.

I dont know what you mean about skill cards?

greybeardgunner70
December 14th, 2021, 01:35
OK, let me try to explain what I want to do.

I want to make character creation as easy as possible. I would like to automate as much of the math required to arrive at a Skill Base, Mastery Level and Effective Mastery Level, as much as possible. These three numbers are required for each skill. You've demonstrated how to set most of that up on the CS pretty well. The problem is just about every skill requires a different set of attributes and they will all have different mastery levels (input by the player). So for example, Jumping Skill Base is an average of Strength and Agilityx2. Rhetoric is an average of Voice, Intelligence, and Will. As we have discussed earlier, EML is the result of (SB x ML) - penalties. The SB is derived from attributes (per skill), ML is input by the player, and the penalties are pulled from other parts of the CS (mostly encumbrance and injuries). I have most of the math scripts for making that work figured out. The functions work on the current CS I am using in my campaigns, I just wanted to make character creation a little quicker/smoother.

In order to have the SBs calculated for the player when they entered the attributes, I was entering all the possible skills on the CS, along with the scripts. I like your method of having them enter the skills one at a time on a list. However, it really only works if they can drag the skill from a pre-made list and the script for determining Skill Base runs when they do that. So, a player would open the Skills list on the desktop, pick Jumping from the Physical Skills section, and drag and drop "Jumping" on the CS. It would then run a script getting the three required attributes, do the math and put that number in the first number box of the "skilldetail" window. When the player entered a Mastery Level, it would do the math to determine the EML.

damned
December 14th, 2021, 01:43
In your Skills Card add Attribute 1, Attribute 2, Attribute 3.
Now... this is where it gets funky...

You either put the script on the Attributes - and then you would be doing onValueChanged() scripts - or you use DB.addHandlers that run on the skills and watch teh attributes...

Let me think on it.

greybeardgunner70
December 14th, 2021, 03:29
It was a long shot I could figure this out on my own. I setup the 4 windows and changed the names (including on the iadd and idelete buttons). But they are still linked. When I click on the "iadd" button, it creates a listing in all four. First screen grab is of the "craft skills" window, second is of the craft skills window "iadd" button.

50318

50319

damned
December 14th, 2021, 04:24
They also need a unique Source
Or they can share a source but you apply a filter (more complex but has some advantages in some situations).

greybeardgunner70
December 14th, 2021, 12:22
OK, but "source" in this case is ".skilllist" which refers to the "Skills" window created on the desktop, correct? So I would have to create 4 separate "Skills" windows. That would just get to be too much I think, considering most are only going to have a few from each category. If that's the case, I will just have one skills window on the CS and not worry about keeping the categories.

damned
December 14th, 2021, 12:52
Why is it too much?
you have other lists for items and currency and languages.
there is no measurable overhead in adding another list inside the xml

.skillphysical
.skillcombat
.skillcommunication
.skillcraft

greybeardgunner70
December 14th, 2021, 15:04
Why is it too much?
you have other lists for items and currency and languages.
there is no measurable overhead in adding another list inside the xml

.skillphysical
.skillcombat
.skillcommunication
.skillcraft

Changing those worked just fine.

I'm getting what's in the code and what's displayed on the desktop confused. Not sure how what's in the code is linked to the "Skills" FGWindow that appears on the desktop. You had added a "Spells" FGWindow as another window in your example, so I thought that was the "source" and so would have to create FGWindows for each type of skill, rather than all of the categories being displayed in the singular "Skills" FGWindow on the desktop.

I'm beginning to understand there are reams of code in the CoreRPG ruleset and RW simply adds to or replaces that code. So without a firm understanding of how the CoreRPG code works, some of the linkages in RW don't seem complete or make sense. On the surface its not a big deal, I've been using a ruleset created in RW for a year now, but when you start getting into more complicated functions it can get confusing. That's my current level of understanding anyway. I could be way off in that as well.

greybeardgunner70
December 14th, 2021, 16:40
There is no reason for that problem, other than FG not picking up the updated ruleset file. First make sure you are generating the ruleset file in the correct folder. Also make sure you don't have a folder with the same name as the ruleset in the rulesets folder.

Noob mistake. I had an extension running which was calling for those roll fields so it was keeping them on the CS. Disabled extension, problem solved.

greybeardgunner70
December 14th, 2021, 16:54
I am trying to make the skill list windows grow and stack with each other. However, I keep getting the error that the skill list window is an "uncalculated control"

I have followed Psico's tutorial for setting up stack controls, so perhaps there is something with the list that creates the error?

50325

50326

50327

psicodelix
December 14th, 2021, 17:01
I am trying to make the skill list windows grow and stack with each other. However, I keep getting the error that the skill list window is an "uncalculated control"

I have followed Psico's tutorial for setting up stack controls, so perhaps there is something with the list that creates the error?

50325

50326

50327
I can't see the attached pictures. Anyway, check the order of the controls in the object explorer, they must be in the same order as you see them in the design window to make the stacking work properly.

greybeardgunner70
December 14th, 2021, 17:17
I can't see the attached pictures. Anyway, check the order of the controls in the object explorer, they must be in the same order as you see them in the design window to make the stacking work properly.

OK, that worked. Thanks!

damned
December 14th, 2021, 21:34
I'm getting what's in the code and what's displayed on the desktop confused.

Almost every ruleset works this way, CoreRPG does a huge amount of work in every ruleset.

Look how big CoreRPG is compared to D&D 3.5E

greybeardgunner70
December 14th, 2021, 22:07
@damned Do any of your tutorials cover drag and drop items? Like from a skill list or item list onto a CS?

damned
December 14th, 2021, 22:17
Cover in what way?
Video 2 and 3 that I just did cover it.
It is in many videos.

greybeardgunner70
December 15th, 2021, 13:33
1. Apologies, the features I have copied/created based on your vids wont allow me to drag a skill I have created in the "Skills" window and drag it onto the CS, something you clearly demonstrate in your AFF vids. Answered: I had missed inputting the "class" for the "accept drop down" option.

2. I want to create drag and drop skills in the "Skills" window that the player can select and drag onto the CS. I understand how the "skill_detail" FGWindow works and have it working on the CS. That is an easy way to have the player add skills to the CS, but they have to enter all the data themselves. I want to automate the averaging of the required attributes for each skill when dragged onto the CS. In HM, all skills have unique sets of attributes that are used to derive the Skill Base. Does this mean I need to setup a separate "skill_detail" FGwindow for each skill (ie "sword_detail" or "agriculture_detail")? Each separate "skill_detail" window would have a script that runs the math function to average the required attributes and input it on the CS.

3. I have a similar question with regards to the managerRolls.Skill function. I essentially have two set of skills and skill rolls on the CS. The first is the type you have laid out in your vids which allows for adding a "generic" skill line with the requisite drag and drop and success/fail rolls. The second type would be a list of pre-generated skill lines that are either "automatic skills" in game terms (and already on the base CS) or drag and drop skills that I mentioned in #2 above. The question I have with the managerRolls.Skill function is that it is setup so that "SkillScore" is what it is comparing the roll too, which it gets from the "skill_detail" window. However, for the pre-gen'd skills, "SkillScore" can't be what the target number is called. They will all be unique (IE sword_eml or agriculture_eml). Does this mean I will need, as above with the "skill_detail" windows, have to script a managerRolls._____ for each pre-gen'd skill?

damned
December 15th, 2021, 23:14
Hi greybeardgunner70 did you watch the last 3 videos I made - the last one is on this drag and drop.

You will need to decide which way you are going to do this. There are several ways. I would probably be trying to do something like have each skill_detail include 3 fields attr1, attr2, attr3 and then you program all rolls to do whatever the math is across the three.

In my recent videos I believe I show you how to do this without having xyz_eml and abc_eml stat names
You just have eml and the roll references itself and grabs the eml

greybeardgunner70
December 16th, 2021, 12:36
I will want to display the Skill Base, Mastery Level, and Effective Mastery Level for the player, so those computations will have to be displayed prior to the roll. Which means the script for those computations will have to be run on the drag and drop. I'll play with it some and see what I can get done. I may have to do some copy/paste for each skill but that won't take too long.

See attached image. I want the drag and drop to display like the automatic skills do on the current CS. "Condition" would be how the drag and drop looks (with the SB calculated on drop). Climbing would be how it looks after the player enters their Mastery Level. The EML field will be the rollable field.

50347

damned
December 16th, 2021, 12:59
Look at posts 569, 571 and 585

greybeardgunner70
December 16th, 2021, 15:18
Look at posts 569, 571 and 585

Thanks! I'll do some work. This is still very much like trigonometry to me, so often I don't even know when I'm looking right at the answer I need. I appreciate your patience and assistance.

greybeardgunner70
December 16th, 2021, 18:50
Thanks! I'll do some work. This is still very much like trigonometry to me, so often I don't even know when I'm looking right at the answer I need. I appreciate your patience and assistance.

I spent a few hours working on this this morning. I dont believe I can get there from here. From what I can tell I need an individual dragndrop "skill card" for each skill, with the required attribute calls from the CS and math/roll scripts baked into each. I'm not knowledgeable enough to figure out how to make that work, and I don't want to keep taking up your time. I DO know how to make it work if I put all the skills on the CS, like you did with your Cyberpunk ruleset. I will work that up, and then probably ask for your assistance in getting the rollsmanager script to work properly will all the rolls. But let me take a stab at it first.

swest
December 16th, 2021, 18:58
@damned's latest videos were particularly timely for me, as I have been preparing for the 'skills' portion of my ruleset.

So far I have most everything working as advertised: Creation of the sidebar entry for Skills; drag'n'drop from Skills to the CS; using 'iadd' to add a new skill to the skill list; and opening the skill from the various links.

Unfortunately, I am unable to get the idelete portion working. Specifically, clicking on the iedit icon correctly causes it to change states (Edit List, Stop Editing List) and colors. However, it never lights up the idelete button on the skill list entries.

Has anyone else experienced problems with this control?

Thanks!

- s.west

greybeardgunner70
December 16th, 2021, 20:18
@damned's latest videos were particularly timely for me, as I have been preparing for the 'skills' portion of my ruleset.

So far I have most everything working as advertised: Creation of the sidebar entry for Skills; drag'n'drop from Skills to the CS; using 'iadd' to add a new skill to the skill list; and opening the skill from the various links.

Unfortunately, I am unable to get the idelete portion working. Specifically, clicking on the iedit icon correctly causes it to change states (Edit List, Stop Editing List) and colors. However, it never lights up the idelete button on the skill list entries.

Has anyone else experienced problems with this control?

Thanks!

- s.west

I had to scrutinize it a couple times myself. Be sure your naming conventions all match up and you set up the custom control properties correctly. Sounds like the button is working as it should, it just doesn't know what to edit...

swest
December 16th, 2021, 21:36
I had to scrutinize it a couple times myself. Be sure your naming conventions all match up and you set up the custom control properties correctly. Sounds like the button is working as it should, it just doesn't know what to edit...

Yeah, I've been over it several times. I may have a complicating factor in that I have 3 separate windowlists on the same page, each with its own pair of iadd, iedit buttons... The iadd buttons all work correctly, dropping a new skill_detail into their respective windowlists (which each have their own data source.)

Thoughts?

- s.west

damned
December 16th, 2021, 21:57
I spent a few hours working on this this morning. I dont believe I can get there from here. From what I can tell I need an individual dragndrop "skill card" for each skill, with the required attribute calls from the CS and math/roll scripts baked into each. I'm not knowledgeable enough to figure out how to make that work, and I don't want to keep taking up your time. I DO know how to make it work if I put all the skills on the CS, like you did with your Cyberpunk ruleset. I will work that up, and then probably ask for your assistance in getting the rollsmanager script to work properly will all the rolls. But let me take a stab at it first.

Hi greybeardgunner70 what is the actual formula for the skills?
I believe that some are the average of a+b+c while others are the average of x+2y?
If that is the case then the average of a+b+c works in all cases.
Add to the skill_detail window a field for Attribute 1, 2 , and 3.
Set the formula to calculate onDrop (and maybe onInit also).
Then you will need to add a function on each attribute on the character sheet
Something like onValueChanged() read the list of skills and run the update formula on each skill
That should cover all the scenarios... I think

The way I did CPRed is ok when the skill list is always the same, but less desirable any other time.

swest
December 16th, 2021, 22:06
On my idelete problem, another interesting puzzle is that the idelete icon on my skill_detail becomes un-delete-able in Ruleset Wizard. It acts as if it isn't there when I try to delete it. Very weird. I end up having to copy the other elements to a new windowclass and starting over...

I don't know if @psicodelix wants to know this, or now; or if having the .rwp would help (I'll try saving and reloading to see if it still misbehaves. be right back... Yep, the saved .rwp displays the same problem with it after reloading.)

So. I'm a bit stumped.

- s.west

greybeardgunner70
December 16th, 2021, 22:17
On my idelete problem, another interesting puzzle is that the idelete icon on my skill_detail becomes un-delete-able in Ruleset Wizard. It acts as if it isn't there when I try to delete it. Very weird. I end up having to copy the other elements to a new windowclass and starting over...

I don't know if @psicodelix wants to know this, or now; or if having the .rwp would help (I'll try saving and reloading to see if it still misbehaves. be right back... Yep, the saved .rwp displays the same problem with it after reloading.)

So. I'm a bit stumped.

- s.west

Another thing to note (and easy to miss) is there are two buttons stacked on one another in the iedit and iadd fields. At least one, maybe both, I can't remember. But you will have to unlock them (if you imported Damned's rwp to look at) in order to see what's in each.

greybeardgunner70
December 16th, 2021, 22:32
Hi greybeardgunner70 what is the actual formula for the skills?
I believe that some are the average of a+b+c while others are the average of x+2y?
If that is the case then the average of a+b+c works in all cases.
Add to the skill_detail window a field for Attribute 1, 2 , and 3.
Set the formula to calculate onDrop (and maybe onInit also).
Then you will need to add a function on each attribute on the character sheet
Something like onValueChanged() read the list of skills and run the update formula on each skill
That should cover all the scenarios... I think

The way I did CPRed is ok when the skill list is always the same, but less desirable any other time.

The issue I am having is how to write the code for all that. I took a stab at this morning and just ended up confusing myself.
Here's what I need it to do:
1. There is a pre-made skill in the skill list. There will be one for each skill in the game, so the players can drag the appropriate ones onto their CS. For this example, lets say Acrobatics. Acrobatics Skill Base is STR+AGL+AGL/3. (However, each skill has a different combo of attributes it derives SB from.)
2. When the player drops the pre-made acrobatics skill onto their CS, the scripted function will grab the values for STR and AGL, average them and place the result in the Skill Base slot for Acrobatics on the CS.
3. When the player enters a skill level (mastery level), I need the CS to multiply Skill Base x Skill Level. This is the Effective Mastery Level.
4a. When the player rolls for that skill, I need the CS to roll a d100 against the EML, with a modifier for encumbrance on the roll (+/- anything in the CoreRPG modifier box).
4b. Or, when the CS inputs the EML in the rollable slot for the skill, it subtracts the penalty from EML (SBxSL) automatically. So then the roll is just a standard d100, +/- anything in the CoreRPG modifier box.

swest
December 16th, 2021, 23:08
@damned got me fixed up.

I failed to follow the instructions to name the iedit button "<name_of_windowlist>_iedit"

D'Oh!

Thank you!

damned
December 16th, 2021, 23:47
The issue I am having is how to write the code for all that. I took a stab at this morning and just ended up confusing myself.
Here's what I need it to do:
1. There is a pre-made skill in the skill list. There will be one for each skill in the game, so the players can drag the appropriate ones onto their CS. For this example, lets say Acrobatics. Acrobatics Skill Base is STR+AGL+AGL/3. (However, each skill has a different combo of attributes it derives SB from.)
2. When the player drops the pre-made acrobatics skill onto their CS, the scripted function will grab the values for STR and AGL, average them and place the result in the Skill Base slot for Acrobatics on the CS.
3. When the player enters a skill level (mastery level), I need the CS to multiply Skill Base x Skill Level. This is the Effective Mastery Level.
4a. When the player rolls for that skill, I need the CS to roll a d100 against the EML, with a modifier for encumbrance on the roll (+/- anything in the CoreRPG modifier box).
4b. Or, when the CS inputs the EML in the rollable slot for the skill, it subtracts the penalty from EML (SBxSL) automatically. So then the roll is just a standard d100, +/- anything in the CoreRPG modifier box.

Ill do a sample build in the next 24 hours.

swest
December 17th, 2021, 16:39
Ill do a sample build in the next 24 hours.

This will be super helpful. My own project has a very similar set of requirements for skills that @greybeardgunner70 has outlined.

I don't know about greybeard, but one of the biggest hurdles that I, myself, have to overcome is the programming style for this type of, graphically-based, interactive application. It's not the logic, it's all the underlying support structures that are built in to an API like this, with which one must become fluent to be successful. Obviously, this is the Ruleset Wizard thread, and while these topics aren't directly related to RW, the ultimate goal is to produce usable rulesets for FG. That makes this kind of collateral discussion extremely valuable.

So... Thanks!

swest
December 17th, 2021, 16:50
On a separate subject, I get, on occasion, the following error when /reload'ing my ruleset:

[timestamp] [ERROR] Object(DATABASENODE) deleted without cleaning up attached Lua object.
I haven't seen any negative consequences... yet. Also, I have been unable to reliably cause this to happen (and I've tried quite a few different scenarios.)

Any guidance for how to isolate this?

Thanks.

swest
December 17th, 2021, 16:57
Answering my own question, it looks like there was a posting about this last year: https://www.fantasygrounds.com/forums/showthread.php?62976-Error-when-leaving-a-campaign

@Moon Wizard and @Trenloe have some recommendations in there.

FYI.

superteddy57
December 17th, 2021, 16:57
On a separate subject, I get, on occasion, the following error when /reload'ing my ruleset:

[timestamp] [ERROR] Object(DATABASENODE) deleted without cleaning up attached Lua object.
I haven't seen any negative consequences... yet. Also, I have been unable to reliably cause this to happen (and I've tried quite a few different scenarios.)

Any guidance for how to isolate this?

Thanks.

It's a bug you can ignore as it's an issue with removal of some objects. If you can replicate the process in creating it consistently, Moon Wizard would be most interested. In either case, it's not going to affect your game play or development.

swest
December 17th, 2021, 17:19
It's a bug you can ignore as it's an issue with removal of some objects. If you can replicate the process in creating it consistently, Moon Wizard would be most interested. In either case, it's not going to affect your game play or development.

Thanks Dominic!

damned
December 18th, 2021, 05:37
Video #4 in this new series is available now.

This one is pretty meaty and there is a lot going on in the video but it is some pretty powerful stuff.

https://youtu.be/mxAfyK4idBc

See the RWP and PAK files below.

greybeardgunner70
December 18th, 2021, 16:34
Video #4 in this new series is available now.

This one is pretty meaty and there is a lot going on in the video but it is some pretty powerful stuff.

https://youtu.be/mxAfyK4idBc

See the RWP and PAK files below.

Great stuff! Thank You

I was able to import everything and get it working for the most part. I still get a couple errors. What's the secret to figuring out the error messages in CoreRPG? I can figure out the window reference of course, but I don't know if the subsequent number provides some hint to the issue. Is it a line of code? See image. The proper attribute average is loaded when the skill is dropped, but it doesnt update if the attribute changes.

50450

swest
December 18th, 2021, 21:10
Video #4 in this new series is available now.

This one is pretty meaty and there is a lot going on in the video but it is some pretty powerful stuff.

https://youtu.be/mxAfyK4idBc

See the RWP and PAK files below.

Thank you! Thank you! Thank you!

I'm flying now.

I just needed your examples to show me how the database hierarchy and some of the basic API calls work. Now I'm making real progress.

- s.west

psicodelix
December 18th, 2021, 23:06
On my idelete problem, another interesting puzzle is that the idelete icon on my skill_detail becomes un-delete-able in Ruleset Wizard. It acts as if it isn't there when I try to delete it. Very weird. I end up having to copy the other elements to a new windowclass and starting over...

I don't know if @psicodelix wants to know this, or now; or if having the .rwp would help (I'll try saving and reloading to see if it still misbehaves. be right back... Yep, the saved .rwp displays the same problem with it after reloading.)

So. I'm a bit stumped.

- s.west

That happens when the control is locked in the designer

damned
December 18th, 2021, 23:41
Great stuff! Thank You

I was able to import everything and get it working for the most part. I still get a couple errors. What's the secret to figuring out the error messages in CoreRPG? I can figure out the window reference of course, but I don't know if the subsequent number provides some hint to the issue. Is it a line of code? See image. The proper attribute average is loaded when the skill is dropped, but it doesnt update if the attribute changes.

50450

the first error tells you -
the file that has the issue - campaign/Scripts/managerChar.lua
the line that the issue occurs on - either 6 or 5 (sometimes it doesnt realise there is an issue until it gets to the next line)
hints at the error - one of the variables or the lines to generate a variable is not returning a value

the second one tells you
the window that has the issue - moreskills
the line that the issue occurs on - either 9 or 8 (sometimes it doesnt realise there is an issue until it gets to the next line)
hints at the error - one of the variables or the lines to generate a variable is not returning a value - in this case its probably the lock script and you dont have a skills_description

first fix these issues
(also this was not intended for you to wholesale take these from the project, you should create your own using the lesson/learns and dont use "moreskills", replace your existing skills)
then confirm you added the script to the attributes onValueChanged()

damned
December 18th, 2021, 23:42
Thank you! Thank you! Thank you!

I'm flying now.

I just needed your examples to show me how the database hierarchy and some of the basic API calls work. Now I'm making real progress.

- s.west

Huzzah!

greybeardgunner70
December 20th, 2021, 17:27
@psicodelix
Is it possible to copy/paste or drag data from one window to another? I am finding I want to do a major revamp to the abilities tab (adding horizontal tabs to better organize the skill lists) and would rather not have to re-create all the work I have done so far. I would like to be able to paste or move the items from one sub window to another.

Possible solution: After I create the sub-window controls, could I copy my current abilities window three times, rename them to link to the subwindows, and then edit each as desired?

psicodelix
December 20th, 2021, 19:45
@psicodelix
Is it possible to copy/paste or drag data from one window to another? I am finding I want to do a major revamp to the abilities tab (adding horizontal tabs to better organize the skill lists) and would rather not have to re-create all the work I have done so far. I would like to be able to paste or move the items from one sub window to another.

Possible solution: After I create the sub-window controls, could I copy my current abilities window three times, rename them to link to the subwindows, and then edit each as desired?

Yes, you can ctrl+c, ctrl+v to copy and paste controls between windows. You can also duplicate windows by right clicking on them in the ruleset explorer and selecting Create copy.

damned
December 20th, 2021, 21:31
You can either make copies of the subwindows or select all the controls you want to copy and ctrl+c and ctrl+v

greybeardgunner70
December 20th, 2021, 22:13
Thanks! Both options worked.

I have created a "Skills" sidebar. The "Skill Cards" will only have skill description information on them, as the required data is already on the CS. What I would like to do is include a button or link next to each skill that will link to the associated skill card. For example, the player would click on "Acrobatics" and the Acrobatics skill card would pop up from the Skills sidebar. How would I do that? Do I need to have a "drop box" for each skill that I can drag and drop the associated skill card onto or is there a way to script the link field to a specific "name" in the Skills sidebar? See the image for a better look at what I want to do.

50512

damned
December 20th, 2021, 22:22
Yes - you create (copy) the Link Field

Allow Drop: True
Description field: name
Self on empty: True
Window class name: (this will be the name of the library class, not the character sheet class)

swest
December 20th, 2021, 23:40
@damned, in your videos and code for DBRHarnmaster, the Skills function header in your managerRolls script looks like:


function Skill(rSource, rTarget, rRoll)

The function is called from the rollable field "skill" on skill_detail by virtue of the value of "Result handler function" == managerRolls.Skill

Where are Skill's (and Attack's, for that matter) function arguments (rSource, rTarget, and rRoll) defined, and the actual call to the function made? I've looked everywhere (videos and code)!

Thanks,

- s.west

damned
December 20th, 2021, 23:49
When you create a function you can define your own parameters - see the script in the last video:
https://www.youtube.com/watch?v=mxAfyK4idBc

When using the RulsetWizards dice roller it always sends (rSource, rTarget, rRoll) so our functions that follow on from a RulesetWizard generated roll should always accept those three data sets in that order. These will cover almost every situation
rSource - thats the actor doing the roll
rTarget - any targets selected and whether they are handled as a group or each
rRoll - the actual dice expression and the results

If you need more parameters, tack them on to one of those (I generally use rRoll)

swest
December 20th, 2021, 23:57
When using the RulsetWizards dice roller it always sends (rSource, rTarget, rRoll)
.
.

That's the key. How did you come to know that fact? In other words, where do I look (presumably in Ruleset Wizard) to make the same discovery?

Thanks!

damned
December 20th, 2021, 23:59
https://www.rulesetwizard.com/0-4-2-update-handling-dice-rolls/

swest
December 21st, 2021, 00:13
Very helpful. I will confess that I had not spent much time navigating through the RW updates. I hadn't thought of them as a source of documentation.

Alrighty then!

edit:

Although... the lines:


It receives three parameters:

rSource will contain data regarding to the source character of the roll.
rTarget will contain data regarding to the target (or targets), if any, of the roll.
rRoll will contain data regarding to the dice rolled and their results.

aren't exactly informative. What is the structure of each of those?

- s.west

jharp
December 21st, 2021, 00:33
Debug.chat(rSource,rTarget,rRoll) is your friend here.

Jason

swest
December 21st, 2021, 00:42
ummm.... no, I disagree. I already have that in my code, and while that might tell me what shows up, it doesn't tell me any of the underlying semantics. That's not 'documentation', as it were.

edit: Although, I don't disagree that "Debug.chat(rSource,rTarget,rRoll)" is my friend. It is!

damned
December 21st, 2021, 01:06
Unfortunately you are going to have to learn lots of these things by yourself as you go.
As mater Harp says Debug.chat is your friend.

damned
December 21st, 2021, 01:09
I cant teach you everything you need to know.

1. I dont know everything
2. I dont know what you need to know
3. You dont know what you need to know
4. Many things are documented only to a point
5. Many things are not from the Wizard - they are from the CoreRPG ruleset

Just keep plugging away at things
If you want to make some doco to share that would be great

swest
December 21st, 2021, 01:41
Yes, I get that... but, to carry this to the next logical step: I don't know what you (or others) don't know.

So, I ask a question. If no one knows, then so be it.

damned
December 21st, 2021, 01:58
rRoll, rTarget and rSource are all from CoreRPG. Its possible that the RW is doing things with them that CoreRPG isnt but they are not really RW things. RW is just using them.

Please dont take this as defending something -

Both Ruleset Wizard and Fantasy Grounds could have better documentation but I dont even know what better looks like. How far do you expand the doco? The doco states what things do but not really how to use them. That would be great - but all of us tend to use things differently. I find its useful to get somewhat familiar with as many unlocked rulesets as you can - not familiar under the hood (that comes later), familiar with their interfaces. Then in your project when you need to achieve something think about how something similar was achieved in a ruleset youve used and then get into the code and use that as an example or guide.

That is probably an unsatisfying response but it is the reality of what we have.

I have stolen (learnt) lots of things from other rulesets and while I am no where near as competent as the authors of those rulesets I have also made some pretty cool things by expanding on ideas gleaned from other examples.

Keep toiling. You will always be learning new stuff!

damned
December 21st, 2021, 01:58
Yes, I get that... but, to carry this to the next logical step: I don't know what you (or others) don't know.

So, I ask a question. If no one knows, then so be it.

Have you unanswered questions?

jharp
December 21st, 2021, 06:24
ummm.... no, I disagree. I already have that in my code, and while that might tell me what shows up, it doesn't tell me any of the underlying semantics. That's not 'documentation', as it were.

edit: Although, I don't disagree that "Debug.chat(rSource,rTarget,rRoll)" is my friend. It is!

I have some additional debugging methods that you can use to get at the internals (somewhat) but often they require an alternative LUA dll to get at _G, and to get at the metatables. If you want the dll you can pm me.

Jason

swest
December 22nd, 2021, 17:08
I have some additional debugging methods that you can use to get at the internals (somewhat) but often they require an alternative LUA dll to get at _G, and to get at the metatables. If you want the dll you can pm me.

Jason

Ok, thanks. I'll continue to see what I can learn (infer) from these higher-level debug techniques and get back to you if it's not working out.

Cheers!

psicodelix
December 23rd, 2021, 08:05
as Damned said, those variables contain arbitrary structures that depend on the ruleset, and the documentation about them is scarce.

In the CoreRPG manager_actions.lua file there is a definition of the basic rRoll structure:

-- ROLL
.sType
.sDesc
.aDice
.nMod
(Any other fields added as string -> string map, if possible)


rSource and rTarget are usually structures of type rActor, which is defined in the file manager_actor.lua:

-- rActor
sType
sCreatureNode
sCTNode
sName


but you might find a function that receives an array of these structures instead of the individual structure, so in practice we developers have become accustomed to debugging to find out exactly what type of structure and what fields our function is receiving, and go from there.

swest
December 23rd, 2021, 17:06
That's what I was looking for. Very helpful. Thanks!

greybeardgunner70
December 25th, 2021, 20:48
I was able to get the drag and drop to work with my skills list. However, its not quite what I wanted for the skills. (It will certainly help me understand how to get the drag and drop weapons and armor to work.)
What I would like is for the skills and their links on the CS to be permanent. As I have them built right now (following Damned's tuts) they do not carry over from CS to CS. I can create and link a skill description (see the image), but when I open a new CS, none of those skill links exist. What do I need to do differently to have the links imbedded in the CS and the skill descriptions themselves a permanent part of the ruleset?
50570

damned
December 26th, 2021, 00:10
You need to look at the Gumshoe/Esoterrorists/TrailofCthulhu extensions for MoreCore - they will auto add the skills on when a new toon is made
You can also add the link in to their source data at the same time.

greybeardgunner70
December 26th, 2021, 00:45
See below where I have pasted in the rollsManager script you posted (with some changes I made to better fit what I wanted).
I have a scripting question. From what I understand, I will need two different rollsManager scripts, the first that applies a "physical penalty" to any physical attribute based skill checks, and a second which adds a "universal penalty" to any skill check that is not based on physical attributes.
The pertinent line for this is line 7 (in the lua script): local nSkillScore = tonumber(rRoll.SkillScore);
This is just a guess at what this should look like in this case for the physcial skill checks:

I need to add a line for the penalty -
local nPP = DB.getValue(nodeWin,"total_phys_roll_pen",0);

The tonumber line will then look something like this -
local nSkillScore = tonumber(rRoll.SkillScore-nPP)

Is that even close?

function Skill(rSource, rTarget, rRoll)

local nSkillScore = tonumber(rRoll.SkillScore);

local nResult = rRoll.aDice[1].result;
local sResult = '';

if nResult > nSkillScore then

if nResult % 5 == 0 then
sResult = ' = Critical Failure (' .. nResult .. " vs " .. nSkillScore .. ")";
else
sResult = ' = Marginal Failure (' .. nResult .. " vs " .. nSkillScore .. ")";
end
else
if nResult % 5 == 0 then
sResult = ' = Critical Success (' .. nResult .. " vs " .. nSkillScore .. ")";
else
sResult = ' = Marginal Success (' .. nResult .. " vs " .. nSkillScore .. ")";
end
end

local rMessage = ActionsManager.createActionMessage(rSource, rRoll);

rMessage.text = rMessage.text .. sResult;
Comm.deliverChatMessage(rMessage);

return true
end

damned
December 26th, 2021, 01:05
if NPP is a number (and not a string) then that will be outside the tonumber() function

greybeardgunner70
December 26th, 2021, 01:07
You need to look at the Gumshoe/Esoterrorists/TrailofCthulhu extensions for MoreCore - they will auto add the skills on when a new toon is made
You can also add the link in to their source data at the same time.

I looked at esoterrorists. You have 7 different scripts in there, just for the skills list. That's way more complicated than what I want to tackle. I see a mass of code like that and I just want to say the hell with it and go watch the second season of Witcher. You mentioned a "link to their source data." I think that's what I want. I want the buttons on the CS to link to permanent description windows (I dont know if those have to be in the "Skills" list or not). Thats all. Is that possible without multiple scripts?

How do I create the database with the skill descriptions and have each skill description linked to a button (linkfield) on the CS?

greybeardgunner70
December 26th, 2021, 01:09
if NPP is a number (and not a string) then that will be outside the tonumber() function

So like this:

local nSkillScore = tonumber(rRoll.SkillScore)-nPP;

or

local nSkillScore = tonumber((rRoll.SkillScore)-nPP);

damned
December 26th, 2021, 01:40
I looked at esoterrorists. You have 7 different scripts in there, just for the skills list. That's way more complicated than what I want to tackle. I see a mass of code like that and I just want to say the hell with it and go watch the second season of Witcher. You mentioned a "link to their source data." I think that's what I want. I want the buttons on the CS to link to permanent description windows (I dont know if those have to be in the "Skills" list or not). Thats all. Is that possible without multiple scripts?

How do I create the database with the skill descriptions and have each skill description linked to a button (linkfield) on the CS?

There are 6 different lists so there are going to be different scripts for each list
If you look at the Low Fantasy Gaming extension - same concept - but it adds more data.
You will need to know the ids of the skills and then send that as a property - the same way the other data is being sent in these examples.
Alternatively you can create the content via a Lua script and do the same process.

It will take me a long time to go thru the examples myself and show you step by step.
If you are going down this route you will need to learn from the examples provided.

damned
December 26th, 2021, 01:41
So like this:

local nSkillScore = tonumber(rRoll.SkillScore)-nPP;

or

local nSkillScore = tonumber((rRoll.SkillScore)-nPP);

One of these examples is not outside the tonumber() function

damned
December 26th, 2021, 02:19
greybeardgunner70 it is true that sometimes what we perceive as small things can sometimes take a lot of effort.
On the scripts in those Gumshoe extensions there are also some scripts that filter out (dont display) skills that have not had any skill points spent on them.
Dont let those parts distract you.

greybeardgunner70
December 26th, 2021, 03:49
One of these examples is not outside the tonumber() function

OK, I can see that. Does that mean this should work:

local nPP = DB.getValue(nodeWin,"total_phys_roll_pen",0);
local nSkillScore = tonumber(rRoll.SkillScore)-nPP;

Where nPP is a number from the CS and the SkillScore is the base target number.

Its not working when I test it, but if I know the script is at least feasible, I can try to troubleshoot it.

greybeardgunner70
December 26th, 2021, 04:13
There are 6 different lists so there are going to be different scripts for each list
If you look at the Low Fantasy Gaming extension - same concept - but it adds more data.
You will need to know the ids of the skills and then send that as a property - the same way the other data is being sent in these examples.
Alternatively you can create the content via a Lua script and do the same process.

It will take me a long time to go thru the examples myself and show you step by step.
If you are going down this route you will need to learn from the examples provided.

Where can I find LFG extension? I can't find it on any of your morecore threads or the forge.

greybeardgunner70
December 26th, 2021, 04:18
greybeardgunner70 it is true that sometimes what we perceive as small things can sometimes take a lot of effort.
On the scripts in those Gumshoe extensions there are also some scripts that filter out (dont display) skills that have not had any skill points spent on them.
Dont let those parts distract you.

Another thought I had pertaining to skill descriptions. Copyright laws? Harnmaster is not open source. I can certainly make a CS with most of the functionality required (just as I could build a pdf or excel spreadsheet CS), but copying data from the rulebook (like skill descriptions) and inserting it into the FGU ruleset could be a violation, correct?

damned
December 26th, 2021, 05:06
For sure it looks feasible.
What is the error message you get? The error almost always tells you where to start looking.
It will tell you the filename (script) or control name (inline script) and the line number. Often the line number reported is the one after the error (depending on the error).

Put so many Debugs in your code that you worry you might run out of them.
After every line where you declare or set a variable do a Debug so you can sanity check that it is doing what you want
split that second line of code into two

local nSkillScore = tonumber(rRoll.SkillScore)-nPP;

>>

local nSkillScore = tonumber(rRoll.SkillScore);
local nSkillScore = nSkillScore-nPP;

but better yet - fill it with debug



function Skill(rSource, rTarget, rRoll)

Debug.chat("rSource: ", rSource);
Debug.chat("rTarget: ", rTarget);
Debug.chat("rRoll: ", rRoll);

local nPP = DB.getValue(nodeWin,"total_phys_roll_pen",0);
Debug.chat("nPP : ", nPP);

local nSkillScore = tonumber(rRoll.SkillScore);
Debug.chat("nSkillScore : ", nSkillScore );

local nSkillScore = nSkillScore -nPP;
Debug.chat("nSkillScore : ", nSkillScore );

local nResult = rRoll.aDice[1].result;
Debug.chat("nResult : ", nResult );

local sResult = '';
Debug.chat("sResult: ", sResult);

if nResult > nSkillScore then

if nResult % 5 == 0 then
sResult = ' = Critical Failure (' .. nResult .. " vs " .. nSkillScore .. ")";
else
sResult = ' = Marginal Failure (' .. nResult .. " vs " .. nSkillScore .. ")";
end
else
if nResult % 5 == 0 then
sResult = ' = Critical Success (' .. nResult .. " vs " .. nSkillScore .. ")";
else
sResult = ' = Marginal Success (' .. nResult .. " vs " .. nSkillScore .. ")";
end
end

local rMessage = ActionsManager.createActionMessage(rSource, rRoll);

rMessage.text = rMessage.text .. sResult;
Comm.deliverChatMessage(rMessage);

return true
end


If you do this you will straight away see the error :)

damned
December 26th, 2021, 05:07
Where can I find LFG extension? I can't find it on any of your morecore threads or the forge.

https://www.fantasygrounds.com/forums/showthread.php?53276-Low-Fantasy-Gaming-for-MoreCore

damned
December 26th, 2021, 05:13
Another thought I had pertaining to skill descriptions. Copyright laws? Harnmaster is not open source. I can certainly make a CS with most of the functionality required (just as I could build a pdf or excel spreadsheet CS), but copying data from the rulebook (like skill descriptions) and inserting it into the FGU ruleset could be a violation, correct?

yes and no.
How much data is there in the skill descriptions?

For example this is from a game Im working on.

Strength represents physical power and ability to lift and damage things through raw physical force. You can add your Strength bonus to attack and damage rolls when fighting unarmed or using melee weapons.

Including that (for each of the attributes) would not be a copyright violation. There is no product identity. There are no trademarked terms used. Strength and its description is very generic. It is also describing mechanics (rules) which are not protectable.

If it were describing Light Sabres - a product unique to Star Wars it would be a lot less clear cut. If it included a full page of descriptions it would much more likely be an infringment.

Horse Riding, Lockpicking, Stealth etc etc are very generic skills as are there descriptions. You could probably find descriptions that HM have used that are very similar to what someone else has also used.

greybeardgunner70
December 26th, 2021, 10:31
For sure it looks feasible.
What is the error message you get? The error almost always tells you where to start looking.
It will tell you the filename (script) or control name (inline script) and the line number. Often the line number reported is the one after the error (depending on the error).

Put so many Debugs in your code that you worry you might run out of them.
After every line where you declare or set a variable do a Debug so you can sanity check that it is doing what you want
split that second line of code into two

local nSkillScore = tonumber(rRoll.SkillScore)-nPP;

>>

local nSkillScore = tonumber(rRoll.SkillScore);
local nSkillScore = nSkillScore-nPP;

but better yet - fill it with debug


If you do this you will straight away see the error :)

Thanks! This has been helpful.

However, the function isnt reading nPP. The Roll Description Text works (EML Test Result For Acrobatics {acrobatics_eml} - {total_phys_roll_pen} PP), hence the -20 in the chat result, but the function isnt grabbing it. (The final SkillScore should be 50, 70-20.)
Could the node be wrong? nPP is on charsheet_notes, while the roll is on charsheet_abilities. Though that doesn't effect the Roll Description.

50574

greybeardgunner70
December 26th, 2021, 10:36
yes and no.
How much data is there in the skill descriptions?

For example this is from a game Im working on.

Strength represents physical power and ability to lift and damage things through raw physical force. You can add your Strength bonus to attack and damage rolls when fighting unarmed or using melee weapons.

Including that (for each of the attributes) would not be a copyright violation. There is no product identity. There are no trademarked terms used. Strength and its description is very generic. It is also describing mechanics (rules) which are not protectable.

If it were describing Light Sabres - a product unique to Star Wars it would be a lot less clear cut. If it included a full page of descriptions it would much more likely be an infringment.

Horse Riding, Lockpicking, Stealth etc etc are very generic skills as are there descriptions. You could probably find descriptions that HM have used that are very similar to what someone else has also used.

Thanks for the clarification. I noticed you included rulebook modules for LFG. I have created the same for HarnMaster (but have only used them in my personal campaigns). I'm guessing you did that and published the modules because the rules are open source?

damned
December 26th, 2021, 11:54
Thanks! This has been helpful.

However, the function isnt reading nPP. The Roll Description Text works (EML Test Result For Acrobatics {acrobatics_eml} - {total_phys_roll_pen} PP), hence the -20 in the chat result, but the function isnt grabbing it. (The final SkillScore should be 50, 70-20.)
Could the node be wrong? nPP is on charsheet_notes, while the roll is on charsheet_abilities. Though that doesn't effect the Roll Description.

50574

If your code is exactly as you described to me, exactly as I posted, then its not working because... what is the first debug output that doesnt match your expectations? Drill deeper into that line... why is that line not giving me the result I expect? You arent getting an error because the code you used does something special.

damned
December 26th, 2021, 11:57
Thanks for the clarification. I noticed you included rulebook modules for LFG. I have created the same for HarnMaster (but have only used them in my personal campaigns). I'm guessing you did that and published the modules because the rules are open source?

LFG was a special case.
The publisher asked me to make a character sheet for him (for a fee). I made a fully functioning extension instead that had fully automated character sheets, full NPC sheets and functioning combat.
As LFG has a free version I asked him for permission to convert it to go with the extension to which he agreed. Several other community members jumped in and helped me with the rulebook conversion. Then I also did a couple of the free adventures.

Free does not mean Open Source. It also doesnt mean you can reproduce - it is still copy protected. Publishers of free material are often happy to let you transform them to another format if you ask them first.

That doesnt apply in your situation.
But also you cant play Harn Master with your ruleset without also owning the rule books - even if the skills are populated.
It is my opinion that you could safely fill put the skills.
If the publisher disagrees they will usually just ask you to remove the content.

greybeardgunner70
December 26th, 2021, 13:06
If your code is exactly as you described to me, exactly as I posted, then its not working because... what is the first debug output that doesnt match your expectations? Drill deeper into that line... why is that line not giving me the result I expect? You arent getting an error because the code you used does something special.

The debug is clearly showing that the function isnt grabbing nPP (total_phys_roll_pen). But I can't figure out whats wrong with the code.

local nPP = DB.getValue(nodeWin,"total_phys_roll_pen",0);
Debug.chat("nPP : ", nPP);

local nSkillScore = tonumber(rRoll.SkillScore);
Debug.chat("nSkillScore : ", nSkillScore );

local nSkillScore = nSkillScore -nPP;
Debug.chat("nSkillScore : ", nSkillScore );

damned
December 26th, 2021, 13:10
nodeWin doesnt exist
your code returns 0 in the event that the lookup fails...
thats why you dont get an error
but the fact that the line doesnt return the right value as shown by the debug should tell there is something wrong with this line

psicodelix
December 27th, 2021, 12:25
Hello everyone,

The Ruleset Wizard was released as Early Access in september 2020, and the product has significantly developed in capability, features and maturity since that time. Whilst the product is still in Early Access from January 1st 2022 the Early Access pricing will go up to Ä59.90.


Thank you to everyone that has supported the product to date. We are now starting to see a number of Fantasy Grounds rulesets released by community members made using the Ruleset Wizard in part or fully. I am really excited about future product improvements, the collaborative community who invest so much time helping each other and the new games becoming available on Fantasy Grounds thanks at least in part to the Ruleset Wizard.


Wishing you all the best for 2022!

bloodylemming
December 28th, 2021, 10:32
Making ruleset with RW and I'm getting this error:
[ERROR] Extension Info Load (DDRPG): The 'ruleset' start tag on line 12 position 4 does not match the end tag of 'properties'. Line 15, position 5.

I don't know where this is coming from, or how to fix it. As far as I can tell, it's not affecting the functioning of the ruleset, but it's annoying seeing the console pop up every time I start the program. !}

psicodelix
December 28th, 2021, 10:39
Making ruleset with RW and I'm getting this error:
[ERROR] Extension Info Load (DDRPG): The 'ruleset' start tag on line 12 position 4 does not match the end tag of 'properties'. Line 15, position 5.

I don't know where this is coming from, or how to fix it. As far as I can tell, it's not affecting the functioning of the ruleset, but it's annoying seeing the console pop up every time I start the program. !}

could you paste the extension.xml file?

bloodylemming
December 30th, 2021, 04:59
<?xml version='1.0' encoding='ISO-8859-1'?>
<root version="3.0" release="7" logo="logo.png">

<!-- Attributes -->
<properties>
<name>Dungeon Dweller</name>
<description>
<text>Dungeon Dweller</text>
<website>https://www.reapermini.com</website>
<author>Joseph Wolf</author>
</description>
<ruleset>
<name>any</name>

</properties>

<announcement text="DDRPG - Dungeon Dweller v0.10\r\nDDRPG is a [description needed]. \r\n https://reapermini.com" icon="reaper" font="systemfont" />

<base>
<!-- Tabletop settings -->
<includefile source="graphics/graphics_frames.xml" />
<includefile source="graphics/graphics_fonts.xml" />
<includefile source="graphics/graphics_icons.xml" />

<!-- Templates -->
<includefile source="common/template_ddrpg.xml" />

<!-- Character Sheet settings -->
<includefile source="common/record_char_more.xml" />

<!-- Strings -->
<includefile source="strings/strings_ddrpg.xml" />

<!-- Scripts - Sidebar -->
<script name="DesktopManagerDDRPG" file="scripts/data_library_ddrpg.lua" />

<!-- Scripts - Character Sheet -->
<script name="CharacterUpdate" file="scripts/manager_ddrpg.lua" />
</base>
</root>

damned
December 30th, 2021, 05:08
There is definitely missing tags/info in that file.
Rename extension.xml to extension.old
And then generate the extension again?

bloodylemming
December 30th, 2021, 05:43
It's not generating a new extension file...

damned
December 30th, 2021, 06:13
What exactly happens?
It builds all its files up each time.

psicodelix
December 30th, 2021, 07:49
It's not generating a new extension file...

make sure that the path where the ext file is generated is correct.

bloodylemming
December 30th, 2021, 16:17
make sure that the path where the ext file is generated is correct.

I've searched for extension.xml and the only one that exists is the renamed one...
isn't that file supposed to be created when the 'Generate Rules' button is pressed?

As far as I can tell, the only file that gets created is the .pak file

damned
December 30th, 2021, 23:06
Did you create a Ruleset AND an Extension and then load them both?

greybeardgunner70
December 31st, 2021, 02:37
@damned In your RW builds so far, I see how you create weapons, armor and other items in FGU (as opposed to scripted in RW) and then drag them onto the CS. It is my understanding they are not permanent items in the ruleset, correct? (The item card format is permanent, but each individual item is not and has to be created once a new campaign is opened.)
So if you were to open a new campaign with the ruleset you have built, the GM would have to build those items for the players to then drag onto their sheets when they generate characters.
Is that not the case or am I missing something? I would like to use drag and drop items, I'm just trying to figure out how much work I am potentially asking a GM to do each time they open a new campaign.

bloodylemming
December 31st, 2021, 02:47
Did you create a Ruleset AND an Extension and then load them both?

Just a ruleset, as far as I know, but there was an Extension.xml created at some point. Just no idea where it came from...
Should I be creating an extension separately, and if so, what exactly would I be putting in that?

damned
December 31st, 2021, 03:06
The only reason an extension.xml is created is if you set it to create an extension.xml
If you need an extension then load it - but you are building a ruleset - it should just be a ruleset.

damned
December 31st, 2021, 03:13
@damned In your RW builds so far, I see how you create weapons, armor and other items in FGU (as opposed to scripted in RW) and then drag them onto the CS. It is my understanding they are not permanent items in the ruleset, correct? (The item card format is permanent, but each individual item is not and has to be created once a new campaign is opened.)
So if you were to open a new campaign with the ruleset you have built, the GM would have to build those items for the players to then drag onto their sheets when they generate characters.
Is that not the case or am I missing something? I would like to use drag and drop items, I'm just trying to figure out how much work I am potentially asking a GM to do each time they open a new campaign.

Well this comes back to your questions regarding Copyright.
You cant protect mechanics and you cant protect stuff that is not your own.
You cant protect a Bastard Sword but you could protect Scaramons Blade.

If you create an entry on a Character Sheet it only exists on the character sheet.
If you create an entry in a Campaign Tool it exists in the campaign and can be shared and dragged to other sheets.
Ultimately you want to export it to a Player Module so that you can share the Module and all items in that module will be shared/accessible.

You can script the creation of these items.

If you look at the 4E ruleset it has all the framework and no content.
Thats what most community rulesets look like.
If you look at the Star Wars (the Genesys/FFG version) they have created modules that have names and stats but no fluff text - all the descriptions say see Book X page Y).
Ultimately the best solution is - do an awesome job, contact the publisher, get a license to convert it to FG and earn some commission. If you go this route there is more info you should know.

greybeardgunner70
December 31st, 2021, 03:32
OK, got it. I'll set up the item lists on the CS and go the module route. Hadn't thought of that.

I do have another tech/script question. In HM armor is by location and it is stackable/layered. So, for example, a knight might wear a quilted cap against his skull, with a mail cowl and a plate helm over that. So if the cap has a PF of 1, the cowl of 2 and the helm a PF of 3, that would equal a total of 6 PF for the skull. But each of those pieces of armor would be listed separately in the inventory. I know how to create a box on the CS to capture the PF for one item (say the cap), that's pretty easy (nquiltcapPF to nskull). How do I script for nskull to increase as more items with PF for the skull are added to the inventory? Do you have an example of that in one of your tutorial builds?

damned
December 31st, 2021, 03:44
Its coding so there are many, many ways to do something.
You could have a windowlist for each body part.
What I would probably do - without having given this a whole lot of thought - is in each Armor items properties list each body part and a number field

Helmet
Head [3]
Chest [0]
Left Arm [0]
Right Arm [0]
Groin [0]
Left Leg [0]
Right Leg [0]

Chain Mail
Head [0]
Chest [2]
Left Arm [2]
Right Arm [2]
Groin [2]
Left Leg [0]
Right Leg [0]

etc
Then when you Equip an item run a script that cycles through all equipped items and sums all Head, Chest, Left Arm, etc and then does a setValue() on the Body Part.

A little complex? Yes. Have fun!

damned
December 31st, 2021, 03:54
a really, really rough code to point you in the right direction (hopefully)



local nodeChar = window.getDatabaseNode();
local nodeInventory = nodeChar.getChild("inventorylist");

local nHeadAC = 0;
local nChestAC = 0;
local nLeftArmAC = 0;
local nRightArmAC = 0;
local nGroinAC = 0;
local nLeftLegAC = 0;
local nRightLegAC = 0;

for k,v in pairs (nodeInventory.getChildren())
do if v.getChild("equipped").getValue() == 1 then
nHeadAC = nHeadAC+v.getChild("head").getValue()
nChestAC = nChestAC+v.getChild("chest").getValue()
...etc
Debug.chat(v.getChild("name").getValue(),nHead,nChest,etc);

end
nodeChar.getChild("achead").setValue(nHeadAC);
nodeChar.getChild("acchest").setValue(nChestAC);
etc

end


code is completely untested.
its just a suggestion on how I would do it.

greybeardgunner70
December 31st, 2021, 04:16
Thanks, I'll give it a shot!

bloodylemming
December 31st, 2021, 05:17
The only reason an extension.xml is created is if you set it to create an extension.xml
If you need an extension then load it - but you are building a ruleset - it should just be a ruleset.

I don't see anything under project properties that would create an extension. I built this one entirely in Ruleset Wizards, so I don't know what's going on there.
However, since I renamed the file, I haven't been getting the error, so I guess it was interfering and I don't need it.

damned
December 31st, 2021, 05:23
When you create a new project the default setting is extension.

damned
December 31st, 2021, 05:24
When you create a new project the default setting is extension.

https://www.youtube.com/watch?v=RCrTrTZXFj0

greybeardgunner70
December 31st, 2021, 17:43
This morning's work. Item cards for weapons, armor and gear.

Once I get the CS setup I will attempt the script.
50638

psicodelix
December 31st, 2021, 18:57
This morning's work. Item cards for weapons, armor and gear.

Once I get the CS setup I will attempt the script.
50638

Great work!

bloodylemming
December 31st, 2021, 20:16
When you create a new project the default setting is extension.

I must have switched that, at some point, then.

greybeardgunner70
December 31st, 2021, 21:12
Ran into a snag with my item windows and the lock button. I was able to satisfactorily script the lock button to lock everything on the "item" window and its subordinates "sub_gear" and sub_weapon," however, "sub_armor" has a tab with two subwindows on it ("arsubwindow1" and arsubwindow2"). I dont know what script to use for the lock button to apply two levels down. Any ideas? Current script:

function onLockChanged()
local bReadOnly = WindowManager.getReadOnlyState(getDatabaseNode());
name.setReadOnly(bReadOnly);
type.setReadOnly(bReadOnly);
cost.setReadOnly(bReadOnly);
weight.setReadOnly(bReadOnly);
sub_weapon.subwindow.skill.setReadOnly(bReadOnly);
sub_weapon.subwindow.oml.setReadOnly(bReadOnly);
sub_weapon.subwindow.wq.setReadOnly(bReadOnly);
sub_weapon.subwindow.atk.setReadOnly(bReadOnly);
sub_weapon.subwindow.def.setReadOnly(bReadOnly);
sub_weapon.subwindow.hand.setReadOnly(bReadOnly);
sub_weapon.subwindow.bdmg.setReadOnly(bReadOnly);
sub_weapon.subwindow.edmg.setReadOnly(bReadOnly);
sub_weapon.subwindow.pdmg.setReadOnly(bReadOnly);
sub_weapon.subwindow.wpndescription.setReadOnly(bR eadOnly);
sub_gear.subwindow.geardescription.setReadOnly(bRe adOnly);

end

damned
January 1st, 2022, 00:39
try


sub_weapon.subwindow.arsubwindow1.subwindow.contro l.setReadOnly(bReadOnly);

damned
January 1st, 2022, 00:40
or you run the lock code inside the subwindow instead...
I havent done this before but I believe it is the way that Moon Wizard does it.

damned
January 1st, 2022, 00:41
In your Items campaign tool create groups for
Armor
Weapons
Gear

greybeardgunner70
January 1st, 2022, 14:56
@damned Thanks. I tried multiple combinations of .subwindow before I came here. But I was able to simply reduce the font and size of the data entry windows, making it possible to fit everything on sub_armor. No need for the extra subwindows.

I would like to have drop inventory windows for armor, weapons, gear. I know how to set those up separately using the .x_list function. My question: Is it possible to have only certain items displayed in different windows when you drop the item in the inventory? For example, I have a weapon_detail card that drops everything I want for the weapon on the combat tab, but I only want to display the name and item weight on the inventory. I think is what occurs on the more popular ruleset sheets (DnD,PF). You drop an item in the inventory and it also populates the combat tab with the associated "action" data. Do you have an example of setting that up in one of your tutorials?

I am hugely appreciative of your tutorials, they are what have inspired and gotten me to where I am with this project today. A simple comment/request, for future projects, if you could put a few keywords in your title or description of each vid, it would make searching for pertinent sections much easier. In order to find things I often have to scan multiple vids. Not a big deal, just something to consider for the future. Again, thanks for your work, it makes all of this a lot less frustrating!

damned
January 1st, 2022, 15:28
A couple of hours I just went thru the current series (41 videos) and added the core topic to the title...
Hopefully i will have time to update the older ones one day too...

You can create two lists with the same source eg .inventorylist
You can define a different Class Name for each instance

greybeardgunner70
January 1st, 2022, 16:28
OK, so that worked, thanks!

greybeardgunner70
January 1st, 2022, 18:30
a really, really rough code to point you in the right direction (hopefully)



local nodeChar = window.getDatabaseNode();
local nodeInventory = nodeChar.getChild("inventorylist");

local nHeadAC = 0;
local nChestAC = 0;
local nLeftArmAC = 0;
local nRightArmAC = 0;
local nGroinAC = 0;
local nLeftLegAC = 0;
local nRightLegAC = 0;

for k,v in pairs (nodeInventory.getChildren())
do if v.getChild("equipped").getValue() == 1 then
nHeadAC = nHeadAC+v.getChild("head").getValue()
nChestAC = nChestAC+v.getChild("chest").getValue()
...etc
Debug.chat(v.getChild("name").getValue(),nHead,nChest,etc);

end
nodeChar.getChild("achead").setValue(nHeadAC);
nodeChar.getChild("acchest").setValue(nChestAC);
etc

end


code is completely untested.
its just a suggestion on how I would do it.

Here's what I have so far. I created a windowlist and an armor detail to display the armor PF factors (see image). When I add a piece of armor to the inventory, it populates the body locations and the area that piece of armor covers. However, of course, it doesnt aggregate the pieces, it just lists them. Still think a script is the way to go or is there a different/better way?

The chart with the locations and amount of PF is what I want. Perhaps a windowlist isnt the way to do it. How would I create a link from the inventory to a similar chart that I can then script the aggregate function?

50652

damned
January 2nd, 2022, 00:24
Ok, I think I finally worked out your image.
You have 1 and 1/3 pieces of armor listed.
I would be listing them the same way that you have listed Weapons.
I would then create all those current armor fields directly on to the Character Sheet - not into a list.
Then my code above

nHeadAC = nHeadAC+v.getChild("head").getValue()
nChestAC = nChestAC+v.getChild("chest").getValue()
will help you aggregate/sum the protection provided.

Btw - that font is wonderful.

greybeardgunner70
January 2nd, 2022, 00:52
OK, got it. Only question - I understand how to get the "item"_detail to populate in the windowlist. How do I get it to populate a field that isnt in a list? Is that scripted? getchild + setvalue? or something similar? Where does the script go?

damned
January 2nd, 2022, 01:45
In your window list include
Equipped and Name and anything else you wanted.

Then copy all the fields from your current listentry and paste them on to charsheet or the charsheet_whatever subwindow

On the Equipped (carried) field add



function onInit()
onValueChanged();
end

function onValueChanged()
local nodeChar = window.getDatabaseNode().getParent().getParent();
managerChar.updateDefense(nodeChar);

end


then add something like this to your managerChar script file



function updateDefense(nodeChar)
local nHeadAC = 0;
local nChestAC = 0;
local nLeftArmAC = 0;
local nRightArmAC = 0;
local nGroinAC = 0;
local nLeftLegAC = 0;
local nRightLegAC = 0;

for k,v in pairs (nodeChar.inventorylist.getChildren())
do if v.getChild("equipped").getValue() == 1 then
nHeadAC = nHeadAC+v.getChild("head").getValue()
nChestAC = nChestAC+v.getChild("chest").getValue()
...etc
Debug.chat(v.getChild("name").getValue(),nHead,nChest,etc);

end
nodeChar.getChild("achead").setValue(nHeadAC);
nodeChar.getChild("acchest").setValue(nChestAC);
etc

end


Im not sure if nodeChar.inventorylist.getChildren() is correct...

anyway... something like that is how Im thinking...

bloodylemming
January 2nd, 2022, 01:46
@damned Thanks. I tried multiple combinations of .subwindow before I came here. But I was able to simply reduce the font and size of the data entry windows, making it possible to fit everything on sub_armor. No need for the extra subwindows.

I would like to have drop inventory windows for armor, weapons, gear. I know how to set those up separately using the .x_list function. My question: Is it possible to have only certain items displayed in different windows when you drop the item in the inventory? For example, I have a weapon_detail card that drops everything I want for the weapon on the combat tab, but I only want to display the name and item weight on the inventory. I think is what occurs on the more popular ruleset sheets (DnD,PF). You drop an item in the inventory and it also populates the combat tab with the associated "action" data. Do you have an example of setting that up in one of your tutorials?

I am hugely appreciative of your tutorials, they are what have inspired and gotten me to where I am with this project today. A simple comment/request, for future projects, if you could put a few keywords in your title or description of each vid, it would make searching for pertinent sections much easier. In order to find things I often have to scan multiple vids. Not a big deal, just something to consider for the future. Again, thanks for your work, it makes all of this a lot less frustrating!

I've used the method shown in Damnds video 'White Lies, Episode 15, to do that. https://www.youtube.com/watch?v=UQeBDs7UnuA&list=PLsgd1zJLdiKX7IkXja1FinphKtMrIgbBS&index=15

damned
January 2nd, 2022, 01:48
Also swest has gone thru the current videos and created a bookmark list so I will add them in once I finish the actual project.

bloodylemming
January 2nd, 2022, 03:19
Also swest has gone thru the current videos and created a bookmark list so I will add them in once I finish the actual project.

Well, that is awesome. Thanks a ton!

bloodylemming
January 2nd, 2022, 03:20
Damned, did you happen to discuss the location field for inventory? I'm having a hell of a time getting that to work in my layout...

damned
January 2nd, 2022, 03:31
I did not.
How that works is if you add an Item - say Backpack to you inventory and then on another item - eg Rope - if you put Backpack as the Location it will indent and display under the Backpack.
It is not for saying Off Hand, Head, Torso etc

greybeardgunner70
January 2nd, 2022, 03:56
OK, I think I follow what you are laying down... However, there is one problem. I created my own inventory lists (weapons, armor, gear) and they use the same item_detail cards, but filter by type, as you showed in your latest demo. So that parts works great. Unfortunately, my lists are missing most of the controls in the generic inventorylist (specifically carried_header). Can I add that with a custom control? Is there an easier way to simply have my 3 inventorylists mimic the generic one? Are those buttons part of the detail, like the iedit and link button?

50661

50662

bloodylemming
January 2nd, 2022, 04:19
I did not.
How that works is if you add an Item - say Backpack to you inventory and then on another item - eg Rope - if you put Backpack as the Location it will indent and display under the Backpack.
It is not for saying Off Hand, Head, Torso etc

Yea, that's why I want to include it, but I can't seem to get it to work. I have the stringfield named 'char_label_itemlocation', but no dice. I tried to name it 'location' as well, but I don't think that's what the item is actually called... Haven't found any other referenced in the CoreRPG files...

damned
January 2nd, 2022, 04:22
I include the CoreRPG inventory in my projects.
I dont mess with it.

damned
January 2nd, 2022, 04:25
OK, I think I follow what you are laying down... However, there is one problem. I created my own inventory lists (weapons, armor, gear) and they use the same item_detail cards, but filter by type, as you showed in your latest demo. So that parts works great. Unfortunately, my lists are missing most of the controls in the generic inventorylist (specifically carried_header). Can I add that with a custom control? Is there an easier way to simply have my 3 inventorylists mimic the generic one? Are those buttons part of the detail, like the iedit and link button?

50661

50662

I also retained the CoreRPG inventory list.
It does lots of good stuff.
You will not also that I dont have iAdd icons on my filtered lists because when you add something it wont have the right type and it wont appear.

Im not positive what you are saying but the answer may be to retain the CoreRPG Inventory in place of your Gear/Satchel

damned
January 2nd, 2022, 04:35
And just a suggestion...
Big character sheets are beautiful and they hold so much info
But as they are almost always open they take up a helluva lot of room on a finite table space.
You character sheet might not even be usable on a 1366x768 (2nd most common screen size) screen...

greybeardgunner70
January 2nd, 2022, 04:57
I havent had any complaints so far about the size of the sheet. But you make a good point. Once I have it geared like I want, I'll look at shrinking it down a bit. There is a lot of white space on parts of it. I have gotten pretty ambitious about it and have changed a lot from corerpg, but mostly just aesthetics and layout. The curent CS I have been using for a year or so works fine for our purposes, this has just been an experiment at improving a few things.

I will try to go back to the corerpg inventory and see if I can make that work.

damned
January 2nd, 2022, 05:07
You can still theme it - but from my perspective there is value in keeping its functionality.
You can get rid of Location (containers) to help with width.

damned
January 2nd, 2022, 05:10
Also re: Size - if the eventual aim might be to have it in the Store then this is one thing that they will check. I dont know what the maximum size permitted is, but I work to keeping under 700px if possible (which usually means Im right at 700px!).

greybeardgunner70
January 2nd, 2022, 05:26
OK thanks.

greybeardgunner70
January 2nd, 2022, 08:03
I was able to set everything up with the corerpg inventory list. Should work fine. However, my scripts can't pull "encumbranceload" from the inventorylist. Any reason why this might be happening? No errors, the script just doesnt work (it will not setvalue for enc_penalty). Is there something about the inventorylist that would prevent a script from reading it?

function onValueChanged()
local nodeWin = window.getDatabaseNode();
local nendurance = nodeWin.getChild("endurance").getValue();
local ntotalload = nodeWin.getChild("encumbranceload").getValue();
local nencumbranceroll = math.floor(ntotalload/nendurance);

nodeWin.getChild("enc_penalty").setValue(nencumbranceroll);

end

damned
January 2nd, 2022, 08:13
No it should be fine. Im doing something similar.

put some Debug in there before each line

damned
January 2nd, 2022, 08:14
there is a typo in what you posted (extra space in last line) but Im guessing that was just a paste error?

greybeardgunner70
January 2nd, 2022, 15:24
Yes that's just a paste error.

It simply isnt reading encumbranceload from the inventory list. See image. The first and second iterations of "ntotalload" (local ntotalload = DB.getValue(nodeWin,"encumbranceload",0); ), it returns "nil" when I change the inventory items/weight.

I placed another instance of encumbranceload on the Notes tab labeled "Cbt Inv." It also returns "nil" for encumbranceload when I change the weight. However, when I manually enter the proper weight into "Cbt Inv" it runs the script and gives "nencumbranceroll" '4' and changes "enc_penalty" (labeled Encumbrance on the CS) which is the proper response. Even though it STILL returns nil for ntotalload and enc_penalty.
50664

greybeardgunner70
January 2nd, 2022, 17:28
In your window list include
Equipped and Name and anything else you wanted.

Then copy all the fields from your current listentry and paste them on to charsheet or the charsheet_whatever subwindow

On the Equipped (carried) field add



function onInit()
onValueChanged();
end

function onValueChanged()
local nodeChar = window.getDatabaseNode().getParent().getParent();
managerChar.updateDefense(nodeChar);

end


then add something like this to your managerChar script file



function updateDefense(nodeChar)
local nHeadAC = 0;
local nChestAC = 0;
local nLeftArmAC = 0;
local nRightArmAC = 0;
local nGroinAC = 0;
local nLeftLegAC = 0;
local nRightLegAC = 0;

for k,v in pairs (nodeChar.inventorylist.getChildren())
do if v.getChild("equipped").getValue() == 1 then
nHeadAC = nHeadAC+v.getChild("head").getValue()
nChestAC = nChestAC+v.getChild("chest").getValue()
...etc
Debug.chat(v.getChild("name").getValue(),nHead,nChest,etc);

end
nodeChar.getChild("achead").setValue(nHeadAC);
nodeChar.getChild("acchest").setValue(nChestAC);
etc

end


Im not sure if nodeChar.inventorylist.getChildren() is correct...

anyway... something like that is how Im thinking...

So, yeah, it doesn't recognize nodeChar.inventorylist.getChildren()

[1/2/2022 11:25:30 AM] [ERROR] Script execution error: [string "campaign/Scripts/managerChar.lua"]:94: attempt to index field 'inventorylist' (a nil value)

The script is too long to paste here but I can share it with you if you wanna review.

damned
January 3rd, 2022, 00:43
Sorry am at beach after kayaking

The encumbrance field you refer to is not in the inventory list it is a separate control

greybeardgunner70
January 3rd, 2022, 02:57
Sorry am at beach after kayaking

The encumbrance field you refer to is not in the inventory list it is a separate control

Enjoy your day. We can dig into this stuff later.

greybeardgunner70
January 3rd, 2022, 15:39
Sorry am at beach after kayaking

The encumbrance field you refer to is not in the inventory list it is a separate control

ok, I thought based on my reading of the corerpg xml and following your tutorial, encumbranceload was what I needed to call (getValue) in order to get the total weight from inventorylist. Is there another value name I should be using, or is it simply a number my players will have to enter in another box manually in order to derive encumbrance penalties?

mattekure
January 3rd, 2022, 15:55
ok, I thought based on my reading of the corerpg xml and following your tutorial, encumbranceload was what I needed to call (getValue) in order to get the total weight from inventorylist. Is there another value name I should be using, or is it simply a number my players will have to enter in another box manually in order to derive encumbrance penalties?

encumbranceload is the correct control to check, but its not contained within the inventory list. it is its own separate control at the same level of the list.

If you have the DB node for the character, getting the value is as simple as


local nLoad = DB.getValue(nodeChar, "encumbrance.load", 0)

you notice that I am referencing "encumbrance.load" with the . in there. thats because the CoreRPG xml for this puts the source in that location.



<simplenumber name="encumbranceload" source="encumbrance.load">
<anchored to="encumbranceframe" position="insidetopleft" offset="160,30" width="55" height="20" />
<frame name="fieldlight" offset="7,5,7,5" />
<readonly />
</simplenumber>

greybeardgunner70
January 3rd, 2022, 16:00
Ah, ok missed that. I'll give it a try. Thanks!

greybeardgunner70
January 3rd, 2022, 16:36
Still getting "nil" for totalload. I have placed the below script into the "encumbranceload" and "endurance" boxes. If encumbranceload is a control, should I place the script somewhere else or use a different command?

Is there a difference between nodeWin and nodeChar?

function onValueChanged()
local nodeWin = window.getDatabaseNode();
local nendurance = DB.getValue(nodeWin,"endurance",0);
Debug.chat("nendurance : ", nendurance);
local ntotalload = DB.getValue(nodeChar, "encumbrance.load", 0)
Debug.chat("ntotalload : ", ntotaload);
local nencumbranceroll = math.floor(ntotalload/nendurance);
Debug.chat("nencumbranceroll : ", nencumbranceroll);
nodeWin.getChild("enc_penalty").setValue(nencumbranceroll);
Debug.chat("enc_penalty : ", enc_penalty);

end

mattekure
January 3rd, 2022, 16:38
Still getting "nil" for totalload. I have placed the below script into the "encumbranceload" and "endurance" boxes. If encumbranceload is a control, should I place the script somewhere else or use a different command?

function onValueChanged()
local nodeWin = window.getDatabaseNode();
local nendurance = DB.getValue(nodeWin,"endurance",0);
Debug.chat("nendurance : ", nendurance);
local ntotalload = DB.getValue(nodeChar, "encumbrance.load", 0)
Debug.chat("ntotalload : ", ntotaload);
local nencumbranceroll = math.floor(ntotalload/nendurance);
Debug.chat("nencumbranceroll : ", nencumbranceroll);
nodeWin.getChild("enc_penalty").setValue(nencumbranceroll);
Debug.chat("enc_penalty : ", enc_penalty);

end

you dont have nodeChar pointing to anything. from your code, it looks like you are pulling the windows DB node into nodeWin so you would use that. nodeChar is just what I called my variable.

greybeardgunner70
January 3rd, 2022, 18:48
you dont have nodeChar pointing to anything. from your code, it looks like you are pulling the windows DB node into nodeWin so you would use that. nodeChar is just what I called my variable.

Ok, that makes sense. I'm learning.

That worked. Thanks!

mattekure
January 3rd, 2022, 19:56
Ok, that makes sense. I'm learning.

That worked. Thanks!

:D I'm learning too. I just knew 1 more trick than you did. Now you know it too.

greybeardgunner70
January 3rd, 2022, 20:15
@damned Still troubleshooting the armor inventory PF script. inventorylist didnt work, neither does "list_charinv" (which I pulled from the corerpg xml).

Do I need to edit this line in managerChar with something specific to my CS? - function updateDefense(nodeChar)

not sure updateDefense is correct.

damned
January 3rd, 2022, 22:44
50705

This is my charsheet_inventory
I have merge="delete" all the things I dont want

I create a new "inventoryframe" so that it is more themed
I dont touch the inventory_list - in CoreRPG it is anchored to inventoryframe
I add encumbranceload number field to my ruleset a frame and no other additional settings

then all the inventory_list magic in Core continues to happen including updating encumbranceload

get that working

then add your onValueChanged() code to encumbranceload

greybeardgunner70
January 3rd, 2022, 23:35
So, yeah, it doesn't recognize nodeChar.inventorylist.getChildren()

[1/2/2022 11:25:30 AM] [ERROR] Script execution error: [string "campaign/Scripts/managerChar.lua"]:94: attempt to index field 'inventorylist' (a nil value)

The script is too long to paste here but I can share it with you if you wanna review.

I was able to get the script to run with the total weight from the inventory using encumbrance.load, thanks to Mattekure's advice. Still wrestling with the script to get the Protections Factors to update whenever a new piece of armor is added. (see above from 11:28 yesterday and today at 14:15)

greybeardgunner70
January 3rd, 2022, 23:40
With regards to "function updateDefense(nodeChar)"

Do I not need something named Defense?

damned
January 4th, 2022, 01:01
Like with Mattekure's explanation updateDefense is just a name.

It could be called function one, function two, function three etc
Giving it a name that at least hints at its function just makes it easier for you (and others) to see what is happening.

I tend to use
nodeChar for charsheet/character
nodeWin for generic stuff
there are many times I have used nodeItem, nodeInventory etc - these are just variable names. they could also be one, two, three but it is easier to work with if they make sense to you still after not looking at it for a week :bandit:

damned
January 4th, 2022, 01:03
following on from mattekures advice. You cant use a variable that hasnt been defined and expect it to get a useful result.
If you declare nodeWin then that is what you have declared - nodeChar only exists once you create it (or it is passed to the function).

greybeardgunner70
January 4th, 2022, 01:25
following on from mattekures advice. You cant use a variable that hasnt been defined and expect it to get a useful result.
If you declare nodeWin then that is what you have declared - nodeChar only exists once you create it (or it is passed to the function).

Everything in the managerChar script is "nodeChar"

I still get this error: [1/3/2022 7:23:24 PM] [ERROR] Script execution error: [string "campaign/Scripts/managerChar.lua"]:94: attempt to index field 'inventorylist' (a nil value)

for k,v in pairs (nodeChar.inventorylist.getChildren())
do if v.getChild("equipped").getValue() == 1 then

I dont know how to "create" nodeChar if thats where the error originates.

damned
January 4th, 2022, 01:53
what is nodeChar?

Generally it is the node that contains the character in question.
eg charsheet.id-00010

To create the variable nodeChar you generally are going to be on the character sheet somewhere to do that
you could be on an item in a windowlist in a subwindow on the character sheet or just on the character sheet etc

generally (but its not the only way) you create it with:

nodeChar = window.getDatabaseNode()

If you do that in a Debug.chat you will see what it returns
if it doesnt return
charsheet.id-xxxxx
then work out why not and how to get it to the above

You cant reference nodeChar in that external script this way
but if you re-read my whole example I generated it (iirc) on the carried field in an onValueChanged function and then i call updateDefense and pass the nodeChar to it eg managerChar.updateDefense(nodeChar)
so debug before that line
Debug.chat("nodeChar: ", nodeChar)
and debug it on the first new line of the updateDefense(nodeChar) function
Debug.chat("nodeChar: ", nodeChar)

what do you get?

greybeardgunner70
January 4th, 2022, 02:04
Scripts:
managerChar
function updateDefense(nodeChar)

Debug.chat("nodeChar: ", nodeChar)
local nodeChar = window.getDatabaseNode();

local nbskull = 0;
local neskull = 0;
local npskull = 0;
local nfskull = 0;

local nbface = 0;
local neface = 0;
local npface = 0;
local nfface = 0;

local nbneck = 0;
local neneck = 0;
local npneck = 0;
local nfneck = 0;
etc
-------------------------------------------------
Carried Button:
function onInit()
onValueChanged();
end

function onValueChanged()
Debug.chat("nodeChar: ", nodeChar)
local nodeChar = window.getDatabaseNode().getParent().getParent();
managerChar.updateDefense(nodeChar);

end
-------------------------------------------
Image of errors: One of the debugs returns nil, the other a charsheet number.

50708

greybeardgunner70
January 4th, 2022, 02:09
The managerChar is returning the charsheet.id-00001

The button is not.

damned
January 4th, 2022, 03:13
if you do the following:

local nScore = 1;
local nScore = 100;

then nScore will only equal one of these. Which one?

You have the following:


function updateDefense(nodeChar)

Debug.chat("nodeChar: ", nodeChar) << this actually works
local nodeChar = window.getDatabaseNode(); << and then you break it!!!



I wrote above that you had to be on the character sheet or one of its sub-somethings to be able to use window.getDatabaseNode()
The window is referring to the displayed window that the control is on/in
If you are in an external script you are not able to reference the window because you are not on/in the window

greybeardgunner70
January 4th, 2022, 03:50
OK well I am confused even more so now. Do I need local nodeChar = xxxx.getDatabaseNode or not?

I didnt have anything defining nodeChar before (like the example you gave me initially), but the error was "can't find inventorylist" Which I am thinking, means it couldn't find it because it wasn't defined.

I now understand about the difference between a window and an external, and how you can define something thats in the window. I have no idea how to define something else.

local nScore = 1;
local nScore = 100;

then nScore will only equal one of these. Which one? The last one.

greybeardgunner70
January 4th, 2022, 03:58
function updateDefense(nodeChar)

Debug.chat("nodeChar: ", nodeChar)

local nbskull = 0;
local neskull = 0;
local npskull = 0;
local nfskull = 0;

local nbface = 0;
local neface = 0;
local npface = 0;
local nfface = 0;

.........

local nbfeet = 0;
local nefeet = 0;
local npfeet = 0;
local nffeet = 0;


for k,v in pairs (nodeChar.inventorylist.getChildren())
do if v.getChild("equipped").getValue() == 1 then

nbskull = nbskull+v.getChild("bskull").getValue()
neskull = neskull+v.getChild("eskull").getValue()
npskull = npskull+v.getChild("pskull").getValue()
nfskull = nfskull+v.getChild("fskull").getValue()

nbface = nbface+v.getChild("bface").getValue()
neface = neface+v.getChild("eface").getValue()
npface = npface+v.getChild("pface").getValue()
nfface = nfface+v.getChild("fface").getValue()

.........

nbfeet = nbfeet+v.getChild("bfeet").getValue()
nefeet = nefeet+v.getChild("efeet").getValue()
npfeet = npfeet+v.getChild("pfeet").getValue()
nffeet = nffeet+v.getChild("ffeet").getValue()
Debug.chat(v.getChild("name").getValue(),nbskull,neskull,npskull,nfskull,nbfac e,neface,npface,nfface,nbneck,neneck,.....

end

nodeChar.getChild("bskull").setValue(nbskull);
nodeChar.getChild("eskull").setValue(neskull);
nodeChar.getChild("pskull").setValue(npskull);
nodeChar.getChild("fskull").setValue(nfskull);

nodeChar.getChild("bface").setValue(nbface);
nodeChar.getChild("eface").setValue(neface);
nodeChar.getChild("pface").setValue(npface);
nodeChar.getChild("fface").setValue(nfface);

nodeChar.getChild("bneck").setValue(nbneck);
nodeChar.getChild("eneck").setValue(neneck);
nodeChar.getChild("pneck").setValue(npneck);
nodeChar.getChild("fneck").setValue(nfneck);

nodeChar.getChild("bshoulder").setValue(nbshoulder);
nodeChar.getChild("eshoulder").setValue(neshoulder);
nodeChar.getChild("pshoulder").setValue(npshoulder);
nodeChar.getChild("fshoulder").setValue(nfshoulder);

.......

nodeChar.getChild("bfeet").setValue(nbfeet);
nodeChar.getChild("efeet").setValue(nefeet);
nodeChar.getChild("pfeet").setValue(npfeet);
nodeChar.getChild("ffeet").setValue(nffeet);

end

end

This is the script that I had based on your earlier example. This is the error I get:

[1/3/2022 7:23:24 PM] [ERROR] Script execution error: [string "campaign/Scripts/managerChar.lua"]:94: attempt to index field 'inventorylist' (a nil value)

The debug returns with the charsheet number. Which means its looking on the CS, but not finding "inventorylist" correct?

mattekure
January 4th, 2022, 04:15
I'm fairly certain its because you are using inventorylist incorrectly in this statement.


for k,v in pairs (nodeChar.inventorylist.getChildren())

You cant get db nodes like that. Instead, you would do something like



for k,v in pairs(DB.getChildren(nodeChar, "inventorylist")) do


for documentation on that function, check https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644582/DB#getChildren

damned
January 4th, 2022, 04:21
OK well I am confused even more so now. Do I need local nodeChar = xxxx.getDatabaseNode or not?

I didnt have anything defining nodeChar before (like the example you gave me initially), but the error was "can't find inventorylist" Which I am thinking, means it couldn't find it because it wasn't defined.

I now understand about the difference between a window and an external, and how you can define something thats in the window. I have no idea how to define something else.

local nScore = 1;
local nScore = 100;

then nScore will only equal one of these. Which one? The last one.

In post 686
https://www.fantasygrounds.com/forums/showthread.php?61387-Ruleset-Wizard-The-new-Ruleset-development-environment&p=633282&viewfull=1#post633282

On the Equipped field which is on teh character sheet we both define nodeChar using:
local nodeChar = window.getDatabaseNode().getParent().getParent();
and we send nodeChar to the script using:
managerChar.updateDefense(nodeChar);
the nodeChar in brackets means we are running that function and supplying it the nodeChar data

in the managerChar file we have a function that is receiving the nodeChar data
function updateDefense(nodeChar)
thats what the nodeChar in the brackets means
if you Debug.chat("managerChar: ", nodeChar) it should display the data you sent it which will hopefully be charsheet.id-xxxxx (if not fix that first)

so dont redefine nodeChar again in this function as you already have been sent it

damned
January 4th, 2022, 04:27
try mattekures suggestion also


I just looked up one of my projects and the code I used was:

local nodeInventory = nodeChar.getChild("inventorylist");
local nArmorBase = 0;
local nArmorBonus = 0;

for k,v in pairs (nodeInventory.getChildren())
do if v.getChild("item_type").getValue() == 'armor' and v.getChild("carried").getValue() == 2 then
if v.getChild("armor_bonus").getValue() > 0 then
nArmorBonus = nArmorBonus + v.getChild("armor_bonus").getValue();
end
if v.getChild("armor").getValue() >= nAgility then
nArmorBase = nArmorBase + v.getChild("armor").getValue()
end
end
end

Im guessing that combining the two ought to be ok but you can also try the 2 stage code
this is not the whole code/function just showing enough to highlight some code that I know is working

damned
January 4th, 2022, 04:31
It looks like I combined them badly in my example to you

try this:
nodeChar.getChild("inventorylist").getChildren()

greybeardgunner70
January 4th, 2022, 13:48
in the managerChar file we have a function that is receiving the nodeChar data
function updateDefense(nodeChar)
thats what the nodeChar in the brackets means
if you Debug.chat("managerChar: ", nodeChar) it should display the data you sent it which will hopefully be charsheet.id-xxxxx (if not fix that first)

so dont redefine nodeChar again in this function as you already have been sent it

Yes, it returns the CS number, so that's working properly.

greybeardgunner70
January 4th, 2022, 14:03
I'm fairly certain its because you are using inventorylist incorrectly in this statement.


for k,v in pairs (nodeChar.inventorylist.getChildren())

You cant get db nodes like that. Instead, you would do something like



for k,v in pairs(DB.getChildren(nodeChar, "inventorylist")) do


for documentation on that function, check https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644582/DB#getChildren

Returned error [1/4/2022 8:00:56 AM] [ERROR] Script execution error: [string "campaign/Scripts/managerChar.lua"]:97: attempt to index a nil value

greybeardgunner70
January 4th, 2022, 14:10
try mattekures suggestion also


I just looked up one of my projects and the code I used was:

local nodeInventory = nodeChar.getChild("inventorylist");
local nArmorBase = 0;
local nArmorBonus = 0;

for k,v in pairs (nodeInventory.getChildren())
do if v.getChild("item_type").getValue() == 'armor' and v.getChild("carried").getValue() == 2 then
if v.getChild("armor_bonus").getValue() > 0 then
nArmorBonus = nArmorBonus + v.getChild("armor_bonus").getValue();
end
if v.getChild("armor").getValue() >= nAgility then
nArmorBase = nArmorBase + v.getChild("armor").getValue()
end
end
end

Im guessing that combining the two ought to be ok but you can also try the 2 stage code
this is not the whole code/function just showing enough to highlight some code that I know is working

Part of this seems to be working. The debug shows the script defining nodeInventory properly. See image.
However, the error is still in getChildren (lines 99 and 100 of the script)

local nffeet = 0;

for k,v in pairs (nodeInventory.getChildren())
do if v.getChild("equipped").getValue() == 1 then

nbskull = nbskull+v.getChild("bskull").getValue()

50720

damned
January 4th, 2022, 14:12
You really need to post bigger chunks of code AND include line numbers please...

greybeardgunner70
January 4th, 2022, 14:15
It looks like I combined them badly in my example to you

try this:
nodeChar.getChild("inventorylist").getChildren()

I'm not sure which example you are talking about here.

This:
local nffeet = 0;


for k,v in pairs nodeChar.getChild("inventorylist").getChildren()
do if v.getChild("equipped").getValue() == 1 then

nbskull = nbskull+v.getChild("bskull").getValue()

Returns the error:
[1/4/2022 8:13:39 AM] [ERROR] Failed to load script buffer (HarnMaster3.5.new) (managerChar): [string "campaign/Scripts/managerChar.lua"]:96: 'do' expected near 'nodeChar

damned
January 4th, 2022, 14:19
put the section between pairs and do in brackets

greybeardgunner70
January 4th, 2022, 14:23
You really need to post bigger chunks of code AND include line numbers please...

The only way I know how to post with line numbers is through images. If you know a way for RW or notepad to let me copy script with the line numbers I'll be happy to do that.

50721
50722
50723
50724

damned
January 4th, 2022, 14:25
You are reporting errors around 96-100 but you havent included any code for these lines?

greybeardgunner70
January 4th, 2022, 14:32
You are reporting errors around 96-100 but you havent included any code for these lines?

I took out "local nodeInventory = nodeChar.getChild("inventorylist");" and the debug, since the second suggestion you sent didnt refer to nodeinventory. So that dropped the getChildren to 96.

I went back, put in the brackets (re-attempt # 1) and replaced nodeInventory (re-attempt # 2). Both attempts got the same error.

[string "campaign/Scripts/managerChar.lua"]:100: attempt to index a nil value

damned
January 4th, 2022, 14:39
Please share the RWP file?

damned
January 4th, 2022, 14:39
and your db.xml

damned
January 4th, 2022, 15:15
The issue is not with this line:
for k,v in pairs (nodeInventory.getChildren())

it is with this line:
do if v.getChild("equipped").getValue() == 1 then

the field is carried not equipped

the next issue is that these fields do not exist on the charsheet

nodeChar.getChild("bskull").setValue(nbskull);
nodeChar.getChild("eskull").setValue(neskull);
nodeChar.getChild("pskull").setValue(npskull);
nodeChar.getChild("fskull").setValue(nfskull);

nodeChar.getChild("bface").setValue(nbface);
nodeChar.getChild("eface").setValue(neface);
nodeChar.getChild("pface").setValue(npface);
nodeChar.getChild("fface").setValue(nfface);

they occur in the weapon but not on the charsheet where you are setting them.

damned
January 4th, 2022, 15:34
Also if you want to check if equipped then its carried == 2
you need to look in the db.xml and see the data that is being captured.

greybeardgunner70
January 4th, 2022, 17:09
The issue is not with this line:
for k,v in pairs (nodeInventory.getChildren())

it is with this line:
do if v.getChild("equipped").getValue() == 1 then

the field is carried not equipped

the next issue is that these fields do not exist on the charsheet

nodeChar.getChild("bskull").setValue(nbskull);
nodeChar.getChild("eskull").setValue(neskull);
nodeChar.getChild("pskull").setValue(npskull);
nodeChar.getChild("fskull").setValue(nfskull);

nodeChar.getChild("bface").setValue(nbface);
nodeChar.getChild("eface").setValue(neface);
nodeChar.getChild("pface").setValue(npface);
nodeChar.getChild("fface").setValue(nfface);

they occur in the weapon but not on the charsheet where you are setting them.

That was the problem. Works well now. Still a few issues with some fields not being populated but I can troubleshoot those. The fields you mentioned are on the Notes tab. See image.

50726

greybeardgunner70
January 4th, 2022, 17:46
Back to nodeWin and nodeChar. Is nodeWin restricted to the window the control is on? In other words, I can't reference a value on another window in the CS using nodeWin, I need to use nodeChar? For example, I want the Initiative EML (roll) on the Notes tab, but the skill data is on the Abilities tab. The script wouldn't work until I moved the Initiative EML roll to the Abilities tab.

Disregard, sometimes I forget I have to change a number or two to get the onValueChanged scripts to work correctly.

greybeardgunner70
January 4th, 2022, 20:59
I really appreciate all the help Ive gotten with this project, its been a learning experience. I am about 99% done with the CS, I'll move on to some of the other elements (mostly theme and graphics) next. However, I do have one more Q re the CS. Below is the script I have in managerRolls. When I apply modifiers through the modifiers box, it doesnt change the nResult. See image. Is it possible to script that in?

50735

function Skill(rSource, rTarget, rRoll)

local nSkillScore = tonumber(rRoll.SkillScore);

local nResult = rRoll.aDice[1].result;

local sResult = '';

if nResult > nSkillScore then

if nResult % 5 == 0 then
sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Critical Failure ";
else
sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Marginal Failure ";
end
else
if nResult % 5 == 0 then
sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Critical Success ";
else
sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Marginal Success ";
end
end

local rMessage = ActionsManager.createActionMessage(rSource, rRoll);

rMessage.text = rMessage.text .. sResult;
Comm.deliverChatMessage(rMessage);

return true
end

damned
January 4th, 2022, 21:43
Back to nodeWin and nodeChar. Is nodeWin restricted to the window the control is on? In other words, I can't reference a value on another window in the CS using nodeWin, I need to use nodeChar? For example, I want the Initiative EML (roll) on the Notes tab, but the skill data is on the Abilities tab. The script wouldn't work until I moved the Initiative EML roll to the Abilities tab.

Disregard, sometimes I forget I have to change a number or two to get the onValueChanged scripts to work correctly.

nodeChar is referencing the database.
providing that the data you want to access is in the database then so long as you have nodeChar you can get to the data.

damned
January 4th, 2022, 21:44
I really appreciate all the help Ive gotten with this project, its been a learning experience. I am about 99% done with the CS, I'll move on to some of the other elements (mostly theme and graphics) next. However, I do have one more Q re the CS. Below is the script I have in managerRolls. When I apply modifiers through the modifiers box, it doesnt change the nResult. See image. Is it possible to script that in?

50735

function Skill(rSource, rTarget, rRoll)

local nSkillScore = tonumber(rRoll.SkillScore);

local nResult = rRoll.aDice[1].result;

local sResult = '';

if nResult > nSkillScore then

if nResult % 5 == 0 then
sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Critical Failure ";
else
sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Marginal Failure ";
end
else
if nResult % 5 == 0 then
sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Critical Success ";
else
sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Marginal Success ";
end
end

local rMessage = ActionsManager.createActionMessage(rSource, rRoll);

rMessage.text = rMessage.text .. sResult;
Comm.deliverChatMessage(rMessage);

return true
end

right under
function Skill(rSource, rTarget, rRoll)
do
Debug.chat("rRoll: ", rRoll);

do several rolls with and without modifiers
see where the modifiers appear in the rRoll and then capture them.

greybeardgunner70
January 4th, 2022, 23:11
What do you mean by "capture them"?