-
July 7th, 2022, 23:13 #861
I just realized the subwindow control shouldn't have the source property:
Captura de pantalla 2022-07-08 001256.png
I'll fix it in the next update.Ruleset Wizard
The Ruleset Development Environment
www.rulesetwizard.com
Ruleset Wizard Tutorials
Damned's Ruleset Wizard Tutorials
-
July 9th, 2022, 01:22 #862
I have been perusing the various videos, and have managed to make what I feel like is pretty decent progress using this software considering I have almost no experience with coding of any kind. The various videos posted by psicodelix, damned, and frostbyte have been a huge help.
My biggest struggle has been understanding and implementing global variables and modifiers. I have been digging through code, and have managed to figure out bits and pieces, but am unable to actually make anything work.
The short of it is that I was hoping that I had missed a video or tutorial on how to automate turning an ability score into a modifier and applying that modifier across the character sheet. Some of the videos I have come across implement a version of this on the same tab of the character sheet, but don't show how to get my Strength modifier into my damage roll on the Combat tab or my Intelligence score onto my Skills tab.
Any direction or help would be greatly appreciated.
Thanks!
-
July 9th, 2022, 02:56 #863
Hi Tenebris
Its hard to give you specific advice with the info provided.
Example 1.
Create 2 number fields str and strmod
on str and some code in the function onValueChanged() that looks something like this:
Code:function onValueChanged() nScore = getValue(); sName = getName(); nodeChar = window.getDatabaseNode(); DB.setValue(nodeChar, sName .. "mod", "number", nScore-10); end
make strmod readonly and add the following code:
Code:function onDoubleClick(x, y) local nStart, nEnd, attName = string.find(getName(), "(%a%a%a).*") attName = string.upper(attName); ModifierStack.addSlot(attName, getValue()); end
Example 2
On your weapons attack roll add something like this:
Code:function onBeforeDiceRoll() local nodeWeapon = window.getDatabaseNode(); local nodeChar = window.getDatabaseNode().getParent().getParent(); local nStrMod = nodeChar.getChild("strmod").getValue(); DiceRollString ="1d20+" .. nStrMod; return true; end
These are just examples and probably wont meet your exact needs but will hopefully get you on the right track.
-
July 9th, 2022, 18:48 #864
Damned,
I appreciate the response. I am a bit delayed in responding because I have been trying to put your suggestions into action. I have actually been extremely successful in getting several aspects of my ruleset build into practice, such as calculating encumbrance and max weight values, that have been something of a thorn in my side.
What you provided ended up allowing my to make a great deal of forward progress in a few areas, but I actually ended up using some of the code that you had provided in one of your videos because it just seemed to make more sense in my head (hopefully I am not using it incorrectly). However, on my end, many things are looking the way I want them to:
Code:function onValueChanged() local nodeWin = window.getDatabaseNode(); local nScore = nodeWin.getChild("agility").getValue() if nScore <= 5 then nBonus = 0; elseif nScore <= 10 then nBonus = 1; elseif nScore <= 15 then nBonus = 2; elseif nScore <= 20 then nBonus = 3; elseif nScore <= 25 then nBonus = 4; elseif nScore <= 30 then nBonus = 5; end nodeWin.getChild("init").setValue(nBonus); nodeWin.getChild("movebonus").setValue(nBonus); end
Code:function onInit() local nodeWin = window.getDatabaseNode(); local nScore = nodeWin.getChild("endurance").getValue() if nScore <= 5 then nHealth = "d3"; elseif nScore <= 10 then nHealth = "d4"; elseif nScore <= 15 then nHealth = "d6"; elseif nScore <= 20 then nHealth = "d8"; elseif nScore <= 25 then nHealth = "d10"; elseif nScore <= 30 then nHealth = "d12"; end nodeWin.getChild("healthdie").setValue(nHealth); end
-
July 9th, 2022, 22:22 #865
Try this as the endurance onValueChanged:
Code:function onValueChanged() local nScore = getValue() if nScore <= 5 then nHealth = {"d3"}; elseif nScore <= 10 then nHealth = {"d4"}; elseif nScore <= 15 then nHealth = {"d6"}; elseif nScore <= 20 then nHealth = {"d8"}; elseif nScore <= 25 then nHealth = {"d10"}; elseif nScore <= 30 then nHealth = {"d12"}; end window.healthdie.setDice(nHealth); end
This sample uses control references, you could need to use database references depending on your set up.Ruleset Wizard
The Ruleset Development Environment
www.rulesetwizard.com
Ruleset Wizard Tutorials
Damned's Ruleset Wizard Tutorials
-
July 10th, 2022, 03:03 #866
Also its common to do something like this:
Code:function onInit() onValueChanged(); end function onValueChanged() your code here; end
I think that is what you are getting at...
-
July 11th, 2022, 00:45 #867
Thanks so much for your help; I will try to not abuse the privilege. I have everything working on the main tab pretty much how I want it and am working my way through completing the rest of the character sheet, adding in sidebar options, and tweaking the ps and ct. I know many of the videos you all have posted have answered a number of my questions, so I will try to look to those before I hassle you all any further.
-
July 11th, 2022, 10:13 #868
Also be aware that the FG Discord server has a #ruleset_wizard channel that has plenty of people who help others out.
-
August 24th, 2022, 05:48 #869
- Join Date
- May 2018
- Location
- Southeast OK
- Posts
- 82
I took a hiatus from working on a project, the dice boxes worked then, but now I get this error;
[ERROR] Script execution error: [string "RulesetWizardDiceRoller.lua"]:41: attempt to call field 'getActor' (a nil value).
Any help would be appreciated.
-
August 24th, 2022, 05:55 #870
getActor has been deprecated (by Fantasy Grounds not by the RSW)
you need to replace
".getActor("pc", "
with
".resolveActor("
without the quotes
and the same for
".getActor("npc", "Last edited by damned; August 24th, 2022 at 06:32.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks