PDA

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



Pages : 1 2 3 [4] 5

damned
January 5th, 2022, 00:06
in this line:

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

you are "capturing" the rRoll.aDice[1].result and storing it as nResult.

I dont know if that description uses the correct terms - Im no programmer!

Have a look at the rest of the output from the Debug

Also - regarding aDice - that is an array.
It stores several pieces of information about each dice that was thrown - the dice size and the dice result and the dice value (one of which you can manipulate) and dice type and expression and it stores it for each dice thrown. The first dice is known as aDice[1] and the second dice is aDice[2]

Anyway your modifiers are not stored in the aDice part - but they are there elsewhere in the rRoll data

try doing things like

Debug.chat("nBonuses: ", rRoll.nBonuses);
Debug.chat("s'nMod: ", rRoll.s'nMod);
Debug.chat("s'sType: ", rRoll.s'sType);

etc

Then work out what you need to do next...

greybeardgunner70
January 6th, 2022, 16:02
This vid describes what I am wanting to do, does it not? Apply the mod to the target number before the roll. All I will need to do is edit and add the top half of your script from AAF and retain the nResult portion from mine.


Basic Ruleset Creation Tutorial Series 007
https://www.youtube.com/watch?v=5wRR5vi-X8c

damned
January 6th, 2022, 22:07
What you are looking for is something like this:


local nDamage = 0;
for _,v in ipairs(rRoll.aDice) do
nDamage = nDamage + v.result;
end
nDamage = nDamage + rRoll.nMod +rRoll.nBonuses;
but you should try to follow my nudges above to increase understanding of why this works or is needed.

greybeardgunner70
January 6th, 2022, 22:40
Nudges followed, videos reviewed, other rulesets perused. Still a blindfolded drunk in a knife fight. I have an understanding of some LUA phrasing. But its like knowing what taco, hacienda and pantalones mean and trying to say in spanish "While wearing my red pants, I ate tacos at the house."

damned
January 6th, 2022, 22:42
share your damage script please.

greybeardgunner70
January 6th, 2022, 22:58
Its not a damage script, its my managerRolls skill roll. Here's what I am experimenting with so far:

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

local sModDesc, nMod = ModifierStack.getStack(true);

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

local nTarget = nSkillScore + nMod;
Debug.chat("nTarget: ", nTarget);

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

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 6th, 2022, 22:59
also post the output from the Debug.chat("rRoll: ", rRoll);

greybeardgunner70
January 6th, 2022, 23:00
It will find the SkillScore and the nMod, it just wont do the math. nSkillScore + nMod

damned
January 6th, 2022, 23:00
better also post a screen shot too

greybeardgunner70
January 6th, 2022, 23:01
s'rRoll: ' | { s'nBonuses' = s'0', s'aDice' = { #1 = { s'value' = #87, s'type' = s'd100', s'result' = #87 }, s'expr' = s'd100' }, s'nMod' = #-20, s'sType' = s'wpn1_a_emlRollAction', s'bSecret' = bFALSE, s'SkillScore' = s'65', s'sDesc' = s'Attack EML Test Result For ML 80 - 15 PP [-20]' }

s'nSkillScore: ' | #65

s'nTarget: ' | #65

s'nResult: ' | #87

greybeardgunner70
January 6th, 2022, 23:03
50807

damned
January 6th, 2022, 23:16
Ok, ok,

in your debug you get

s'rRoll: ' | { s'nBonuses' = s'0', s'aDice' = { #1 = { s'value' = #87, s'type' = s'd100', s'result' = #87 }, s'expr' = s'd100' }, s'nMod' = #-20, s'sType' = s'wpn1_a_emlRollAction', s'bSecret' = bFALSE, s'SkillScore' = s'65', s'sDesc' = s'Attack EML Test Result For ML 80 - 15 PP [-20]' }

whenever data is being sent in these arrays it is converted to a string so that is one potential issue

but then I see this and I am confused

local sModDesc, nMod = ModifierStack.getStack(true);

this command gets the Modifier stack descriptions and modifiers and saves them into sModDesc and nMod

but it looks like (from your rRoll) that you are already sending that in your roll - most likely in your RW properties where you have set Use Modifier Stack and Reset Modifier Stack to True
so there wont be anything in the modifier stack for your manual command to retrieve.

To get the Modifier data into your result change

if nResult > nSkillScore then

to

nResult = nResult + tonumber(rRoll.nMod);
if nResult > nSkillScore then

this is retrieving the nMod from the rRoll (rRoll.nMod) and converting the string value to a number tonumber() and then adding it to nResult nResult = nResult + tonumber(rRoll.nMod)

That is probably the fix for you right now...

damned
January 6th, 2022, 23:16
oh and get rid of the modifierstack line

greybeardgunner70
January 6th, 2022, 23:37
Works great! How do I get it to stop at 1? For example, in one test with a -20 modifier, it returned -8 on a roll of 12. I would have that thought this parameter would have been inherent to rRoll, but perhaps I've tweaked it enough in this script to disable most of the built in stuff? This is what I ended up with:

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


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

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

local sResult = '';

nResult = nResult + tonumber(rRoll.nMod);
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 6th, 2022, 23:54
Change this:

nResult = nResult + tonumber(rRoll.nMod);
if nResult > nSkillScore then

to this:

nResult = nResult + tonumber(rRoll.nMod);
if nResult > 1 then nResult = 1; end
if nResult > nSkillScore then

greybeardgunner70
January 7th, 2022, 00:32
Thanks for your help! I'll leave you alone for a couple days. ;-)

greybeardgunner70
January 8th, 2022, 12:31
So here is an excerpt from the managerChar script:

local nbknees = 0;
local neknees = 0;
local npknees = 0;
local nfknees = 0;

local nbcalves = 0;
local necalves = 0;
local npcalves = 0;
local nfcalves = 0;

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


for k,v in pairs (nodeChar.getChild("inventorylist").getChildren())
do if v.getChild("carried").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()

nbneck = nbneck+v.getChild("bneck").getValue()
neneck = neneck+v.getChild("eneck").getValue()
npneck = npneck+v.getChild("pneck").getValue()
nfneck = nfneck+v.getChild("fneck").getValue()

Whenever I add a piece of armor that hits a blank entry I get this error:

[1/8/2022 7:27:33 AM] [ERROR] Script execution error: [string "campaign/Scripts/managerChar.lua"]:99: attempt to index a nil value

Line 99 is "nbskull = nbskull+v.getChild("bskull").getValue()"

Normally I would replace "nbskull = nbskull+v.getChild("bskull").getValue()" with "DB.setValue(nodeWin, "bskull", "number", bskull);" and that would solve the "nil value" problem. But I dont know how to do that with the +v.getChild math string.

Do I need to set the default value for each box at "0" in RW or in the script? Or is there another way to get around the error?

damned
January 8th, 2022, 12:39
try
nbskull = nbskull+DB.getValue(v, "bskull", "number", 0);

Does that work?
Please also confirm that nbskull already exists before ln99 and you know that equipped is carried == 2 right?

greybeardgunner70
January 9th, 2022, 17:11
OK, so I have everything working now. CS is done (though I am loath to say that, as I am sure I am jinxing myself, we'll find out TUE night). Screens of major changes:

50867

50868

50869

damned
January 9th, 2022, 21:50
looking great greybeardgunner70!

GunnarGreybeard
January 10th, 2022, 01:38
Wow! Excellent work there greybeardgunner70!

greybeardgunner70
January 11th, 2022, 11:18
I'm having an issue and I'm not really sure if its with how I have setup the CS or with something more fundamental with CoreRPG. I'm sure, whatever the cause, its my own fault. Here it is:

I created a list of items based on the ruleset (weapons, armor, gear) so that players could drag them from the items menu onto the inventory of their CS. I then pushed the item list into a module so that my players could load it. That all works perfectly.

However, when I create a new item (for example, a custom weapon) in the list, my players can't see it and I can't drop it on their inventory. Its as if the CS will only recognize items that were in the original module.

Any thoughts?

damned
January 11th, 2022, 11:44
Share your .rwp with me if you cant find it.

Do the items in the module show in Items or only in the Library view?
If not that is your clue.

greybeardgunner70
January 11th, 2022, 14:27
As I expected, operator error. I will have to wait until I get home to be sure, but it seems to work when I "share" the newly created item. I didn't realize I would need to do that.

damned
January 11th, 2022, 14:38
Yeah - exporting to a module is the best way because you dont have to share all the individual items that way - you can just have them load a Player Module.

damned
January 24th, 2022, 22:58
4 Ruleset Wizard created rulesets created in the last month!
Sweet!

Masks https://forge.fantasygrounds.com/shop/items/477/view
Fall Out https://forge.fantasygrounds.com/shop/items/468/view
Kult: Divinity Lost https://forge.fantasygrounds.com/shop/items/425/view
White Lies https://forge.fantasygrounds.com/shop/items/441/view

greybeardgunner70
February 3rd, 2022, 01:39
How do I get my frames to stretch when a window is resized (the combat tracker for example). Am I missing something in the class or display properties?
51290

damned
February 3rd, 2022, 01:40
Whats not working GBG?
What is happening?

greybeardgunner70
February 3rd, 2022, 03:07
When I open the combat tracker in FGU and resize the CT window, the frame doesnt stretch with the window. So I get a "tiled effect with multiple frames.
51291

damned
February 3rd, 2022, 03:55
Go to graphics/frames/utilitybox2 and set the offset there to something like 20,20,202,20

greybeardgunner70
February 3rd, 2022, 22:20
That worked great, thanks.

51302

Is it possible to edit the Combat Tracker header?

greybeardgunner70
February 3rd, 2022, 22:21
That worked great, thanks.

51302

Is it possible to edit the Combat Tracker header?

damned
February 3rd, 2022, 22:26
Id lose the part of the frame that sits in the top and bottom because its very hard to align that.
Make the offset more like
100,200,100,200
with the new frame you have used. experiment with those settings but that looks close to right.

the header is called windowtitle or windowtitlebar

damned
February 3rd, 2022, 22:37
this is super quick - and the image with transparency Ive only done one side and quickly... id see if something like this gives you better consistency

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

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

5130351304

damned
February 3rd, 2022, 22:41
Specifically for the combat tracker you might do one that has no scroll/line work on the lhs.
Frames often go thru multiple iterations before Im happy with them :)

greybeardgunner70
February 3rd, 2022, 22:45
OK thanks

greybeardgunner70
February 5th, 2022, 22:18
Is is possible to get a "Label" to display vertically?

damned
February 6th, 2022, 00:28
There is no support in FG for that at this time. The Vertical TABS in all Core rulesets are all done with images for lables.

damned
February 6th, 2022, 00:29
Screenshot of what you ended up with for those frames?

Valyar
February 13th, 2022, 09:50
I have spend a lot of time today on the Ruleset Wizard to do layout work and for 2h I managed to achieve what probably would take three times longer in .XML, even if I am quite proficient now with eyeballing to pixel level and measuring in Affinity Photo.

There are certain improvements that I believe are must have for the Ruleset wizard to be excellent main tool for development and allow collaboration with people that are not using it and follow SWs guidance. The development guidelines from SW are clear and recommend where certain elements to be placed. They also teach good coding practices and approach used in the commercial rulesets.

I suggest the XML code to be organized according to those recommendations, and not place things into the base.xml. What I mean by that:

When new project is created, allow the user to select if they want pre-defined project structure as per SW guidelines. If selected, you will get all folders in the ruleset explorer: campaign/graphics(with sub folders for resources like frames, fonts, icons)/scripts/strings/common(for templates) as minimum. Not all need ct and ps.
Place all XML code for frames, fonts, icons into graphics_frames/fonts/icons.xml rather than the base.xml, which is quite messy.
Generate strings_<rulesetname>.xml for strings under ./strings root folder instead of XML in the very root of the ruleset
Allow users to duplicate class/font/icon/frame elements. For example I needed 4-5 instances of single font, different size and it was too cumbersome to create it from scratch every time. In .XML is 15 seconds to copy it few times and adjust the size.


I have been looking at the explorer and I think that nice enhancement that instructs the program how to arrange the XML code will be if we can nest the windowclass/frame/icon/font under object that represent the .xml file and the application will be putting the relevant code in the same file.



This will really improve the layout and the way how a project is structured on compilation.

psicodelix
February 14th, 2022, 08:47
Ok, several of those requests have long been on the wish list, and I've added the missing ones. It is clear to me that the program needs more options to customize the organization of folders, files and assets. Those features will be addressed in the near future.

Brotherkelly
February 17th, 2022, 18:20
Hi Psicodelix,

I am starting to work on the Battletech A Time of War rules using the ruleset wizard and was wondering if there is dice string for exploding a die die only when both roll the maximum. The rules use 2d6 for all actions and if both dice are a 6 then another d6 is rolled.

I know how to set the standard exploding dice - 2d6e, but is there a command that will explode only if both are 6?

I suspect not, in whcih case I will look to do this in the code (as I have done with my original extension).

damned
February 17th, 2022, 20:49
You will need to code this one manually.

Brotherkelly
February 18th, 2022, 08:07
Thanks Damned, thought as much.

damned
February 18th, 2022, 23:37
But you dont have to code it all manually
There are a bunch of functions and steps in the Wizard to make it easier...

Grivenger
February 25th, 2022, 13:10
I just stumbled upon the ruleset wizard, and I'm wondering what it can do. Is the Ruleset Wizard useful when you want to create extensions/modules that modify an existing ruleset? For example, Pathfinder 2e?

damned
February 25th, 2022, 13:16
It is useful yes.
You still have to learn how FG is built but it can make life a lot easier.

Kevlyn
March 12th, 2022, 20:05
I have a situation where I am using a Number Field, when the value of the field changes I check to see if the field hasFocus() before I execute the code, if it does not have focus I do not want the code to run. That works great. The problem is there is a stringcycler that is tied to the field, and when I click on the stringcycler it should only execute its code if the Number Field does not have focus, when I change the Number Field it gains focus and then still retains focus even though I've clicked on another control.

I have attempted to use onClickRelease() and onClickDown() to remove the focus.

onClickRelease(button, x, y)
-- the control that has the focus
window.starting_points.setFocus(false);
-- the event ends here no matter the return value, which is the problem
return true;
return false;
return nil;
end

I expected that if I returned nil, the event would continue bubbling but the stringcycler does not change values when I add either event listener.

So either I need to manually turn the focus off of the Number Field or I need to somehow add the ability to setFocus to the stringcycler, otherwise I will end up in a onValueChanged loop between these controls.

Thanks in advance for any help to puzzle this one out.

damned
March 12th, 2022, 23:35
You adding a script has probably affected whether the script that runs the combobox is being run.
You cant have 2 scripts attached to the control.

Kevlyn
March 13th, 2022, 16:43
Interesting, I went digging into the CoreRPG files and noticed that button_stringcycler.lua had a onClickDown event that simply returned true. So I added that to my script and inserted my defocusing line and today it works as expected. So, I guess I will chalk that up to "take a break and come back to it."

Thanks for pointing me in the right direction though, as I had not thought to see if the underlying combobox code was inhibiting me.

greybeardgunner70
March 16th, 2022, 20:00
Gents,
Since the last FGU update (which changed how the coin scripts work) I have been getting an error on my CS (see image). From what I can see/know "sub_currency" is a new is a new control. Any ideas on what I need to do to correct this?

52014

damned
March 16th, 2022, 21:17
You will need to look at the new coin/currency setup in CoreRPG. It has been changed to a more dynamic setup so that people can have as many currencies as they need for their campaign.

In your setup you might get away with just adding a coinframe

Moon Wizard
March 16th, 2022, 21:27
The new templates for the default CoreRPG currency behaviors assume that there is a "coinframe" control that provides a location where you want the currency list to be displayed.

The "list_charcurrency"/"scrollbar_currencylist"/"button_iadd_currencylist"/"button_iedit_currencylist" are for adding a straight currency list.

The "sub_charcurrency"/"scrollbar_sub_charcurrency"/"button_iadd_sub_charcurrency"/"button_iedit_sub_charcurrency" are for backward compatibility for currency lists with an extra "coinother" field (which is not really needed any longer)

The "list_charcurrency_inline"/"button_iadd_currencylist_inline"/"button_iedit_currencylist_inline" are for an inline currency list like 5E, instead of a specific framed area. (It also requires "moneytitle" control to appear below.)

Regards,
JPG

HighInquisitorTremayne
March 16th, 2022, 22:32
Sorry if this has been covered but I didn't find it when I searched the thread. I am making a new ruleset and following your tutorial damned, but at the very first few steps I cannot get my charsheet to display properly. My frame is set to 500x500px and 96px per inch. But I can't get it to show when launched. Any suggestions? Here (https://imgur.com/a/J2WsNBs) is a link to the images of my steps. I'm using Unity if that makes a difference.

damned
March 16th, 2022, 23:10
Change that windowclass to charsheet instead of charsheet_main
I dont believe that the 96ppi is relevant any more.

HighInquisitorTremayne
March 17th, 2022, 04:18
Thanks. Unfortunately, now I cannot launch a character sheet in FG. Nor am I able to create a new character in the Character Selection window, nor can I close the Character Selection window.

Do I need to link the frame to the window under Display in RW?

damned
March 17th, 2022, 04:42
Post another screenshot please HighInquisitorTremayne

For clarity -

The character sheet frame (the frame that FG displays, not the image) is specified in a windowclass called charsheet. In your image above you have called it charsheet_main
That is also a valid windowclass but its not the one that displays the graphic you have on the screen.

damned
March 17th, 2022, 04:51
The frame is a separate object and ideally you will use the same names as CoreRPG uses when you are doing a 1:1 replacement. Not for any technical reason - it just helps other people understand what you are doing.

You need a windowclass called charsheet and it will include a frame name
You need a frame and it includes the image filename and the 9 slices definitions

HighInquisitorTremayne
March 17th, 2022, 05:00
Thanks. I added the screenshot to the previous imgur link, at the bottom.

damned
March 17th, 2022, 05:07
Good you are closer.
Your windowclass is now correctly named. Next you need to put your frame name in the frame field. In this case your frame is also called charsheet

HighInquisitorTremayne
March 17th, 2022, 05:18
Updated and now getting a blank charsheet. 2 images added to imgur link.

damned
March 17th, 2022, 05:45
5202852029

One of these images shows a sample charsheet frame
i have added the minimum amount of info - an image, a name and the offset (9 slices)

One of these images is a windowclass
I have added the frame (in this case its called frame-black) I have set some height and width
I have added a name
I have also added a Merge = join statement and that will pick up anything from the original that I dont specifically define
I have also added a bunch off fields (but ignore those for now)

HighInquisitorTremayne
March 17th, 2022, 13:52
So the only 2 things different that I can see between mine and yours is 1) your frame image file does not have a file link, "C:\" mine does, and 2) the frame name on the charsheet window does not match the the frame name, mine does.

Otherwise, I get the same issue: blank sheet. Except, adding "Merge - join" only displays the coreRPG sheet, and not mine.

I was using an old version of RW, but still have same issue after the update.

greybeardgunner70
March 17th, 2022, 15:54
You will need to look at the new coin/currency setup in CoreRPG. It has been changed to a more dynamic setup so that people can have as many currencies as they need for their campaign.

In your setup you might get away with just adding a coinframe

I was able to delete the custom coin entries I had put in and modify the CoreRPG coinframe.

Is there a way to change the color of the backgrounds of the input windows (ie where the player inputs the number of coins they have)?

Image:
52034

damned
March 17th, 2022, 22:11
HighInquisitorTremayne please share your RWP file and your frame image

damned
March 17th, 2022, 22:12
I was able to delete the custom coin entries I had put in and modify the CoreRPG coinframe.

Is there a way to change the color of the backgrounds of the input windows (ie where the player inputs the number of coins they have)?

Image:
52034

Yes. Dive into the CoreRPG code and backtrack through the templates.

greybeardgunner70
March 18th, 2022, 02:26
This is what I found in template_char.xml. I think it is what I am looking for. How do I edit it through RW? Do I have to compile a script to change it? I would rather not just edit the template file and put it in my ruleset pak. That would be way too confusing to keep track of (I think).

"Ok... so what's being modded by the RW scripts and what have I manually adjusted?" I say as I beat my head on the keyboard.

AND how do I know what the color code is for the color I want? I'm guessing "1A40301E" is the current tan/brown color. How would I figure out the code for grey or white?

<template name="list_charinv">
<windowlist>
<child></child>
<child><backcolor>1A40301E</backcolor></child>
<datasource>.inventorylist</datasource>
<class>char_invitem</class>
<allowdelete />
<script file="campaign/scripts/char_invlist.lua" />
</windowlist>

damned
March 18th, 2022, 02:42
I think you will need to include that template in your project
I believe the first 2 characters are for transparency/opacity and the other 6 are the standard hex colour codes
Open your gfx editor and put colour code s40301E in and see what you get

Greys are obtained by having 3 matching pairs of codes
eg 222222 is very dark, 8d8d8d is medium and dedede is very light

the range goes from black 000000 to white ffffff

greybeardgunner70
March 18th, 2022, 03:56
I think you will need to include that template in your project
I believe the first 2 characters are for transparency/opacity and the other 6 are the standard hex colour codes
Open your gfx editor and put colour code s40301E in and see what you get

Greys are obtained by having 3 matching pairs of codes
eg 222222 is very dark, 8d8d8d is medium and dedede is very light

the range goes from black 000000 to white ffffff

I edited the color code, saved the template_char.xml file and placed it in the campaign folder of the pak file. But I am missing a step, because now I get an error stating FGU can't read the base.xml file when I open the ruleset. It reverts to the base CoreRPG CS.

damned
March 18th, 2022, 04:27
You just need a valif XML document in your project
Use the add XML button

paste the
<template name="list_charinv">
<windowlist>
<child></child>
<child><backcolor>1A40301E</backcolor></child>
<datasource>.inventorylist</datasource>
<class>char_invitem</class>
<allowdelete />
<script file="campaign/scripts/char_invlist.lua" />
</windowlist>

in there and save it

psicodelix
March 18th, 2022, 09:50
HighInquisitorTremayne, I recommend you to start with the charsheet template that you will find in the RSW installation folder:

- Open a copy of the template project with RSW.
- Add your frame to it.
- Go to the window named charsheet, and change the frame property to the one you just added.
- Try it.

Playing around with this template will help you to understand the way the charsheet is built.

greybeardgunner70
March 18th, 2022, 13:16
You just need a valif XML document in your project
Use the add XML button

paste the
<template name="list_charinv">
<windowlist>
<child></child>
<child><backcolor>1A40301E</backcolor></child>
<datasource>.inventorylist</datasource>
<class>char_invitem</class>
<allowdelete />
<script file="campaign/scripts/char_invlist.lua" />
</windowlist>

in there and save it

Ok, first time doing this and of course I'm not able to get it to work. What do I name the xml addition? Use the target xml filename (template_char) or name it something else? Does it matter which file I put it in (campaign, for example, which is where template_char is)?

psicodelix
March 18th, 2022, 13:36
something like that

HighInquisitorTremayne
March 18th, 2022, 13:40
HighInquisitorTremayne please share your RWP file and your frame image

Actually, before proceeding, I need to verify that RW will accept the core dice mechanic. My ruleset is based on the Year Zero System that powers ALIEN, Forbidden Lands, Vaesen, and Mutant Year Zero. So, a dice pool from 3+ sources and outputs success or failure. Will I be able to create this in RW? I'm looking for a dice string like: /sfdice (attribute)d6 + (skill)d6 + (mod)d6 s6 f1

greybeardgunner70
March 18th, 2022, 14:06
I have managed to screw something up in my blind poking at the scripting gods.

I have reverted back to on older save of my RW file, but I still get an error stating FGU can't locate the base.xml file and doesnt load the CS at all (first image). There is a base.xml file in the pak file (second image). Any ideas?

52044

52045

damned
March 19th, 2022, 01:48
please share the PAK

damned
March 19th, 2022, 01:53
Actually, before proceeding, I need to verify that RW will accept the core dice mechanic. My ruleset is based on the Year Zero System that powers ALIEN, Forbidden Lands, Vaesen, and Mutant Year Zero. So, a dice pool from 3+ sources and outputs success or failure. Will I be able to create this in RW? I'm looking for a dice string like: /sfdice (attribute)d6 + (skill)d6 + (mod)d6 s6 f1

sfdice is not from CoreRPG - its from MoreCore
I wrote it a long time ago - please refresh me on what the mechanic is?

HighInquisitorTremayne
March 19th, 2022, 14:08
Sure thing! This is from the OGL:

...grab a number of six-sided dice equal to your skill level plus your current score in the attribute that is connected to that skill. If you have some sort of gear that may be helpful, you will get extra dice from that as well.

Sixes are successes and ones are called Banes (failures basically).

damned
March 19th, 2022, 15:12
You would add all your dice from all your skills and gear by adding to modifier stack
you would use the dice roll string {self}d6s6f1+{modstack}d6s6f1 and set it to reset modifier stack

HighInquisitorTremayne
March 19th, 2022, 15:55
Thanks! Newb questions, where is {self} pulling from and where is {modstack} pulling from? What are those linked to? Are those clear questions?

damned
March 19th, 2022, 16:03
{self} is pulling from the current field, the field you are clicking on to roll - it might be Strength or Athletics for example.
{modstack} is pulling from the modifier stack bottom left of the screen.

You can use something like:
ModifierStack.addSlot(sName, nValue);
to add data to the Modifier Stack - eg on Cyberware or Masterwork Sword

damned
March 19th, 2022, 16:03
You might also pop into the discord channel on the FG official server

ShakyLuigi
March 20th, 2022, 13:39
Hi,

Thanks for making this software. It is a real timesaver, and it also makes the work alot more fun.

My question is regarding the string cycler.
It is possible to add a default label, but is it also possible to add a default value?

ikschroeder
March 27th, 2022, 14:40
Hello,

i'm having a problem with the rswcombobox. In a campaign i get the following error:

[3/27/2022 11:32:52 AM] [ERROR] Script execution error: [string "rulesetwizard/rswcombobox.lua"]:101: attempt to index a nil value

What does the combobox in the onInit function with this?

valueFieldNode = window.getDatabaseNode().createChild(valueFieldNam e, "string");

Where is this string created? DB.xml?

Many thanks for the ruleset wizard. It's a great tool!

Ingo

psicodelix
March 27th, 2022, 15:23
Hi,

Thanks for making this software. It is a real timesaver, and it also makes the work alot more fun.

My question is regarding the string cycler.
It is possible to add a default label, but is it also possible to add a default value?

Hi ShakyLuigi,

No, it's not possible. To achieve this you should create a default item in the items collection, and force it by lua to be selected by default.

psicodelix
March 27th, 2022, 15:29
Hello,

i'm having a problem with the rswcombobox. In a campaign i get the following error:

[3/27/2022 11:32:52 AM] [ERROR] Script execution error: [string "rulesetwizard/rswcombobox.lua"]:101: attempt to index a nil value

What does the combobox in the onInit function with this?

valueFieldNode = window.getDatabaseNode().createChild(valueFieldNam e, "string");

Where is this string created? DB.xml?

Many thanks for the ruleset wizard. It's a great tool!

Ingo


since a few updates ago RSW uses its own improved version of the combobox template, named rswcombobox. The files of this template are located in the rulesetwizard folder of the .pak or .ext file. Check if this folder exists. You may have the option to exclude RSW scripts from compilation selected in the options window.

if you don't want to use the standard CoreRPG template you have to set the Advanced Template property of your combobox control to: combobox

Brotherkelly
March 29th, 2022, 12:38
Hi Psicodelix,

I am starting to work on the Battletech A Time of War rules using the ruleset wizard and was wondering if there is dice string for exploding a die die only when both roll the maximum. The rules use 2d6 for all actions and if both dice are a 6 then another d6 is rolled.

I know how to set the standard exploding dice - 2d6e, but is there a command that will explode only if both are 6?

I suspect not, in whcih case I will look to do this in the code (as I have done with my original extension).

I have been looking into this a bit more and come up with a partial solution as shown in the code below:

function AttributeCheck(rSource, rTarget, rRoll)

local rMessage = ActionsManager.createActionMessage(rSource, rRoll);
-- Debug.chat(rRoll,rRoll.total);
local nDiceRoll = ActionsManager.total(rRoll);
local nTotal = nDiceRoll + rRoll.nBonuses;
-- get the Dice Roll + Modifiers total
-- Debug.chat(nTotal);
local nCriticalSuccess = 0;
local nBonusRoll = 0;

if nDiceRoll == 12 then
-- Test if BOTH DICE are a 6
repeat
nBonusRoll = math.random(6);
-- Generate a random nunber between 1 and 6
nCriticalSuccess = nCriticalSuccess + nBonusRoll;
until nBonusRoll < 6
sSaveResult = "\n[CRITICAL SUCCESS] (12 + " .. nCriticalSuccess .. ")";
-- Append a Critical Success Message
nTotal = nTotal + nCriticalSuccess;
-- update the roll result for a Critical Success (result - d6)
sMargin = "\nMargin of Success = " .. tostring(nTotal-12);
elseif nDiceRoll == 2 then
sSaveResult = "\n[FUMBLE]";
sMargin = "\nAutomatic Failure";
elseif nTotal >= 12 and nCriticalSuccess == 0 then
sSaveResult = "\n[SUCCESS]";
sMargin = "\nMargin of Success = " .. tostring(nTotal-12);
else
sSaveResult = "\n[FAILURE]";
sMargin = "\nMargin of Failure = " .. tostring(12-nTotal);
end

rMessage.text = rMessage.text .. sSaveResult .. sMargin;
Comm.deliverChatMessage(rMessage);

end

I have used a repeat until loop to add the exploding dice result to the score. I report this in the Chat window as shown in the attached file (last roll shown has an additional d6 value generated resulting in +5 being added to the Margin of success shown). However, what I would really like is to have the extra dice 'rolled' on the screen as with a standard exploding dice roll.

Do you have any suggestions on how I get get the additional dice rolled? Failing that how can I add the bonus number generated by the repeat until loop into the chat window dice result shown?

damned
March 29th, 2022, 13:39
See if you get any clues form this post:

https://www.fantasygrounds.com/forums/showthread.php?64095-Ruleset-Wizard-and-Cyberpunk-RED-ruleset-creation-tutorial&p=644637&viewfull=1#post644637

Brotherkelly
March 29th, 2022, 15:20
Thanks Damned, a quick scan through this post fills me with hope I can sort my issue out.

I will let you know how I get on.

EDIT: Have applied the code and it does the trick, with only a minor issue. I have posted in the above thread about the issue I have seen.

ShakyLuigi
May 8th, 2022, 15:04
Hi again,

Is it possible to center the text in the "Formatted Text"?

psicodelix
May 9th, 2022, 08:57
Hi again,

Is it possible to center the text in the "Formatted Text"?

As far as I know, it is not possible:

https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996645025/formattedtextcontrol

ShakyLuigi
May 9th, 2022, 09:22
Okay, thanks for a quick answer.

psicodelix
June 6th, 2022, 18:49
After some time version 0.8.0 is finally here. If you want to know more about this update, or if you missed any of the previous ones, you can take a look at my development blog:

https://www.rulesetwizard.com/0-8-0-hydra-update/

damned
June 7th, 2022, 13:08
You sir are like oasis in the desert!

Brotherkelly
June 13th, 2022, 15:30
I have a question about linking fields between the Combat Tracker and the character sheet.

I have set up the ct_entry as per the video tutorials produced by Damned. The code for this is:

function onInit()
super.onInit();
linkNewPCFields();
end

function linkNewPCFields()
local nodeChar = link.getTargetDatabaseNode();
-- retrieves the CT entry ID - these are CT specific functions
if nodeChar then
-- if nodeChar is valid/exists then run the next steps
hpmax.setLink(nodeChar.createChild("hpmax", "number"), true);
-- setup a link between the CT field and the charsheet field
hpcurrent.setLink(nodeChar.createChild("hpcurrent", "number"), true);
-- setup a link between the CT field and the charsheet field
fatiguecurrent.setLink(nodeChar.createChild("fatiguecurrent", "number"), true);
-- setup a link between the CT field and the charsheet field
vehiclearmourcurrent.setLink(nodeChar.createChild("vehiclearmourcurrent", "number"), true);
-- setup a link between the CT field and the charsheet field
vehiclestructurecurrent.setLink(nodeChar.createChi ld("vehiclestructurecurrent", "number"), true);
-- setup a link between the CT field and the charsheet field
end
end

The properties for the fields are shown in the attached files. I have also attached the issue I get when damage is applied to the target (BT-ATOW CT Issue #1.jpg). The current hit points on the character sheet does not update when the same field in the combat tracker updates (circled in red).

Can anyone help with this issue? Not sure if I have missed something in the coding.

psicodelix
June 13th, 2022, 16:00
everything seems to be fine. Make sure that the hpcurrent node exists in the root of the charsheet database node, and not under another subnode. Something like this:

<charsheet>
<id-00001>
<hpcurrent type="number">25</hpcurrent>

Brotherkelly
June 13th, 2022, 17:52
everything seems to be fine. Make sure that the hpcurrent node exists in the root of the charsheet database node, and not under another subnode. Something like this:

<charsheet>
<id-00001>
<hpcurrent type="number">25</hpcurrent>

Yep, the node exists.

The strange thing is I can update the value in the character sheet and the value changes in the combat tracker.

I have noticed a cannot manually change the value in the combat tracker when I was expecting I should be able to. I can't see any other properties in the numberfield that would prevent this.

psicodelix
June 13th, 2022, 18:01
Yep, the node exists.

The strange thing is I can update the value in the character sheet and the value changes in the combat tracker.

I have noticed a cannot manually change the value in the combat tracker when I was expecting I should be able to. I can't see any other properties in the numberfield that would prevent this.

Use false in the last parameter of setlink

Brotherkelly
June 13th, 2022, 18:21
Thanks psicodelix, that worked and it also cured the update issue on the character sheet.

psicodelix
June 13th, 2022, 19:53
Thanks psicodelix, that worked and it also cured the update issue on the character sheet.

Great!

wndrngdru
July 1st, 2022, 03:41
Quick question...

Is there a tutorial that actually walks through getting the record lock icon working?

damned
July 1st, 2022, 08:01
Ill upload a video or sample RWP file over the weekend.

wndrngdru
July 2nd, 2022, 04:42
Thanks mate! That would be awesome!

damned
July 3rd, 2022, 11:13
Try this. Its a simple RWP inside a ZIP.

drvolk
July 6th, 2022, 15:32
Hello,

i set the "Source" path of a subwindow i defined within a charactersheet to a special place, but the values of the field controls of the instanciated window class will be still stored on the root node of that charsheet and not as is expected under the "subnode" i did defined with "Source":


...
<sheetdata>
<subwindow name="SubWindow1" source="stats">
<bounds>154,196,200,100</bounds>
<class>char_stats</class>
<activate />
<fastinit />
</subwindow>
</sheetdata>
...



<?xml version="1.0" encoding="iso-8859-1"?>
<root>
<windowclass name="char_stats">
<placement>
<size height="67" width="195" />
</placement>
<sheetdata>
<number name="NumberField1">
<frame>
<name>fielddark</name>
</frame>
<bounds>24,26,60,30</bounds>
</number>
<number name="NumberField2">
<frame>
<name>fielddark</name>
</frame>
<bounds>99,21,60,30</bounds>
</number>
</sheetdata>
</windowclass>
</root>



<charsheet>
<id-00001>
<NumberField1 type="number">2</NumberField1>
<NumberField2 type="number">2</NumberField2>
</id-00001>
</charsheet>




But expect:



<charsheet>
<id-00001>
<stats>
<NumberField1 type="number">2</NumberField1>
<NumberField2 type="number">2</NumberField2>
</stats>
</id-00001>
</charsheet>



What i am doing wrong ?

damned
July 6th, 2022, 15:57
I never use a Source in my Subwindows.

Zarestia
July 6th, 2022, 16:40
That's also news to me.
Normally, you'd set the wanted db path as source like this for every field.



<number name="NumberField1" source="stats.numberfield1>

...

<number name="NumberField2" source="stats.numberfield2>

drvolk
July 6th, 2022, 21:29
I never use a Source in my Subwindows.

I am not sure, but i saw in one of the last release notes that the subwindow object was extended with the "setValue" method with which you could set the subwindow datasource by scripting.
So maybe a source for a subwindow is a new feature at all ?

I like to implement a list of character statistics (each having the same 4 numberfield values) with subwindows instead of a windowlist because so i see the list in the ruleset wizard editor and also be more flexible to arrange the layout for them.

The database node for that statistic should be build like that:
charsheet.id-00001
stats
statistic-name-1
current
max
used
tmp
statistic-name-2
current
max
used
tmp
...

So i thought if i set the source of subwindow "name-1" to "stats.statistic-name-1" and so on, i would get this, but this is not the case. Maybe the "Source" tag for subwindows work in other context or i did something wrong or it does not work as it should be ...

damned
July 6th, 2022, 23:47
I think it does not work as you think it is does. It looks like it is an absolute path not a relative path.

drvolk
July 7th, 2022, 05:55
Yeah, i will search the forum for an example of a subwindow with a datasource defined to verfify that. Thanks for your tips!

psicodelix
July 7th, 2022, 23:13
Yeah, i will search the forum for an example of a subwindow with a datasource defined to verfify that. Thanks for your tips!

I just realized the subwindow control shouldn't have the source property:

53463

I'll fix it in the next update.

Tenebris
July 9th, 2022, 01:22
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!

damned
July 9th, 2022, 02:56
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:


function onValueChanged()
nScore = getValue();
sName = getName();
nodeChar = window.getDatabaseNode();

DB.setValue(nodeChar, sName .. "mod", "number", nScore-10);
end


ofc you will need to create your own formula for calculating the modifier.

make strmod readonly and add the following code:


function onDoubleClick(x, y)
local nStart, nEnd, attName = string.find(getName(), "(%a%a%a).*")
attName = string.upper(attName);
ModifierStack.addSlot(attName, getValue());
end


when you double click that field it will add its value to the ModStack

Example 2
On your weapons attack roll add something like this:


function onBeforeDiceRoll()
local nodeWeapon = window.getDatabaseNode();
local nodeChar = window.getDatabaseNode().getParent().getParent();
local nStrMod = nodeChar.getChild("strmod").getValue();
DiceRollString ="1d20+" .. nStrMod;

return true;
end


I dont think you need global variables in most instances - just use local variables and call the data when you need it.
These are just examples and probably wont meet your exact needs but will hopefully get you on the right track.

Tenebris
July 9th, 2022, 18:48
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:



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


The issue I am having right now is converting the functioning code above into a function code for die variables in my die fields with onValueChanged(). onInit() works, but it also requires that the campaign be restarted, which is not ideal. I am hoping that the answer is obvious, but am afraid it is not possible. Functions like reset() or setdice() seem like they make sense for this purpose, but they don't work with any implementation I have tried.



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

psicodelix
July 9th, 2022, 22:22
Try this as the endurance onValueChanged:



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


the setDice function expects a table as the parameter, so you must use {} to create the dice values.

This sample uses control references, you could need to use database references depending on your set up.

damned
July 10th, 2022, 03:03
Also its common to do something like this:



function onInit()
onValueChanged();
end

function onValueChanged()
your code here;
end


then it runs the onValueChanged() at init as well as when the source changes
I think that is what you are getting at...

Tenebris
July 11th, 2022, 00:45
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.

damned
July 11th, 2022, 10:13
Also be aware that the FG Discord server has a #ruleset_wizard channel that has plenty of people who help others out.

icecrmman
August 24th, 2022, 05:48
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.

damned
August 24th, 2022, 05:55
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", "

psicodelix
August 24th, 2022, 06:54
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.

you are probably using an outdated version of the Wizard. Be sure to update to the latest version, using the update button or, if it does not appear, by downloading the latest version from the web site:

https://www.rulesetwizard.com/wp-content/uploads/2020/09/RulesetWizardSetup.zip

icecrmman
August 24th, 2022, 14:21
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", "

Much appreciated

icecrmman
August 24th, 2022, 15:33
you are probably using an outdated version of the Wizard. Be sure to update to the latest version, using the update button or, if it does not appear, by downloading the latest version from the web site:

https://www.rulesetwizard.com/wp-content/uploads/2020/09/RulesetWizardSetup.zip

I am currently using Version 8.1 Hydra I downloaded and repaired using the link you provided but I continue to get the error do I need to manually replace anything? I am not much of a programmer, so I'm somewhat lost here.

icecrmman
August 24th, 2022, 15:36
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", "

using the Code Inspector I was unable to find .getActor(

damned
August 24th, 2022, 19:50
do you have an unpacked copy of your ruleset that is being read?

psicodelix
August 24th, 2022, 20:44
I am currently using Version 8.1 Hydra I downloaded and repaired using the link you provided but I continue to get the error do I need to manually replace anything? I am not much of a programmer, so I'm somewhat lost here.

the fact that the error is in the RulesetWizardDiceRoller.lua file makes me think that the ruleset is using an old version of that file, which was updated some time ago to replace getActor() with resolveActor().
Make sure you are compiling the ruleset in the correct folder, that you are not using a different channel (test,...) and that you don't have duplicate ruleset in folder and .pak file.

icecrmman
August 24th, 2022, 21:20
I can make a change to the charactersheet and it takes affect after I compile it in FGU. I am running in the (Live) channel I'm not sure what you mean about duplicate rulesets. Do you know when or about when the change was made I might find the culprit by searching for dates?

When I look in the .pak file at RulesetWizardDiceRoller.lua there is no .getactor in the file, only .resolveActor on line 83

icecrmman
August 24th, 2022, 21:21
Duplicate

icecrmman
August 25th, 2022, 04:11
do you have an unpacked copy of your ruleset that is being read?

I do not, no.
I know it as to be something I've done because it is the only ruleset that I am working on that gets the error.

icecrmman
August 25th, 2022, 05:26
I deleted the Ruleset, then renamed it in Ruleset Wizard and created a new campaign and that seems to have dealt with the issue.

I want to thank both Damned and Psicodelix for your help.

Your suggestions lead me to the solution.

Lillhans
October 12th, 2022, 08:20
54662

See attached image file for an error prompt I get it when trying to inspect the code.

I also get the very first bit when I try to generate the ruleset (i.e. "/ can't be in a name")

Have checked all the controls and references in script to no avail: can't find anything with a "/" in the name.

Lillhans
October 12th, 2022, 08:21
54662

See attached image file for an error prompt I get it when trying to inspect the code.

I also get the very first bit when I try to generate the ruleset (i.e. "/ can't be in a name")

Have checked all the controls and references in script to no avail: can't find anything with a "/" in the name.

psicodelix
October 12th, 2022, 09:41
54662

See attached image file for an error prompt I get it when trying to inspect the code.

I also get the very first bit when I try to generate the ruleset (i.e. "/ can't be in a name")

Have checked all the controls and references in script to no avail: can't find anything with a "/" in the name.

Ok, as the error suggests there must be a / symbol somewhere, but maybe it is hard to find. Please, send me the rwp file to [email protected] to check it out.

Brotherkelly
January 25th, 2023, 18:54
Hi,

I am working on a ruleset for Battletech: A Time of War and have a problem I cannot rsolve.

In the combat tracker I have developed (based on the CT example with Ruleset Wizard) I have a link button for the PCs and NPCs to open p the appropriate character sheet. This works fine for PCs but I get a different sheet opening up when used with an NPC. Essentially, the NPC has two records - one from the NPC node in the database and one generated from the CT node.

I have looked through various examples and CoreRPG code but cannot find where the issue is.

Attached are the .rwp files and the associated .pak and .ext files - all in the one zip file.

The combat tracker is have created is the .ext file.

Could someone please look over this and suggest some areas to look at.

damned
January 26th, 2023, 01:16
Without looking at your code.

When you drag a PC to the CT it creates a small amount of info in a new PC entry on the CT. Most of the PC data is not represented in the CT. The few things that are there are set to sync back and forth to the original charsheet record.

When you drag a NPC to the CT it creates a full unique copy of that NPC into the CT. Any changes that happen to that CT NPC only happen to that CT NPC and no other. Any changes that now happen to the original NPC will not be reflected in the CT NPC.

Does that shed some light on your situation or have I misunderstood :pirate:

Brotherkelly
January 26th, 2023, 18:15
Hi Damned,

Yes that makes sense and now I have checked other campaigns (with different rulesets) I see what happens. I should have realised this but was kinda expecting the NPC data to link to the main NPC character in the same way the PC data does.

No need to pursue this issue any more as it is doing what it's supposed to. I just need to remember if I change anything on an NPC that is also in the CT, I need to change the CT NPC as well.

damned
January 26th, 2023, 21:11
After you change your Source/Original NPC just drag it back into the CT and nuke the old one - dont go making your changes twice.

Psloni
February 22nd, 2023, 23:56
@psicodelix

I am probably the only person that has had this problem. I just bought the license for RW, but there never appeared any way to get a license. I DLed the demo just to check it out, but I really want to use the full version. I sent you a PM also about this. Please let me know what it is that I need to do.

psicodelix
February 23rd, 2023, 06:58
@psicodelix

I am probably the only person that has had this problem. I just bought the license for RW, but there never appeared any way to get a license. I DLed the demo just to check it out, but I really want to use the full version. I sent you a PM also about this. Please let me know what it is that I need to do.

Hi Psloni, it looks like a confusion with your email account. I've just pmed you.

Psloni
February 23rd, 2023, 12:13
Hi Psloni, it looks like a confusion with your email account. I've just pmed you.

Thank you for the prompt attention to this matter. I look forward to learning to use your product!

psicodelix
February 23rd, 2023, 13:04
Thank you for the prompt attention to this matter. I look forward to learning to use your product!

I recommend you take a look at the video section, there you can find many examples of use:

https://www.rulesetwizard.com/video-gallery/

Xyvius
March 3rd, 2023, 18:59
@psicodelix

Ok, First of all, Thanks for the great product. Paid for a license and so far have truly enjoyed the GUI aspect of making a ruleset.

That said I have skimmed through the posts here and can't seem to find an answer... Is there a way to point multiple different labels/etc. to the same string definition? Having multiple labels on various forms/sheets that each say the same thing but each point to different strings seems wasteful and cumbersome to update. I would love to see a way to simply say "use the string XYZ" instead of retyping it for each label. This would also simplify the needed modifications of an extension that changes that data.

Thanks in advance...

EDIT:

P.S. If this does not already exist, it may be as simple as preceding or maybe enclosing the text with a special character such as a tilde (~), brackets or some other special character.

Xyvius
March 3rd, 2023, 20:55
Also, Quick question... Is there a place where the "upcoming features" are listed so we don't request things that are already planned?

damned
March 3rd, 2023, 22:09
You could probably make this with a generic control but you would spend more time creating each generic control than you would save Id imagine.
With the GUI framework there are some things that you do lose, things that might be easier editing in the XML.

If you join the Fantasy Grounds discord server there is a fairly active #ruleset_wizard channel

I have not seen a published road map for the Wizard

Xyvius
March 3rd, 2023, 22:35
You could probably make this with a generic control but you would spend more time creating each generic control than you would save Id imagine.
With the GUI framework there are some things that you do lose, things that might be easier editing in the XML.

I think i understand your point but I also assumed this would be a relatively simple change in code compilation from the RW side; simply see if it is flagged/marked as a reference to a string and drop the XML in the right spot. But I could be wrong.

My problem with editing the XML is that in future versions of the ruleset I would have to manually make these changes after every new version compiled by RW. (or am I missing something here?)


I have not seen a published road map for the Wizard

I am not familiar with the term "road map" when used in this context.

damned
March 3rd, 2023, 22:51
If you are going to code with the RulesetWizard my advice is you do everything in the RW. Dont try and do some stuff directly in the generated code.

psicodelix
March 6th, 2023, 14:21
@psicodelix

Ok, First of all, Thanks for the great product. Paid for a license and so far have truly enjoyed the GUI aspect of making a ruleset.

That said I have skimmed through the posts here and can't seem to find an answer... Is there a way to point multiple different labels/etc. to the same string definition? Having multiple labels on various forms/sheets that each say the same thing but each point to different strings seems wasteful and cumbersome to update. I would love to see a way to simply say "use the string XYZ" instead of retyping it for each label. This would also simplify the needed modifications of an extension that changes that data.

Thanks in advance...

EDIT:

P.S. If this does not already exist, it may be as simple as preceding or maybe enclosing the text with a special character such as a tilde (~), brackets or some other special character.

Hi Xyvius, I'm glad you are liking the wizard.


Regarding setting strings for literals, you are not the first person to ask, and I myself have thought about it sometimes as I often make and maintain translations of some rulesets.
So far the least cumbersome way I have found to do it is to create an extension for the ruleset, duplicate the string file, and do a text merge when there are modifications to any string.


However I like the option that you propose to indicate somehow in the property to use the value as the string identifier instead of as the literal itself. I will approach it that way for a future update.

Brotherkelly
March 11th, 2023, 10:45
@psicodelix

Thanks for the great product. Really useful in helping me create my ruleset.

Now to business.

I am currently creating a new ruleset for Battletech: A time of War. Things have been going well until I tried to do some changes to the Inventory tab of the character sheet. I had based this on the standard CoreRPG tab but wanted to add some checks to automatically updated the characters armour values on the main tab when items of armour in their inventory were set to equipped. I had done various changes but couldn't get the function I wanted so I decided to go down a different route. As a result I removed all the frames, windows and lua code I had created for this so it was back to the default CoreRPG inventory tab. It all looks okay and works fine except that the weight carried is no longer being calculated and displayed on the tab. I checked my ruleset wizard campaign file and couldn't see anything that would cause this. I even tested a base CoreRPG campaign and this works fine.

Can anyone see what I have missed in the attached files.

damned
March 11th, 2023, 12:06
You need to add this somewhere in your ruleset:


function onInit()
CharEncumbranceManager.addStandardCalc()
end

Brotherkelly
March 11th, 2023, 15:22
You need to add this somewhere in your ruleset:


function onInit()
CharEncumbranceManager.addStandardCalc()
end


Thanks. This worked. However the value is showing a whole number, no decimals. Previously I would get 18.7, 25.5, etc.

Is there any way if getting this agai?

Brotherkelly
March 11th, 2023, 18:03
I have looked for and found the function within the coreRPG ruleset. Checking the code it looks like I will need to duplicate this in my ruleset and change the final calculation to remove the rounding down element - match floor is the culprit.

greybeardgunner70
May 18th, 2023, 14:03
Working with the inventory tab.
I would like to have items that when "Equipped" is selected on the cycler, the item is transferred to a different list. For example, I have the inventory tab and I have a weapon list on the "Combat (Notes) Tab." When a weapon is added to the inventory list on the inventory tab, it auto populates on the Combat Tab weapon list. However, I would like to limit the weapon list on the Combat Tab to only two slots (most characters only have two hands). Is it possible to only have the weapon transferred to the Combat Tab when it is Equipped (vice Carried or Not Carried)? Would this require a script or is there a function within RW that would work?

damned
May 18th, 2023, 14:22
Hi Gunner

Set the source of the weapons list to .inventorylist which is the same source as your inventory
Create a hidden string control called: inventory_filter_weapon with a default value of: weapon
Filter field type: Control
Filter on field name: item_type (at least this is where I record weapon/armor/equipment in my rulesets)
Filter on field type: Control

That at least covers you for part one.
You can only set one filter with the ruleset wizard (and maybe with FG) so you might have to forego the second part or you might have to filter on another hidden field instead and set the value of that field based on type: weapon and carried: equipped

greybeardgunner70
May 18th, 2023, 15:20
OK, thanks, I'll play around with that a bit.

greybeardgunner70
May 18th, 2023, 16:02
Is it possible to have more than 1 ".inventorylist?" For example, one for weapons, one for armor, and one for misc.? That would get around the single filter issue (ie multiple Data Sources).

Or can I set another (already filtered) "WindowList" as the data source?

If I alter template_list_charinv to include multiple data sources, how would I do that? Create a new template? windowlist?

<root>
<template name="list_charinv">
<windowlist>
<child></child>
<child><backcolor>ffffff</backcolor></child>
<datasource>.inventorylist</datasource>
<class>char_invitem</class>
<allowdelete />
<script file="campaign/scripts/char_invlist.lua" />
<windowlist>
</template>
</root>

@damned You helped me last year with a similar "want." Through a script (ManagerChar) we set it up so that when a piece of armor was equipped, it would populate the armor protection fields. (see image, "Armor and Clothing Coverage") Would this be the easier route, rather than trying to filter an inventory?
57367

greybeardgunner70
May 18th, 2023, 19:59
So I tried the ManagerChar route, but then realized I have no way of differentiating one weapon from another once the are "equipped." It didnt matter with the armor items because the protection factors just stacked. But the weapons I need to fill different instances of the same data. I know I am being finicky, I could just go back to listing all the weapons on the Combat Tab, but thought I would try to finesse it a bit.

@damned Could you expand on how I might: "have to filter on another hidden field instead and set the value of that field based on type: weapon and carried: equipped"

bayne7400
May 18th, 2023, 22:58
Gunner
Dont touch Inventory tab. On whatever subwindow you want the info to appear create a windowlist. Set the source to .inventorylist and use the filter function as Damned described above. You will basically "filter" out what you want to display.

.inventorylist is just a data source. You can have lots of things share that data source on the same node. It works just like when you set a data source on a control.

greybeardgunner70
May 19th, 2023, 01:05
I've already had it functioning for some time with a windowlist that filters out the weapons from the .inventorylist. But the issue is you can only put one filter on a list. So weapon.filter is what I currently have on my Combat Tab. What I need is the ability to filter out a weapon that is ALSO equipped. Is there a way to add an additional filter to a filtered windowlist?

bayne7400
May 19th, 2023, 01:49
Yeah you can do that. Go look at char main of OSE ruleset.

bayne7400
May 19th, 2023, 02:16
I just got home try something like this.

function onFilter(w)
if w.type.getValue() == "Weapon" and w.carried.getValue() == 2 then
return true;
elseif w.subtype.getValue() == "Weapon" and w.carried.getValue() == 2 then
return true;
end
return false;
end

greybeardgunner70
May 19th, 2023, 02:54
Ok, I am looking/trying that.

onFilter(w) -- is (w) a standard name or do I need to put the name of my windowlist or filter in place of w? And then replace "w" throughout the script?

damned
May 19th, 2023, 04:25
Off the top of my head:

you have hidden field for: inventory_filter_weapon which is set to weapon
This is the text that we are using to match against the control: item_type which has 3 possible values called weapon, armor, equipment (may vary in yours)

so if on your weapon_list windowclass (mine would nrmally be called something like weapon_detail) you create hidden controls: new_filter, carried (0,1,2) and item_type (weapon, armor, equipment), #2 and #3 will fill automatically from the source record. make them not invisible until you know they are working. on each of those controls add something like:


function onInit()
onValueChanged()
end

function onValueChanged()
local nodeItem = window.getDatabaseNode();
local sCarried = DB.getValue(nodeItem, "carried", '0');
local sType = DB.getValue(nodeItem, "item_type", '');
window.new_filter.setValue(sType .. sCarried);
end


now change my earlier instruction of


Set the source of the weapons list to .inventorylist which is the same source as your inventory
Create a hidden string control called: inventory_filter_weapon with a default value of: weapon
Filter field type: Control
Filter on field name: item_type (at least this is where I record weapon/armor/equipment in my rulesets)
Filter on field type: Control

to something like:

Set the source of the weapons list to .inventorylist which is the same source as your inventory
Create a hidden string control called: inventory_filter_weapon2 with a default value of: weapon2
Filter field type: Control
Filter on field name: new_filter
Filter on field type: Control

Note: I renamed inventory_filter_weapon to inventory_filter_weapon2 because setting a value with default only works on brand new records.

I hope that this makes sense and I hope my code works... Im at work and not near my computer.... this is from memory and that is risky business...

damned
May 19th, 2023, 04:25
This means you stay more within the RSW environment than you might with Baynes code...

bayne7400
May 19th, 2023, 12:21
That is just a script you place on the windowlist control. Your control name goes in place of type and carried. Carried should not change. Do you know what controls you are trying to filter? (Other than carried)

greybeardgunner70
May 19th, 2023, 15:28
This is what I have so far (see images).
windowlist:
57375

weapon2 string:
57376

new_filter control:
57377

This is the error I get:
[5/19/2023 9:27:07 AM] [ERROR] Script execution error: [string "C:charsheet_notes:new_filter"]:9: attempt to call field 'setValue' (a nil value)
[5/19/2023 9:27:07 AM] [ERROR] Script execution error: [string "C:charsheet_notes:carried"]:9: attempt to call field 'setValue' (a nil value)
[5/19/2023 9:27:07 AM] [ERROR] Script execution error: [string "C:charsheet_notes:item_type"]:9: attempt to call field 'setValue' (a nil value)

Do I place the name of the control in Custom Class Name as well?
What is the "setValue" that the control should refer to? I am wanting to filter weapons that are "Equipped" I tried sEquipped and sCarried, same error.

damned
May 19th, 2023, 15:38
controls should all be strings

bayne7400
May 19th, 2023, 15:51
Gunnar

I shall leave you guys to it but if you want to just try the below. If your already scripting on the windowlist not sure why not just use onFilter directly?

Use this on the windowlist make sure you have the controls present in the windowclass for the windowlist.

function onFilter(w)
if w.item_type.getValue() == "#insert the word your filtering from item_type here#" and w.carried.getValue() == 2 then
return true;
end
return false;
end

greybeardgunner70
May 19th, 2023, 16:33
OK, made those changes.
57378

5 controls top to bottom:
1. "weapon" is the type filter for the windowlist
2. "weapon2" is the string filter for the new script. (I am not sure I set the filter up correctly. No filter option on a string so I created one in custom properties.)
3. "new filter"
4. "weapon" is the item_type string with "weapon" as the default text.
5. "carried"

The last 3 have the following script:
function onInit()
onValueChanged()
end

function onValueChanged()
local nodeItem = window.getDatabaseNode();
local sCarried = DB.getValue(nodeItem, "carried", '0');
local sType = DB.getValue(nodeItem, "item_type", '');
window.new_filter.setValue(sType .. sCarried);
end

My understanding of the process:
This windowlist grabs items labeled "weapon" from .inventorylist
The script should run when a weapon (item_type) item's value for "carried" (carried) changes.

greybeardgunner70
May 19th, 2023, 16:44
disregard this post, answered the question I had added here.

damned
May 20th, 2023, 03:47
OK Gunnar some of my instruction was a little off :pirate:

Attached is an extension and a RSW project.
It creates a CoreRPG extension called GunnarsChallenge

load it up in CoreRPG
create a character called Bob
create two items called Axe and Bow
add them to Bobs inventory

For the sake of this experiment we dont have item types in CoreRPG so I have used the Notes field
If you write Weapon (case sensitive - and I used Title Case because 5E does) in there and you equip the item it will show up in the Weapons list
If you unequip or change Weapon to something else it will disappear from the Weapons list

damned
May 20th, 2023, 03:53
How does it work?


On the Window List we added a filter
It is comparing a control (string) inventory_filter_weapon that is outside the windowlist with a control (string) type2 that is in the item_weapon class that displays data for the windowlist
Anything in type2 that matches exactly inventory_filter_weapon will show in the windowlist

to get type2 to show the weapon type and the equipped status we need to concatenate those two values
that is happening in the code on type and carried

these are all set to visible for testing but you would make them invisible if not needed to be seen

greybeardgunner70
May 20th, 2023, 12:51
OK, I see how the example works and will work on importing that into my CS. However, I have item_weapon for the item description (which contains all the data like your example) and I have weapon_detail, which is displaying selected information I want on the combat tab. Do I need to add the script to weapon_detail as well? Or simply change the weaponlist class name to "weapon_detail" and the script on item_weapon will do the filtering?

I also have a base custom control that item_weapon, item_armor, and item_gear sit in. Thats what actually determines type. I'm thinking the strings should go on it...?

damned
May 20th, 2023, 13:57
You should use what I did as an example only.

Dont change your names.
Maybe draw it on a piece of paper if its confusing you and then swap in your control and field names to the example.

greybeardgunner70
May 20th, 2023, 14:33
I just realized the easiest way for me to do this would be creating a .weaponlist and .armorlist categories. Put them on the inventory tab (set up a separate window to total the weights for encumbrance calculations). I can then replicate them on the combat tab with filters for "carried." I can use your example in BRP ruleset for that.
If it works, this will achieve what I want. I wasn't aware we could do this that easily and was over complicating things.
As always, thanks for your help!

damned
May 20th, 2023, 14:40
You can put them in different datasouorces
The whole reason I went down this route in the first instance was to reduce the number of datasources

damned
May 20th, 2023, 14:43
Bayne also assures me that you can scrap all of my example and simply make sure that you have the datasorce set to .inventorylist and then on the weapon_list add the following code:



function onFilter(w)
if w.type.getValue() == "Weapon" and w.carried.getValue() == 2 then
return true;
elseif w.subtype.getValue() == "Weapon" and w.carried.getValue() == 2 then
return true;
end
return false;
end

greybeardgunner70
May 20th, 2023, 19:07
I have always thought the inventory in FG was very clunky. It brings out the Knowledge Management expert in me when I have to make more then 2-3 clicks to find something or scroll through a lot of insignificant data (inventory items) to find what I want. I like the idea of having a sidebar that will take me straight to weapons or armor and keep them in separate inventories on the CS. No having to manage the inventory (or click through several windows from the sidebar) to find what I want. I also like the idea of the player being able to look at the combat tab and see very quickly whats currently equipped, as encumbrance is a thing they have to constantly manage as it directly effects their combat stats.

Is having multiple datasources a hazard for the system or is it just preferable from a coder's perspective to keep things simple?

I tried Bayne's code but I get an error for "subtype" being returned with a nil value. If I delete that line (since I donthahve subtype defined - unless its a CoreRPG thing), it doesnt work at all.

bayne7400
May 20th, 2023, 19:25
I coded the script for your specific use in an earlier post. If you try to get a value using that method and it doesn't exist you will always get an error. Take some time to read what onFilter does in the wiki. If you can try to understand it it will make more sense to you . In RSW make sure you have no other scripts linked to the windowlist. RSW will often times ignore any script you put in the window that pops up below the control you are using.

greybeardgunner70
May 20th, 2023, 19:30
Thanks!

damned
May 21st, 2023, 00:22
If you have anything under Custom Properties on that Windowlist - delete them.

Re; Inventory - so many other things are built around Inventory like Parcels and Partysheet. More downside than upside in creating additional datasources.

greybeardgunner70
May 21st, 2023, 07:27
I coded the script for your specific use in an earlier post. If you try to get a value using that method and it doesn't exist you will always get an error. Take some time to read what onFilter does in the wiki. If you can try to understand it it will make more sense to you . In RSW make sure you have no other scripts linked to the windowlist. RSW will often times ignore any script you put in the window that pops up below the control you are using.

Bayne, I totally missed your post from May 19th, 2023, 10:51. Not sure why, but I didn't see it. Took your script from that post and after a few tweaks, it worked just fine. So my many thanks. On to the next hurdle...

bayne7400
May 21st, 2023, 12:45
Fantastic.

greybeardgunner70
May 22nd, 2023, 03:31
I keep getting these errors in the chat log. I am sure its something in my code. Doesn't break anything (yet) but would like to know what its referring to:

[5/21/2023 10:13:47 PM] [WARNING] setValue: Recursive call terminated for (DATABASENODE) (item.id-00018.type)
[5/21/2023 10:15:12 PM] [WARNING] setValue: Recursive call terminated for (DATABASENODE) (item.id-00019.type)

damned
May 22nd, 2023, 03:34
Its not breaking anything because the application is catching the loop and terminating it. It should be fixed.

You have some setup where when field A changes you are updating field B and when field B changes you are updating field A and this creates a never ending loop.
Its somewhere on your Items.

greybeardgunner70
May 22nd, 2023, 03:38
Is it possible to create permanent links on the CS to item cards? For example, I have skills listed on the CS and I can create data cards in a separate "Skills" sidebar that provide the descriptions for the skill. (See image.)
57397

The player can drag these cards from the sidebar to their CS and the link will be established. However, there are a lot of them and I would like to have the link embedded into the CS. Is this possible and, if so, is there an example somewhere?

greybeardgunner70
May 22nd, 2023, 03:39
Its not breaking anything because the application is catching the loop and terminating it. It should be fixed.

You have some setup where when field A changes you are updating field B and when field B changes you are updating field A and this creates a never ending loop.
Its somewhere on your Items.

Ok thanks, I will look at them. There are only a few that I put together real quick for testing and they are missing some data so that might be why its looping.

damned
May 22nd, 2023, 03:43
Ok thanks, I will look at them. There are only a few that I put together real quick for testing and they are missing some data so that might be why its looping.

I dont think its because of data. Its scripting that is causing the loop.

damned
May 22nd, 2023, 03:48
Is it possible to create permanent links on the CS to item cards? For example, I have skills listed on the CS and I can create data cards in a separate "Skills" sidebar that provide the descriptions for the skill. (See image.)
57397

The player can drag these cards from the sidebar to their CS and the link will be established. However, there are a lot of them and I would like to have the link embedded into the CS. Is this possible and, if so, is there an example somewhere?

Well firstly you have to ensure that the objects that it will be linking to will be available. You either have to script their creation in the database within your ruleset or you might script auto loading of the module. Otherwise you may get an error prompting you to load the module when you click the link.

There are examples in the MoreCore Low Fantasy Gaming extension and MoreCore Esoterrorists extensions where it will create the data into the character sheet the first time it loads. It will take a little effort to wrap your head around the pieces involved.

greybeardgunner70
May 22nd, 2023, 04:05
OK, thanks. I'll look at it. Might be a bridge too far. These are certainly projects where mission creep can become a real issue. Self inflicted pain is always the best!

greybeardgunner70
May 29th, 2023, 07:17
Working on the CT now. I am attempting to get the combat rolls from the NPC sheet onto the CT. I followed Damian's tutorial for the White Lies ruleset. Everything is working and looks as I want it, with one exception. The actual number from the NPC sheet will not show in the box I placed on the CT Attacks window. Everything is there (tooltip, roll manager, etc) except for the actual number itself. (See images.) I get an error stating a nil value for "wpn1aroll" Any idea why this would be happening? In your tutorial you brought a window list onto the attacks window, but I figured the process would be the same for a dice window as it was for the windows copied to the ct_entry.
57475
ct_entry
57476
ct_attacks
57477

damned
May 29th, 2023, 07:30
In that instance it is a windowlist and I set the datasource to be the NPCs windowlist datasource

damned
May 29th, 2023, 07:31
I also see varsuuk lurking! Hello stranger.

Varsuuk
May 31st, 2023, 07:30
I also see varsuuk lurking! Hello stranger.

Woo! Holas. Yeah, been a crazy transition at work and with all the stuff to do at the new house. Then, unfortunately a little over a month ago my dad passed while hospitalized. At least I got to be there before he went. Unfortunately since he did pass, I ended up staying in Florida for 3 weeks helping setup things for my mom and her twin at the house. Then went back to NY for 2 weeks then flew back the weekend before this past one to attend the funeral. At least I had my wife and son with me that time. Then... all the lawyer and bank stuff trying to setup PoAs so can take over paying all the regular bills since she is 88 and not well. My dad used to do it all.

Anyhow - saw this cos I was coming by to ask (on White Lies 5 now that swapped from Dungeon World) so I could better understand as I followed along:
When I used to create stuff in XML, I'd setup controls and then add a following control that did things like anchor to "inside right" or whatever to place labels and whatever.
I did a simple header (while I first was watching your Dungeon World instructions) and I put a label inside the multicolor frame.

I was looking at the bazillion properties on the FGLabel and couldn't see how to duplicate the <anchor> type settings (need to look at confluence to remember them) that I would do with multiple anchor points etc.
I see "Advanced Anchoring" and "Custom Anchoring" they differ but both seem to only allow one parent and one anchor point (and not things like insidebottom or what have you - remember the grid? ;) )

So... just using X position and Y position is working, but it seems the "parent" is always the charsheet. So that means static locations which is fine for this. But I figure this tool is so involved and comprehensive that there is a way to do field anchoring vs always explicit locations. And I figure one of the videos will cover this. but I wanted to save going back to change controls cos basically I will start with 4 of those and later make some abil score ones that too will want anchoring.

Perhaps if you know which video might cover this, I'll poke till find it then return to watching in order. I get it if you don't recall which out of so many. There is a GOOD argument for watching once without following along to get the overview then rewatching but it's easier to keep focuse for me if I go along doing my own as I watch em.

EDIT: Added pic of the DW-esque simple UI I am doing cos as you may recall I have no artistic executive decision making skills (or even basic art skills)
57504

damned
May 31st, 2023, 07:45
None of my videos cover the custom or advanced anchoring.
The XY anchoring is so much easier.

damned
May 31st, 2023, 07:46
Im sorry to hear of your fathers passing.
I did laugh at the thought of your father and your mother and her twin... that could be everymans dream or nightmare...
Hopefully life is rebalancing for you.

Varsuuk
May 31st, 2023, 08:06
Im sorry to hear of your fathers passing.
I did laugh at the thought of your father and your mother and her twin... that could be everymans dream or nightmare...
Hopefully life is rebalancing for you.

They are identical twins. My mom was always the "fun one" and... well the nice "Evil Twin" (she did all the things like get her sister to sit in classes or when she didn't like a boy anymore she'd say she was "Maria", etc. My aunt (I refer to her as Madrina, ie: Godmother) moved in with them around 2001/2? when her husband died. It was definitely not my dad's dream lol. She can be a lot to navigate at times, but my mom and her are like 2 peas in a pod so... my dad was always the saint and took her in (he had my mom's parents living with us from the day we came to this country until they passed - though to be fair, he got along great with both of them. So other than the normal issues with having others in the house, it wasn't a hardship.
EDIT: In fact, my mom and her were pregnant at the same time (remember, pre-late 30s you couldn't tell them apart without REALLY knowing them) and my cousin and I are only 23 days apart.

AH - yeah, I think absolute works for me in many cases and I suppose I will see in videos how fields can still expand when a dialog is expanded. If not, then I'll have to learn how to do that cos different folks like to size things differently than I do, I am sure. But it isn't a hardship as long as it is sized the way >I< want it hehe. I just figure with all those properties there has to be a way other than manually editing it and then not being able to regen that portion of it anymore.

Anyhow, did decide to put off more work and just WATCH videos to learn the new tool and refresh outdated knowledge. I find the "official website" videos hard to watch since they are silent and that causes my mind and attention to constantly wander unfortunately. Im sure for most normal folks they work 100% well enough cos he does a great job of captioning them.

Nighters!

Varsuuk
June 2nd, 2023, 03:31
Any advice on how to add "resources" to RWP projects?

I created all the dirs we expect in corerpg. I added my graphics to graphics/icons/... and frames/...
I've been committing my code as I got and branching to test things. Then I noticed when I looked in the directories that the only files in the actual (I click for flat text like yu suggested) project dir is:



DanDe@Celeborn MINGW64 /d/Development/Ruleset Wizard/Adventures Dark and Deep (feature/add_intial_utility_and_data_scripts)
$ ls -lrt
total 336
-rw-r--r-- 1 DanDe 197609 4686 Jun 1 13:06 ADD_Ruleset_Notes.txt
-rw-r--r-- 1 DanDe 197609 17938 Jun 1 13:06 logo.png
-rw-r--r-- 1 DanDe 197609 11148 Jun 1 13:06 rulesetlogo.png
-rw-r--r-- 1 DanDe 197609 302540 Jun 1 14:21 AdventuresDarkAndDeep.rwp
drwxr-xr-x 1 DanDe 197609 0 Jun 1 14:21 AdventuresDarkAndDeep/

DanDe@Celeborn MINGW64 /d/Development/Ruleset Wizard/Adventures Dark and Deep (feature/add_intial_utility_and_data_scripts)
$ ls -lrt AdventuresDarkAndDeep
total 0
drwxr-xr-x 1 DanDe 197609 0 Jun 1 14:21 windows/
drwxr-xr-x 1 DanDe 197609 0 Jun 1 14:21 scripts/
drwxr-xr-x 1 DanDe 197609 0 Jun 1 14:21 xml/

DanDe@Celeborn MINGW64 /d/Development/Ruleset Wizard/Adventures Dark and Deep (feature/add_intial_utility_and_data_scripts)
$


My .pngs and .jpgs etc are still in the directories I dragged to the RWP gui from. (lI added them in "the new way" you described in videos but old way had same results)
Should I be creating those same subdirs to store the graphics under the ruleset dir, creating a sibling to windows/scripts/xml existing dirs?

I am guessing it only added a path to the actual residing dir of the art file instead of bringing it in - but I'd like to repo ALL the files I use.

Is there anyplace to read on best practices or specific videos?

damned
June 2nd, 2023, 05:51
The RSW wizard layout is not replicated fully into the PAK file unfortunately.
I replicate the graphics folder structure in my RWP save file location for my own benefit but its not needed.
I would like it if RSW would generate the files more closely to CoreRPG.

My recommendation is that you work only in RSW if you are going to use it.
Editing files manually and using RSW is likely to cause you issues.

Varsuuk
June 2nd, 2023, 05:58
Gotcha. What I was confused about is: I clicked add icon as an example and navigated to a location on my hard drive.

I generate the ruleset and voila, the icon shows up.

Thorn I did a search in the ruleset “project directory” and didn’t see the icon. So I assume it’s in one of the rxf or whatever extension files as a path to the real location in my HD. Then when it generates it it puts it into the park. But I’d like to commit the rwp files along with the images I added. So what I am asking is, should I create in the rwp folders an extra “graphics” or resources for to stick all the images I will “navigate to” when adding it to rwp project?

So I can commit those as well since overtime I might move them about otherwise.

Or - did I miss it and RW copies them somewhere I didn’t see?

damned
June 2nd, 2023, 06:13
I put all the resources into the save location for my RWP file so I can back it all up together

Varsuuk
June 2nd, 2023, 06:20
I put all the resources into the save location for my RWP file so I can back it all up together

Cool, that's what I was tryting to say (you know my comm-cross-to-bear... I don't express well) - so I will add something like this unless people have other suggestions:


-rw-r--r-- 1 DanDe 197609 4686 Jun 1 13:06 ADD_Ruleset_Notes.txt
-rw-r--r-- 1 DanDe 197609 17938 Jun 1 13:06 logo.png
-rw-r--r-- 1 DanDe 197609 11148 Jun 1 13:06 rulesetlogo.png
-rw-r--r-- 1 DanDe 197609 302540 Jun 1 14:21 AdventuresDarkAndDeep.rwp
drwxr-xr-x 1 DanDe 197609 0 Jun 1 14:21 AdventuresDarkAndDeep/
.................................................. ............... resources
.................................................. ...................... *.pngs and .jpegs, I'll probably create a resources/graphics/frames resources/graphics/icons etc...

then when I add to RW, I will point to those copies and my git is happy backing up the original files too


PS - The page in atlassian docs where the LUA restrictions etc are discussed used to say what basic version of lua FG was using, I seem to recall either 5.1 or 5.3? I doubt it will matter, but this way if I access any lua references again and they changed something, I will read the right one.

Varsuuk
June 2nd, 2023, 06:46
Right, this is the save location:
/d/Development/Ruleset Wizard/Adventures Dark and Deep
the *.rwp is in that dir as is the folder created by RWP with all it's generated/saved stuff.
I added a sibling "resources" to that generated folder (vs sticking my things inside it - if that's safe, I can move it all there too)

Brotherkelly
June 2nd, 2023, 17:55
Okay, I am working on applying effects to a target based on the damage applied. Different hit locations have different effects. See Damage Condition.jpg for the section of code relating to left arm damage.

The first time the arm is hit, the -1 effect is applied to the target. When the arm is hit again it should change to the -2 effect. Any further hits make the arm useless. I can apply the effect no problem and the code correctly determines if the location has been hit before to apply the next level of effect. The problem I am having is I cannot seem to remove the previous effect with the removeEffect function (this is calling the function from the Core RPG Rules).

I don't think I have the code layout wrong as this is the same as the code I use for applying and updating the targets encumbrance level (see Encumbrance condition.jpg), which works correctly.

Can anyone shed any light on my code to make it work?

bayne7400
June 2nd, 2023, 18:05
Was replying to wrong post on reply. Lol

Brother Kelly

Here is what I would try. Instead of typing out the effects each time type it once and set it to a variable. Can do it inside that script. Then you can call that variable instead of typing the string. I would need to go look at core but I bet it has to match so any white space or capital letter might throw it off.

Also look at sCT node and rSource make sure you giving effectmanager the correct node.

Brotherkelly
June 4th, 2023, 09:10
Hi Bayne7400,

Thanks for your suggestions. I have added the effects as variables in the srcipt and also checked the sCTNode & rSource - they both gave the correct node.

I took a copy of the manager_effect.lua and put it in my ruleset, then tracked the action through and added various Debug points. I found the issue was with the following line within the removeEffect function:

if DB.getValue(nodeEffect, "label", ""):match(sEffPatternToRemove) then

It appears that magic characters (-, *, $, etc) are not recognised so the next step was never actioned. I did a search on this and found:

https://www.fantasygrounds.com/forums/showthread.php?41888-removeEffect-does-not-escape-magic-characters

Adding the extra bits of code specified makes it work.

I am going to see if this can be incorporated into the CoreRPG ruleset so I don't need to keep track of the manager_effect.lua script to check for changes after each FG update.

bayne7400
June 4th, 2023, 16:57
Why not just write your own script. Since all your doing is matching

local nodeEffect = DB.getChild(nodeCT,"effects")
for _,vEffect in pairs (DB.getChildren(nodeEffect))do

local sLabel = DB.getValue(vEffect, "label",""):lower()

if sLabel == sName:lower() then
vEffect.delete()

end
end

sName in this case if your variable you declared. May need to add a check if no effects present so it returns false as well

Varsuuk
June 4th, 2023, 22:02
Is this one thread the best way to ask questions about RW? Or is there a separate forum for this? I feel some answered questions would be better found if there were separate posts like in the normal ruleset creation forums

Anyhow ;)

So, for now I am working with "explicit location placement", in fact, I do not see a way where you can leave out the "x position", "y position" data. But maybe those 2 can be used as "offsets" in some mode then it makes sense.

But, when I looked at the official video tutorial, (and previously just trying different things) I couldn't figure the system out exactly.
https://www.youtube.com/watch?v=YDR8xnXyey4&list=PLSaS6dEtuko9b9rxIC_Xvgfk616me59yE&index=30

The above was the one I was using to try to understand "advanced anchoring" (didn't see one for "custom anchoring" but that's in the UI too)

From what it said about "snapping to", it really doesn't The first icon control to the TEXT item example, FOLLOWS the bottom of TEXT. It doesn't snap to it. If you don't line it up explicitly, it retains the offset and folows or does weird stuff depending on location.

I was somewhat familiar with the cool diagram/image of above, aboveleft,inside,right, inside,left, etc settings. The GUI for "Display Anchoring" on FW has me puzzled, I've tried some trial and error things but hjaven't grokked exactly how to use them.


Is there any webpage, forum or video out there that goes over all the settings for that section? Display Anchoring?

The proportional_layout component you can load for examples does most of it via lua code, not the way at least I recall it working if did manually in xml.

Varsuuk
June 4th, 2023, 22:32
Oh... I missed this one from the MAIN site:
https://www.youtube.com/watch?v=oyHfGbOXZF0

It starts off saying that it doesn't use relative then goes into discussing likely some of what I want to know. So, since I aborted that experimentation and am back to the charsheet_main work, I will put a pin in it and listen to it tongiht or tomorrow.

Since this is my 2000th post, I might as well as a new question vs waste it only on a "NM" (though still good to know if this one thread is the main way to post about RW, my first question above):

I am going to start looking, but my first attempt didn't work - I set an "advanced template" for a banner and instead of hardcoding the Text, I was going to use a resource. This makes sense ;) but I was surprised I didn't see next to Text a TextRes field. If I am not mistake, the author speaks Espanol (perdoname, no escribo bien y no quiero cambiar la lengua en Windows para los acentos y letras como enye) and probably should consider making it internationalization-friendly ;)

But... it might be there and I missed it.

Anyhow, my first try was General->CustomProperties->PropertyName=textres, PropertyValue=char_label_stats
I need to get ready to eat or I'd have tried other stuff, including unpacking it to see what it generates (which I will do after dinner) for a clue. But figure, if anyone knows or points me to right video, I can get head start.

*fireworks for 2K posts*
(of course, EACH of my posts probably goes over 2K CHARACTERS ;) hehehe)



EDIT: Haven't gotten called to dinner yet so I unpacked:



<label_charframetop name="abilities_title">
<bounds>5,3,300,20</bounds>
<static textres="charsheet_main_abilities_title_LabelCaption" />
<textres>char_label_stats</textres>
<readonly />
</label_charframetop>


Aha, interesting - it seems the lua script I grabbled concatenates the "default" name for textres. That's useful! I will definitely use that but for now, I wanted to replace it - so obviously the steps above were not correct and resulted in:
<textres>char_label_stats</textres>

in ADDITION to what the lua code did. I will play a bit more before go eat.

Varsuuk
June 4th, 2023, 22:44
Cool seeing the above result let me to try:
General-CustomProperties->Attributes: textres="char_label_stats" PropertyName=static (no property value) and this resulted in->



<label_charframetop name="abilities_title">
<bounds>5,3,300,20</bounds>
<static textres="charsheet_main_abilities_title_LabelCaption" />
<static textres="char_label_stats"></static>
<readonly />
</label_charframetop>


Obviously, I would want to REPLACE the inserted by lua (my guess) static, but I can look at that and if not doable in RW, then modify the lua script to allow for it to be there already maybe.
(FYI: This gets the desired results, since the one I wanted was second... but still more to do obviously)


EDIT2: OOO ... the creation of these things is part of RW. Which is OK, except I really do not want to have a unique name for all of these since I will often share the string resource. I wonder if there is a way to turn that off?

I would STILL definitely suggest to the Dev to make "textres" a visible option like "text" to set if it isn't already and he can DEFAULT it like he is doing but this lets the creator overwrite it if they want a different resource name.

Varsuuk
June 4th, 2023, 23:41
I tried to get fancy on the onInit() code for (char_labelframetop.lua from 2E) to make room for the Icon added to the banner (since using WYSIWYG layout didn't take into account the dynamically added icon) and I got the old:

"setPosition: Embedded windows positions cannot be changed."

My next try, since I always intend there to be an icon on this one is to put the icon invisibly on the "right spot" then indent my banner from that so it will leave space for it... or... wait... I could use do this in two parts to WYSIWYG it... I mean Cel did a great bit of code to dynamically set it up, but since I am using RW to do it, prob better to comment that out and put it as 2 pcs. (I hate just "adding to the x/y control position until it "looks right" since if later I move things around, I gotta reset it. This way at least I see the layout. Dunno, will try it.

EDIT: Nope, more of a pain in order to keep "purity" - will just adjust explicitly until it looks good, then figure out the delta and make note of the delta in my book for future use of this template :)

damned
June 5th, 2023, 01:50
There is an option on most controls to Inherit Size and Position set this to True if you are positioning it via a template.

You can use the X/Y method and set Stack with Control in most instances to easily handle resizing etc. Otherwise get familiar with the templates and anchoring and all that fun.

Varsuuk
June 5th, 2023, 03:49
Yeah, the only way I used to know WAS the normal template one. I always kept my notebook bookmarked to that big rectangle chart of inside-leg, left,outside-left,etc anchor values.

It’s the GUI tricks I never messed with. I’m sure I’ll pick it up as I go. Didn’t notice the inherit eyes prob went over that. I’ll see how that works. Again, for what I’ve done - I haven’t needed it - just wanted to do it like I used to for familiarity.

Btw, any idea where I might find a free/legal to use Icon like “manic ferret” (it’s my new domain lol) I picture a nervous cartoon/silhouette of a ferret… perhaps with coffee! Ok that’s too much. Any decent leaping or hyper ferret would do. I have ferrets, but not art skills.

I was thinking to use it as an icon for me since I can’t use my normal icon (think it’s the one I use here? A cowled wizard or priest from prob Bakdur’s Gate char portraits? Don’t recall.

damned
June 5th, 2023, 04:14
Here you go...
https://www.fantasygrounds.com/forums/attachment.php?attachmentid=57586
https://www.fantasygrounds.com/forums/attachment.php?attachmentid=57587

5758657587

damned
June 5th, 2023, 04:19
Didn’t notice the inherit eyes prob went over that. I’ll see how that works.

There are dozens of options on each control and you dont need most of them most of the time so they are easy to miss.

Varsuuk
June 5th, 2023, 04:30
Cool seeing the above result let me to try:
General-CustomProperties->Attributes: textres="char_label_stats" PropertyName=static (no property value) and this resulted in->



<label_charframetop name="abilities_title">
<bounds>5,3,300,20</bounds>
<static textres="charsheet_main_abilities_title_LabelCaption" />
<static textres="char_label_stats"></static>
<readonly />
</label_charframetop>


Obviously, I would want to REPLACE the inserted by lua (my guess) static, but I can look at that and if not doable in RW, then modify the lua script to allow for it to be there already maybe.
(FYI: This gets the desired results, since the one I wanted was second... but still more to do obviously)


EDIT2: OOO ... the creation of these things is part of RW. Which is OK, except I really do not want to have a unique name for all of these since I will often share the string resource. I wonder if there is a way to turn that off?

I would STILL definitely suggest to the Dev to make "textres" a visible option like "text" to set if it isn't already and he can DEFAULT it like he is doing but this lets the creator overwrite it if they want a different resource name.

Hey Damned, do you know if I missed something when I was trying to supply my own "textres" - I see now that RW automatically creates a textres for each of the controls by basing it on its name. That's pretty cool, except when I want to simply have several use the same resource string.
It works when I added it the arcane way with custom properties, but I'd so much prefer as I said above a simple "property" for textres since it is so key for many reasons.

Is there a way to turn off the "autogen" the concatenated textres RW supplies for a control at least when I want to supply my own via that klunkier way?


ALSO - Damned, you totally rock - GREAT Ferret pics heheheh. Although, I will object that my favorite - the first one - totally looks the OPPOSITE of a "manic ferret" - he appears a very calm yet dangerous weasel.
Plus, was hoping for a site with reusable icons/images ;) cos it's a placeholder. If I ever do something for outside use, I'd look for someone who can actually make me a logo for me. Bah, I guess for now, I'll just use my forum profile icon, I'm the only one seeing it atm.



But dying to get some advice on textres so I dont have 2 textres appearing in the output (even if due to being last one, it works)

damned
June 5th, 2023, 04:37
You are overthinking the textres - the overhead is not measurable. Just let the Wizard do its thing.

Varsuuk
June 5th, 2023, 04:46
You are overthinking the textres - the overhead is not measurable. Just let the Wizard do its thing.

I do that a lot.
It isn't just the "overhead" - if it creates a textres for every control and there is a control I repeat a lot (don't know that will atm but...), then I need to add a string entry for each. OK. So I do that. And later, I want to change that label of "#ofAtks" to "Num Atks" or whatever... so I change it in N places. Can't global it cos, in some I might have wanted to keep #ofAttks or whatever. That's why my choosing the resource string name is helpful. BUT

No idea, I was trying to add to textres="...." a merge="replace" to see if that worked. It generated a <static></static> and I was ?? I removed it and regen and saw same (even though now back to old one) and reloaded ruleset and it looked correct so more ???
Then I did it again after restarting RW and this time, it was correct. But wait... it was MORE correct. It had only one entry, the one I gave it (and no, I no longer have the merge="replace" in property editor for attributes.

I'll take the win, just not sure what happened before OR now...



<windowclass name="charsheet_main">
<frame>utilitybox</frame>
<placement>
<size height="483" width="524" />
</placement>
<sheetdata>
<label_charframetop name="abilities_title">
<bounds>15,10,300,20</bounds>
<static textres="char_label_stats"></static>
<icons>char_abilities_purple_2E</icons>
<readonly />
</label_charframetop>
</sheetdata>
</windowclass>
</root>

Varsuuk
June 5th, 2023, 04:50
Aha!

my git diff comes to the rescue, I suspect maybe I had an accidental space before >>textres=....<<

See:


diff --git a/AdventuresDarkAndDeep/windows/charsheet_main.rwf b/AdventuresDarkAndDeep/windows/charsheet_main.rwf
index d9c4c84..1cad240 100644
--- a/AdventuresDarkAndDeep/windows/charsheet_main.rwf
+++ b/AdventuresDarkAndDeep/windows/charsheet_main.rwf
@@ -2,7 +2,7 @@
<WindowControls>
<WindowName>charsheet_main</WindowName>
<ControlName>abilities_title</ControlName>
...
...
@@ -12,7 +12,7 @@
{"Name":"Center"},
{"Name":"ControlName","Value":{"@xsi:type":"xsd:string","#text":"abilities_title"}},
{"Name":"CustomAnchoring","Value":{"@xsi:type":"ArrayOfAnchorDefinition"}},
- {"Name":"CustomProperties","Value":{"@xsi:type":"ArrayOfCustomProperty","CustomProperty":[{"PropertyName":"static","PropertyValue":null,"PropertyAttributes":" textres=\"char_label_stats\"","ParentElement":null},{"PropertyName":"icons","PropertyValue":"char_abilities_purple_2E","PropertyAttributes":null,"ParentElement":null}]}},
+ {"Name":"CustomProperties","Value":{"@xsi:type":"ArrayOfCustomProperty","CustomProperty":[{"PropertyName":"static","PropertyValue":null,"PropertyAttributes":"textres=\"char_label_stats\"","ParentElement":null},{"PropertyName":"icons","PropertyValue":"char_abilities_purple_2E","PropertyAttributes":null,"ParentElement":null}]}},
{"Name":"DesignerHeight","Value":{"@xsi:type":"xsd:int","#text":"20"}},
{"Name":"DesignerLocked","Value":{"@xsi:type":"xsd:boolean","#text":"false"}},
{"Name":"DesignerWidth","Value":{"@xsi:type":"xsd:int","#text":"300"}},
~

damned
June 5th, 2023, 04:51
Create it as a Template and then apply the Template everywhere.

And make up your mind about naming!

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

5758857589

Varsuuk
June 5th, 2023, 05:11
OOOO ... DEMS IS MANIC Ferrets!

LOL, I was just coming here to say I decided to look at my iphone, grab a pic, crop it tight and use that as a PH ;) ... but dude those pics are great. How do you pull these out so fast. Is there a comic of these crazed ferrets somewhere I should be reading? lol.
I will use the last one (first one not sure what's in his hands) for my PH cos... I'm sure that's copyrighted cos it's too purdy.

57590

Just realized, the filename was "MF logo"... ;)


EDIT, now for the MF Damned version!
57591

damned
June 5th, 2023, 05:13
They were all generated by midjourney

Varsuuk
June 5th, 2023, 07:40
They were all generated by midjourney

I'll have to check that out (I fear to right now since it is 2:25am but will try that out tomorrow!)


OK - gonna leave it for now, I decided to try emulating part of the 2E layout (since ADD is very 1E - yes, I know I can ext things etc. This is a thing I like to try to learn by doing ground up) to learn how to do anchoring in this.
Now, I FORGOT to watch the RW Anchoring official video - I JUST remembered about that now, I'll watch it in bed in a few mins.

But when I generated, I had one of those control (...) no vertical anchor in window (...) type console errors. I am familiar with em from way back, some earlier template was missing a "top" anchor most likely. Then I started back comparing what was generated and saw several mismatches (when I "fixed" them in the generated code - unzip and edit and rerun) then the layout worked! But of course, that doesn't help since next regen it's stepped on.



generated by me:
<anchor_title_charsheet name="contentanchor">
<anchored>
<top offset="15" />
<left offset="20" />
</anchored>
</anchor_title_charsheet>

vs (2E):
<anchor_title_charsheet name="contentanchor">
<anchored height="0">
<top offset="15" />
<left offset="20" />
</anchored>
</anchor_title_charsheet>

=============

generated by me:
<label_charframetop name="abilities_title">
<anchored>
<top anchor="bottom" offset="40" relation="relative" />
<left />
</anchored>
<static textres="char_label_stats"></static>
<icons>char_abilities_purple_2E</icons>
<readonly />
</label_charframetop>

vs (2E):
<label_charframetop name="statstitle">
<anchored to="contentanchor" height="20" width="300">
<top anchor="bottom" offset="40" relation="relative" />
<left />
</anchored>
<icons>char_abilities_purple</icons>
<static textres="char_label_stats" />
</label_charframetop>




It's hard to explain the settings so I will attach a few screenies:
57599
57600
57601
57602

Varsuuk
June 5th, 2023, 07:42
Continued (new 2 controls):

57603
57604
57605
57606

57607
57608

My hope is that you can spot what I am missetting that is ruining the first "<anchored" and "<anchored" lines with that, the others that are off might become obvious.

I clicked the "inherit" thing you said, I noticed I created a button way off to the side but it properly got moved to where I wanted it which was nice. I couldn't set a control (even FGCustomControl) to X or Y = 0 even if I click inherit, so I made em 1,1.

Nighters! (again, will watch the anchor thing - if I spot the answer, will post from bed on phone)


GAH! I got a lead - I thought to "Hail Mary" and thought - first line bad, let me change the odd one saying "anchor definition" and pull-downed to "size" and left height=0, that made proper <anchored height=0 ...> entry.
I'll play with the others but I doubt will post more till tomorrow unless it is to say "YAY! working" - then tomorrow will post the obvious oops I did in case helps others figure the anchoring. And no, haven't yet watched vid, I'm still in den.


*EDIT: SOLVED*
OK - yes, FULL Eureka.
(I still plan to watch Anchor but for now, my 3 fixes:) )
1. In the first "contentanchore" the "0:anchordefinition" was changed to "0:size" by selecting "anchor edge or" to "size"
2. The abilities_title fix was changing anchoring "0:anchordefinition" by changing it to 0:any" by selecting "anchor edge or" to "any"
3. The abilities_details fix was changing anchoring "0:anchordefinition" by changing it to 0:any" by selecting "anchor edge or" to "any" (same as #2)

Those 3 changes made it all work perfectly. Tomorrow I can continue now that understand this relative thing in FW more.

Brotherkelly
June 6th, 2023, 07:49
Why not just write your own script. Since all your doing is matching

local nodeEffect = DB.getChild(nodeCT,"effects")
for _,vEffect in pairs (DB.getChildren(nodeEffect))do

local sLabel = DB.getValue(vEffect, "label",""):lower()

if sLabel == sName:lower() then
vEffect.delete()

end
end

sName in this case if your variable you declared. May need to add a check if no effects present so it returns false as well

Thanks. I will look at this and see what I can do.

Brotherkelly
June 6th, 2023, 08:32
Hi Bayne,

I had some time to implement your suggestion and it works a treat. Many thanks.

Varsuuk
June 7th, 2023, 04:22
When a template calls for a "genericcontrol" and I want to place a control on panel with RW, what do I use? "Custom Control" (FGCustomControl) does not give a choice to assign a "advanced template", or do I put the template name in the "class" section or should I be using something else entirely?

damned
June 7th, 2023, 04:29
If you click on the text of any of these properties you will see a brief description at the bottom of the screen.

Varsuuk
June 7th, 2023, 04:40
Yup, I discovered that (late actually, sad, only noticed it my 3rd day in) but what I am trying to replicate, using RW is placing a control (a panel/box to place other controls on to serve as like a background for others on a window) which is a template based on <genericcontrol>

So, I tried placing a Custom Control (FGCustomControl) and Icon (FGIconControl) where I set the Custom Class (which DOES say custom class or template, it's why I selected this to try in my testing) to the template name. And in FGIcon, I used advanced template property. Neither resulted in a visible control (I click inherit pos on each)

Now, my next step is to unpack and see WHAT it generates, knowing what the "right" result should be. That's how I learned how to use the CustomAnchor property, I tried different combos until I found out setting what resulted in what I'd want for a given arrib or value combo. So let's play some gameshow music as I look into the generated code:

*dum de la, dum de la, dum de la la la, dum de la, ... *

EDIT1: Yup, it generated a blank entry (just template name) but then I saw the Custom Anchoring was not set right, not sure guess I uparrowed or something while switching boxes.
Then fixed it and it generated it but still not visible, so it's a me thing on some earlier step I'm sure. But it DOES seem the "effect" is the same with RW - if I wanted a "generic control" either works fine but the IconControl at least doesnt have the cog (I am guessing cog one is more accurate choice, but for a plain control icon seems to work too if I stick to the basic settings and don't use "icon" settings. The output between the two were exactly the same:


<ability_fields_container name="IconControl1">
<anchored position="right" offset="0,0" width="280" />
<frame>
<name>my_frame</name>
</frame>
</ability_fields_container>
<ability_fields_container name="CustomControl1">
<anchored position="right" offset="0,0" width="280" />
<frame>
<name>my_frame</name>
</frame>
</ability_fields_container>


I should be able to take it from here - just wanted to note (unless told otherwise) it seems it doesn't matter since the output is not based on controls you pick - it's just controls you pick limit or expand the choices of things you can enter in the properties view. That makes good sense. Wish I could do "extensions" to RW to add some of my own favorite properties for some types of controls (textres/target etc) I could code it if it was in C++ or C#(with googling ;P, still just learning this one)

EditFinal: Yup, the arrow keytboard binding changed one of my settings and I didn't notice. With that fixed, it is done.


TLDR; TAKEAWAY, you can use pretty much any tool on the sidebar to make a "simple custom control" as long as you only enter fields that apply.

damned
June 7th, 2023, 04:54
You can also set the background using an Icon control or even on a windowlist or formattedtext or string etc
I would think that CustomControl is probably closest but I dont know the specifics.

Moon Wizard
June 7th, 2023, 16:57
@psicodelix,

Is there any way that we can get RW to output files using tab characters and scripts in the XML like the CoreRPG ruleset?

Here are the XML writer settings from FGU that output in similar format:


public static XmlWriterSettings GetDefaultWriterSettings()
{
return new XmlWriterSettings
{
CheckCharacters = false,
ConformanceLevel = ConformanceLevel.Document,
Encoding = System.Text.Encoding.UTF8,
Indent = true,
IndentChars = "\t",
NewLineChars = "\r\n",
NewLineHandling = NewLineHandling.Replace,
};
}


Thanks,
JPG

psicodelix
June 7th, 2023, 21:08
@psicodelix,

Is there any way that we can get RW to output files using tab characters and scripts in the XML like the CoreRPG ruleset?

Here are the XML writer settings from FGU that output in similar format:


public static XmlWriterSettings GetDefaultWriterSettings()
{
return new XmlWriterSettings
{
CheckCharacters = false,
ConformanceLevel = ConformanceLevel.Document,
Encoding = System.Text.Encoding.UTF8,
Indent = true,
IndentChars = "\t",
NewLineChars = "\r\n",
NewLineHandling = NewLineHandling.Replace,
};
}


Thanks,
JPG

yes, I think I can do it, I will try to include it in the next update.

greybeardgunner70
June 8th, 2023, 17:22
Is there an example of someone working with Effects and token icons? I am not interested in scripting effects into the CS, the effects I use in the ruleset are very basic (prone, fumble, etc), but I would like the token to show an icon when the effect is drug onto it. (The effect shows on the CT just fine.)

Varsuuk
June 8th, 2023, 17:35
I believe I know well understand how to use "Custom Anchoring" in FW. I've been using it for 3 days now and all is forming up as I expect (I leave the "placeholders" on the WYSIWYG charsheet which each have "advanced templates" and "custom anchoring" and "inherit size/pos" setup)

So, while I have not run into anthing not taken care of by "Custom Anchoring", what is "Advanced Anchoring" there for? Not sure how that comes into play. Again, just curiousity at this point.

Varsuuk
June 8th, 2023, 20:05
Is there an example of someone working with Effects and token icons? I am not interested in scripting effects into the CS, the effects I use in the ruleset are very basic (prone, fumble, etc), but I would like the token to show an icon when the effect is drug onto it. (The effect shows on the CT just fine.)

What ruleset are you basing on? CoreRPG or 5E or ?

greybeardgunner70
June 9th, 2023, 17:58
Corerpg.

damned
June 10th, 2023, 00:01
There are no RSW examples for this. You will need to look into some existing extensions.

greybeardgunner70
June 10th, 2023, 01:20
There are no RSW examples for this. You will need to look into some existing extensions.

OK thanks.

Varsuuk
June 10th, 2023, 04:39
@psicodelix,

Is there any way that we can get RW to output files using tab characters and scripts in the XML like the CoreRPG ruleset?

Here are the XML writer settings from FGU that output in similar format:


public static XmlWriterSettings GetDefaultWriterSettings()
{
return new XmlWriterSettings
{
CheckCharacters = false,
ConformanceLevel = ConformanceLevel.Document,
Encoding = System.Text.Encoding.UTF8,
Indent = true,
IndentChars = "\t",
NewLineChars = "\r\n",
NewLineHandling = NewLineHandling.Replace,
};
}


Thanks,
JPG

Is this in reference to scripts typed into the LUA Code Editor in RW for a control for example? I just did the first of those and without any special workarounds the output xml was:


<field>name</field>
<script>function setValue(sTitle)
if widgetTitle then
if prefix then
sTitle = Interface.getString(prefix[1]) .. " - " .. sTitle;
end

widgetTitle.setText(sTitle);
updatePosition();
end
end
</script>
<readonly />


After I inserted an extra carriage return ont he first line and some 3 tabs before each lua line I got:


<field>name</field>
<script>
function setValue(sTitle)
if widgetTitle then
if prefix then
sTitle = Interface.getString(prefix[1]) .. " - " .. sTitle;
end

widgetTitle.setText(sTitle);
updatePosition();
end
end
</script>
<readonly />


It would ROCK (but as it is it works, so low priority) if the tabs/etc you did for your other XML generation was applied to the lua code someone types in the editor:


<field>name</field>
<script>
function setValue(sTitle)
if widgetTitle then
if prefix then
sTitle = Interface.getString(prefix[1]) .. " - " .. sTitle;
end

widgetTitle.setText(sTitle);
updatePosition();
end
end
</script>
<readonly />


Without the extra explicit tabs and without having to insert a blank line.

AGAIN, this might be exactly what Moon is referring to, I just don't yet know the jargon to tell ;)

EDIT: Looking at the code windows the tab expansion is excessive, but that's not my point - as long as it lines up with the rest of the generated XML it would be nicer but not a big deal :)

Moon Wizard
June 10th, 2023, 05:22
The issue I ran into with this is that the code collapsing in some text editors, such as Sublime Text, use the indent level as the guide for collapsing. Due to the lack of indents in the code, the scripts would cause the collapsing to not work, which made it difficult to help people using RSW.

Regards,
JPG

greybeardgunner70
June 11th, 2023, 13:34
Changes I make to "Project Properties" aren't being reflected in FGU. For example, I have tried to add copyright info to Description and Comments, and neither show up in the chat. Nor do changes to the version number. What am I missing? Do I need to generate a new ruleset file, rather than updating the current one?

damned
June 11th, 2023, 13:55
Changes I make to "Project Properties" aren't being reflected in FGU. For example, I have tried to add copyright info to Description and Comments, and neither show up in the chat. Nor do changes to the version number. What am I missing? Do I need to generate a new ruleset file, rather than updating the current one?

Announcement text is only updated when you close FG and launch it fresh again.

greybeardgunner70
June 11th, 2023, 15:04
Announcement text is only updated when you close FG and launch it fresh again.

Got it, thanks!

Varsuuk
June 11th, 2023, 16:51
Also, always something to watch for is if you generate a normal compressed file like pak/ext but unpack it to check something or test a small change. Then FG just uses that unpacked one going forward.

Definitely not something that got me like 4 times until I switch to generating unpacked while I am actively working on it…. Nope, not me… *whistles innocently*

Varsuuk
June 12th, 2023, 16:25
Hmm - I wanted to see what a window would generate and hit the view code button and saw it. Then I went to check on controls, did it again and saw nothing... again... nothing. That's when I noticed that it was popping up off to the side:
57683
No clue how I "disassociated" it from RW? Any ideas on how to get RW to open the generated xml "in-app" again?

damned
June 13th, 2023, 10:43
You dont.
You might be able to import it into RSW or you might have to copy and paste it into RSW

greybeardgunner70
June 18th, 2023, 02:24
I have a combobox that lists the months in the Harnmaster ruleset. Each month carries certain skill bonuses based on the setting zodiac. So if you start with a Skill Base of 15 in swords but you were born in Angberelius, you get a bump to 16. (See image)

57809

Can I script a combobox to modify certain skills based on the month chosen? How would I script that? I figure its an if/then function, but I dont know how to write it so it knows to look for a change in the combobox (and recognize each option in the collection list).

Varsuuk
June 18th, 2023, 03:01
I don’t know the rules of this rpg.

When you change a control value there is an alert you can handle. If you look in the confluence page API section you can get the names (I’m in the living room reading by my wife so won’t be up for bit - so can’t look at the name atm)

Then given the return value vs the visible string, you can index a table to get the identifier of the attribute you will change and the modifier.

Like
Local mods = ModsByMonth[month]
adjustAttribs(mods.attribute, mods.amount)

AdjAttrib can query for the attribute and set it to current value + amount ;which could be a negative)

Not sure if thawed what you are looking for?

greybeardgunner70
June 18th, 2023, 11:31
No I dont think I need a table. Currently Skill Base in a skill is determined by averaging three attributes. Climbing Skill Base = strength+agility+will/3. I have scripted this to occur for each skill.

If your character was born in a certain month, they receive a +2 to Skill Base for Swords, a +1 to Skill Base for Climbing, a +1 to Skill Base for Basketweaving (for example).

I just need to setup a script so that when the combobox selection changes, it will add those modifiers to each of the appropriate Skill Bases.

Varsuuk
June 18th, 2023, 21:56
Well, that's kind of what I was trying to say that based on the selected value, you looked up what that month's modifiers are then apply them. If you want, of course you don't have to have it in a table or other db. You could just simply do in onValudChanged() something like:

month = getSelectedValue()
if month == "month_value_id" then
...
elsif month == "month_value_id2" then
...
etc
end

And you could in those ... do the math and modify those skills by the hardcoded values you put there.

I thought your main question was HOW do you get alerted? I am attaching a simplistic print on a combo I already had (I added the onValueChanged using the RW gui pulldown (combo ;P) and clicking the +script button. Of course you can just TYPE it there anytime too.
I added 3 method calls the last two are likely the most interesting - one to print getValue() and the other to get the "code/value" associated with it.

Disclaimer, I haven't coded my combo yet, I recall once using one but I don't recall which method for what. I know one gives you the "text shown" and one the "value" associated, from my fast test it seems it is the 2 I listed though I couldf have sworn it was a different name. Don't have time to look further right now, heading out for dinner.
57827

Varsuuk
June 18th, 2023, 21:58
Double post, please delete