PDA

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



Pages : 1 2 3 4 [5]

Varsuuk
June 21st, 2023, 18:07
Is there a suggestion thread here or through the RW website?

One thing I find myself adding a lot in "Custom Properties" popup are textres for "static" and "tooltip" now there already exist ways to add a label and tooltip as a first-class citizen on the properties page - as long as you do it explicitly, which is not the best way if you want to be able to change many instances at once and of course - for internationalization.
I know it is all too easy to code-bloat a UI by adding too many functions and I am not the best judge yet for this app, but from what I've been doing, it comes up for many if not most controls. I'd love alongside "tooltip" property, if there were "tooltip-res" or whatever you call it. Same for the label if that's an option on the type of control.

Nothing big or earthshattering but it's a nice quality of life improvement - I think ;)

Varsuuk
June 21st, 2023, 18:18
Just tested one thing on 0.8.8 - the comment. Which is cool :)
I added it to the wrong control. Each time I start RW, I need to resize it down since it doesn't reset to "last position/size". I resized it too small and I confused a control since I apply an "advanced template" most times and therefore blank the "frame" or it would override my template. Long story short, I backspaced over the comment and went to add it elsewhere, before I did that I regenerated to see it "poof" and it did... but it left:


<percentile_abilityfield name="cha_reaction_mod" source="abilities.charisma.reactionmod">
<!---->
<anchored to="cha_morale_mod" />
<tooltip textres="charsheet_main_cha_reaction_mod_Tooltip" />
<tooltip textres="char_charisma_reactionmod_tooltip"></tooltip>
</percentile_abilityfield>


Then I tried just clicking the combo arrow on Developer Comment but NOT typing anything and sure enough when I regenned, I see:


<number_abilityfield name="cha_morale_mod" source="abilities.charisma.moralmod">
<!---->
<anchored to="cha_max_henchmen" />
<tooltip textres="char_charisma_moralemod_tooltip"></tooltip>
</number_abilityfield>


And thank you for this, since I stumbled across my typo of "moralmod" vs "moralemod" the former is a different type of game altogether ;)


EDIT: A fast vi edit of the 2 .rwp files to change the:
{"Name":"DevelopmentComments","Value":{"@xsi:type":"xsd:string"}},

back to:
{"Name":"DevelopmentComments"},

Took care of no longer generating the blanks. Maybe next update you can check for "empty" comments and not generate those. Minor issue, resolves itself eventually.

Varsuuk
June 21st, 2023, 19:52
Another small easily worked around issue is with copy/paste for controls with "custom anchoring"
I find it copies all the settings but always seems to not copy the "position" setting in the anchoring. I always get caught by that forgetting to reset it to "aboveleft" in new controls ;) and then I see the result and feel silly for constatly falling for it:


<label_combatvalues name="combat_move_rate_label">
<anchored to="combat_move_rate" position="aboveleft" offset="-8,-3" width="45" />
<static textres="char_movement_rate_label"></static>
<tooltip textres="char_movement_rate_tooltip"></tooltip>
<readonly />
</label_combatvalues>


The bold part poofs if you copy/paste the label control in the GUI.

greybeardgunner70
June 24th, 2023, 18:29
Is there an example (in one of Damned's many videos perhaps) of a checkbox being scripted with a function? I would like to create one where if the box is checked (when the PC is mounted), their encumbrance value is halved. Is it simply onValueChanged? How do I reference the checkbox as either selected or not selected?

bayne7400
June 24th, 2023, 20:02
onValueChanged
use a debug to get its value and you will see how it is referenced.

greybeardgunner70
June 25th, 2023, 15:30
I would like to setup a CS with multiple loadouts for the PC, based on the situation (Street, CQB, Field, and Other). See image.
57947

I have charsheet_inventory with 4 SubWindows. Is it possible to have a different instance of "inventoryframe" on each subwindow, so that I capture the functions of .inventorylist on each, while making them separate lists? I imagine I would have to add a script creating inventoryframe1, inventoryframe2, etc. along with similarly named instances of encumbrance_label and encumbranceload.

Is this possible without breaking CoreRPG? What might the script look like?

damned
June 26th, 2023, 01:21
Set up the various inventory tabs the same way you setup the character sheet tabs.

Moon Wizard
June 26th, 2023, 02:17
I usually recommend against more than one inventorylist, because it causes a "lot" more work to integrate with all the various default systems (party sheet, item transfer, parcels, etc.).
If you really want to show more limited information, you can create lists that are filtered by specific fields (such as "type" == "Weapon")

Regards,
JPG

damned
June 26th, 2023, 02:51
Im assuming that he will be using a filter to do this for those reasons. The filter might be on a new "field" to match his "situation".

greybeardgunner70
June 26th, 2023, 13:56
Thanks, I thought it would probably be more complicated (and possibly limiting) to be worth the effort. Really the only function I am looking for was the automatic calculation of the weight. Don't really need the party sheet automation even. This is for a homebrew modern set and so will never see publication (a mishmash of scavenged rules from multiple published rulesets). I will go with simply creating separate windowlists for each subtab and have the player add up the total weight for each.

Varsuuk
July 3rd, 2023, 06:53
How does one get the following to appear using the "custom anchoring" property?

<bottom parent="" offset="-30" />

If I put quotes like that, it attempts to escape them:
<bottom parent="&quot;&quot;" offset="-30" />

greybeardgunner70
August 4th, 2023, 15:30
I am having an inventory issue. When the inventory tab is opened, everything looks as it should (see image)
58411

However, as soon as a player attempts to scroll through the inventory (when the number of items extends outside the window, of course), it creates a space between items (see image)
58412

Any thoughts on why this might be happening?

Elawyn
August 23rd, 2023, 08:48
Hi all, after the last update, all my roll are outdated... :(

I use this kind of code to manage rolls trough the CT:

function InitHandler(rSource, rTarget, rRoll)

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

if rSource then
local nTotal = ActionsManager.total(rRoll);
local nodeChar = rSource.sCreatureNode;

rCreature = DB.findNode(rSource.sCTNode);

DB.setValue(nodeChar, "initresult", "number", nTotal);

end
end

"initresult" is a cross-linked field, to bring the rollresult in CT from the NPC/ Charsheet, what isnt working anymore. After the update, FG doesn`t finde "rSource" anymore, so the rolls wouldn`t trigger. Do anyone knows a workaround, I have to use to change my rollfunctions???

psicodelix
August 23rd, 2023, 09:05
Hi all, after the last update, all my roll are outdated... :(

I use this kind of code to manage rolls trough the CT:

function InitHandler(rSource, rTarget, rRoll)

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

if rSource then
local nTotal = ActionsManager.total(rRoll);
local nodeChar = rSource.sCreatureNode;

rCreature = DB.findNode(rSource.sCTNode);

DB.setValue(nodeChar, "initresult", "number", nTotal);

end
end

"initresult" is a cross-linked field, to bring the rollresult in CT from the NPC/ Charsheet, what isnt working anymore. After the update, FG doesn`t finde "rSource" anymore, so the rolls wouldn`t trigger. Do anyone knows a workaround, I have to use to change my rollfunctions???

Hi Elawyn,

Do you mean the 0.8.9 update? I haven't noticed any rSource related problems in the handler functions.


Can you provide some more information to try to find out the cause of the problem?

Elawyn
August 23rd, 2023, 09:39
Hi psicodelix, yes, 0.8.9.

here is the error code:

58610

i tried to give a screenshot.

As you can see, there is only my RW extension loaded. I use different kinds of RollHandlers (I leared from your tutorials and damned`s videos). After the update no roll will work. it doesnt trigger the initial "if"..(rSource) / rTarget function.
second example:

function AbwehrHandler(rSource, rTarget, rRoll)

local rMessage = ActionsManager.createActionMessage(rSource, rRoll);
rMessage.text = rMessage.text;
if rTarget then
rMessage.text = rMessage.text .. " gegen " .. rTarget.sName;
end

Comm.deliverChatMessage(rMessage);

rCreature = DB.findNode(rSource.sCTNode);

if rTarget then
local rMessageResult = ChatManager.createBaseMessage(rSource, rRoll.sUser);
rMessageResult.text = rMessage.text;
local rTarget = DB.findNode(rTarget.sCTNode);
local nTotal = ActionsManager.total(rRoll);
local nAngriff = rTarget.getChild("angriff").getValue();
local nSchaden = rTarget.getChild("sfresult").getValue();
local nDiff = nAngriff - nTotal;
local nAP = nAngriff - 20;
local nTotalschwer = nTotal - 9;
local nAngriffschwer = nAngriff - 9;
local nodeChar = rSource.sCreatureNode;
local nSchwer = math.ceil(nSchaden*nDiff);

if nSchwer < 0 then
rCreature.getChild("differenz").setValue(0);
DB.setValue(nodeChar .. ".differenz", "number", 0);

elseif nSchwer >= 0 then

DB.setValue(nodeChar .. ".differenz", "number", nSchwer);

end

rCreature.getChild("apschaden").setValue(nAP);
DB.setValue(nodeChar .. ".apschaden", "number", nAP);

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


if nResult == 20 and nTotalschwer > nAngriff and nAngriff >= 20 then
rMessageResult.text = "[KRITISCH] Du hast dem Angriff kritisch erfolgreich abgewehrt, der Angriff hat Dich nicht einmal gestreift und Du hast sogar einen Stellungsvorteil! Leichter Schaden: " .. nAP .. " AP";

DB.setValue(nodeChar .. ".stellung_number", "number", (2));

elseif nResult == 20 and nAngriff >= 20 then
rMessageResult.text = "[KRITISCH] Du hast den Angriff kritisch erfolgreich abgewehrt, der Angriff bleibt in Deiner Deckung haengen! Leichter Schaden: " .. nAP .. " AP";


elseif nTotal < nAngriffschwer and nAngriff >= 20 then

rMessageResult.text = "[NACHTEIL] Du bist getroffen und hast dich in eine unvorteilhafte Position gebracht! Schaden: " .. nSchwer .. " leichter Schaden: " .. nAP .. " AP";

DB.setValue(nodeChar .. ".stellung_number", "number", (-2));

elseif nTotal < nAngriff and nAngriff >= 20 then

rMessageResult.text = "[GETROFFEN] Du bist getroffen! Schaden: " .. nSchwer .. " leichter Schaden: " .. nAP .. " AP";

elseif nTotalschwer > nAngriff and nAngriff >= 20 then

rMessageResult.text = "[VORTEIL] Du hast die gegnerische Waffe beiseite geschlagen und einen Stellungsvorteil! " .. " leichter Schaden " .. nAP .. " AP";

DB.setValue(nodeChar .. ".stellung_number", "number", (2));

elseif nTotal >= nAngriff and nAngriff >= 20 then
rMessageResult.text = "[ABWEHRERFOLG] Du hast den Angriff erfolgreich abgewehrt! " .. " leichter Schaden " .. nAP .. " AP";
end

Comm.deliverChatMessage(rMessageResult);

end
end

if I try to roll from a rollfield from a windowlist, the roll will even not be executed.

in the CT i have linkedPCFields an use cross-linked number fields to display the results

psicodelix
August 23rd, 2023, 09:47
Could you tell me which line is 164?

Elawyn
August 23rd, 2023, 09:48
sorry :) sure.

"if rTarget then"

and this is a second line that throws the same error:

"rCreature = DB.findNode(rSource.sCTNode)"

an this is the beginning of the rollhandler that will not even be executed:

"function AngriffHandler(rSource, rTarget, rRoll)
local rMessage = ActionsManager.createActionMessage(rSource, rRoll);
rMessage.text = rMessage.text;


if (rSource) then

local nTotal = ActionsManager.total(rRoll);
local nSchaden = rRoll.SF;
..."

so i guess it doesnt finde "rSource"

Elawyn
August 23rd, 2023, 10:02
perhaps its easier to show the function in RW :

:58611

there line 22 throws the error (cant find rSource a nil Value)

psicodelix
August 23rd, 2023, 10:05
according to your first pic the error is in line 164, could you check it?

Beautiful ruleset BTW :)

Elawyn
August 23rd, 2023, 10:10
thank you. :) and i LOVE RW!!!

I am sorry, that was another Handler function build the same way. I am a bit excited...

line 164 was: if rTarget then

line 165 was: rCreature = DB.findNode(rSource.sCTNode)

it throws the "rSource a nil Value" error.

in the second Screenshot with another rollhandler function line 22 ("if rSoucre") causes the error.
sorry for confusion!

damned
August 23rd, 2023, 10:21
Before the first error add a Debug like this:

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

damned
August 23rd, 2023, 10:22
And right after the

function AbwehrHandler(rSource, rTarget, rRoll)

add the following:

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

Are they all giving you what you expect?

It looks like rSource isnt being sent?

Elawyn
August 23rd, 2023, 10:26
I try and tell

Elawyn
August 23rd, 2023, 10:32
here is the screenshot with the debug to chat command . first line is the "angriffHandler" (line 22) #1021 from damned
the rest ist #1022 "function AbwehrHandler"

both rSource and rTarget are nil

58612

i dont no why. before update (yesterday evening) everything worked and i didnt change anything.

disclaimer: all artwork is licensed (bought on graphic river) so i think its no problem to show the screenshots.

psicodelix
August 23rd, 2023, 10:49
it is difficult to trace the source of the problem without seeing the whole project, but you can try to install the previous version to check if it is something related to the update, here is a link:


https://mega.nz/file/msRDjJyL#DUrClmrlQLauqepOZxI9heKkVVqsT6lEVFiNp3BqU 3k

you must uninstall the current version first.

Elawyn
August 23rd, 2023, 11:07
I roll back to 0.8.8. everything work as expected. no more errors or nil Values occured

psicodelix
August 23rd, 2023, 11:23
that is worrying, would you mind sharing the project (or a part of it) to try to find the source of the problem? I would need the part where the dice roll is generated.

Elawyn
August 23rd, 2023, 11:31
thank you so much for your help. I can now use the RW as normal, perhaps there is a solution in future for coming updates, but for now I can play. If it is helpful, I can provide my extension, but be aware i am without coding experience so it is a self-made solution i build after watching videos from real coders like you and damned.

BTW: the Wizard is fullfilling my dream of making an extension for my self-written ruleset on a wonderful VTT, which allows such things. And I am damned so thankful for his video series (esp. the christmas specials). i learned enough to build this and unterstand quotes here in forum or in forums like stackoverflow to find a solution working for me for all the things and automation I want to insert.

Elawyn
August 23rd, 2023, 11:34
@psicodelix: sure I will provide you everything you need for trouble shooting. should I send you the whole extension data as pm? or only the snippet with my roll Handlers? I tried to give my extension a similar structure as you did with the OGL example.

Elawyn
August 23rd, 2023, 12:26
I attached in a zip all my used roll Handlers. If you need the whole extension, tell me. Do not hesitate to ask me any question about my weird structure...

My system uses competetive rolls, so I build all rolls like an attac roll but changed the not used DC against the results of the former roll of the opponent. I manage the data transfer in the CT by (hidden) number fields, cross-linked to the NPC/ charsheet. The damage rolls are quite normal I guess, but uses rTarget so I attached them too. The values "LP" and "AP" are hitpoints and endurancepoints. The SF value is a damage multiplier (damage is in most situations based on the roll difference)

name explanation:

InitHandler = initiative
AngriffHandler = attac
AbwehrHandler = defense (parry action)
AusweichenHandler = defense (evade action)
ResistenzHandler = resistance
SkillHandler = skill
SchockHandler = shocked
FertigkeitDefensivHandler = competetive defense skill roll
AbwehrAstralHandler = defense (magic)
BFHandler/ PZHandler = breakage

I hope this gives a clou , what I did within the rolls.

PantsORama
August 24th, 2023, 04:20
So is there anyplace to go to learn about anchoring objects in the UI.

I am not getting it.

damned
August 24th, 2023, 05:14
Anchoring to what...
The Ruleset Wizard gives you a bunch of GUI options that are much easier to work with in my opinion.
There are some videos here on Anchoring that might help.

https://www.youtube.com/channel/UCRCeeMZq2rhjRl0O0XZAloA/videos

Otherwise explain/share what you are trying to do and hopefully we can work it out together!

PantsORama
August 24th, 2023, 05:38
Thanks. I am trying to anchor container to a frame, and then anchor UI input elements within that container.

But I am really a baby when it comes to this. I am not even sure what questions to ask.

So I am going to watch these vids and do some experimentation. Then I can have more focused questions, I hope.

Thanks for pointing me in the right direction.

damned
August 24th, 2023, 05:50
Ok Frame i understand.
What is a container?

Moon Wizard
August 24th, 2023, 06:34
If you're talking about a subwindow/container object, they will contain a separate window class. You would need to create the window class that the container points to with the layout you want within the subwindow/container.

If you're talking about creating a generic framed control, after you position/size the frame; you would want to use the <anchored to="framename" position="insidetopleft" offset="#,#" width="#" height="#" /> to position controls within the field (assuming you want to position from the top/left corner of the frame with a fixed width and height).

Generally, I find it easiest to use an existing ruleset, and make minor adjustments to learn the system first.

I don't use the ruleset wizard at all, just define controls with positions relative to parent window and/or other controls.

Regards,
JPG

Trenloe
August 24th, 2023, 08:26
So is there anyplace to go to learn about anchoring objects in the UI.

I am not getting it.
Are you using the ruleset wizard application outside of FG or is this a question about general FG UI coding?

damned
August 24th, 2023, 08:38
Its a Ruleset Wizard question. You cant really mix coding in and out of the Wizard. You do it all in the Wizard. You can code by hand in the Wizard but you cant edit the files outside of the Wizard as they will get over-written when you regenerate the PAK file.

psicodelix
August 24th, 2023, 12:10
I attached in a zip all my used roll Handlers. If you need the whole extension, tell me. Do not hesitate to ask me any question about my weird structure...

My system uses competetive rolls, so I build all rolls like an attac roll but changed the not used DC against the results of the former roll of the opponent. I manage the data transfer in the CT by (hidden) number fields, cross-linked to the NPC/ charsheet. The damage rolls are quite normal I guess, but uses rTarget so I attached them too. The values "LP" and "AP" are hitpoints and endurancepoints. The SF value is a damage multiplier (damage is in most situations based on the roll difference)

name explanation:

InitHandler = initiative
AngriffHandler = attac
AbwehrHandler = defense (parry action)
AusweichenHandler = defense (evade action)
ResistenzHandler = resistance
SkillHandler = skill
SchockHandler = shocked
FertigkeitDefensivHandler = competetive defense skill roll
AbwehrAstralHandler = defense (magic)
BFHandler/ PZHandler = breakage

I hope this gives a clou , what I did within the rolls.

Sorry, sometimes the forum does not warn me of new messages... Thanks, I'll take a look and see if I can find the problem.

psicodelix
August 24th, 2023, 12:32
https://www.rulesetwizard.com/update-combat-tracker-walkthrough/ (https://www.rulesetwizard.com/update-combat-tracker-walkthrough/)

damned
August 24th, 2023, 13:14
https://www.rulesetwizard.com/update-combat-tracker-walkthrough/ (https://www.rulesetwizard.com/update-combat-tracker-walkthrough/)

Thats awesome!

Elawyn
August 24th, 2023, 13:32
Thx for looking over the rSource issue and thx for the ct workaround!

psicodelix
August 24th, 2023, 14:45
Ok, finally I managed to find and fix the problem, it was indeed a bug in 0.8.9.

I will release a hotfix asap.

Elawyn
August 24th, 2023, 19:15
Yeah, really good news. thank you very much for your great support!

psicodelix
August 24th, 2023, 22:18
Yeah, really good news. thank you very much for your great support!

I have just released version 0.8.10 which fixes the problem. Please update your installation and check that everything works correctly.

Elawyn
August 24th, 2023, 22:29
I installed the Hot fix and tested my roll Handlers. Every roll work as expected. No errors. No Nil values.

You ironed it out. Good Job. Whatever you did. :)

damned
August 25th, 2023, 01:23
Well done psicodelix

psicodelix
August 25th, 2023, 07:56
Great!

psicodelix
August 30th, 2023, 16:31
FYI, I am working on the next update of the wizard, to include the latest changes in the graphic section of the core. I hope it will be finished this week. Stay tuned.

Brotherkelly
September 24th, 2023, 15:26
Hi all,

I don't know whether this has been asked already (I did search but couldn't find anything).

I have a pre-defined list in a data file, as shown below, that I would like to add to a string cycler. I can get the following code to work with a Combo Box but not the String Cycler.

The error I get is:

[ERROR] Script execution error: [string "C:item_equipment:equipment_group_list"]:3: attempt to call global 'addItems' (a nil value)

Any thoughts?

Pre-defined data:

geartypes = {
"Clothing",
"Tools",
"Personal Electronics",
"Weapon Accessory",
"Data Systems",
"Communication",
"Surveillance",
"Prosthetics",
"Security",
"Medical",
"Power Packs",
"Ammo Clip",
"General",
"Drugs & Poisons"
}

Code for Combo Box:

function onInit()
super.onInit();
addItems(DataCommon.geartypes);
end

bayne7400
September 24th, 2023, 15:32
Combo boxes are weird. First try to define the table to a variable (assuming additems takes a table.) aTable=datacommon...

If that doesn't work on init run a loop of your table and use the add item function in the combo box script. I have used the latter method.

Brotherkelly
September 24th, 2023, 16:38
Combo boxes are weird. First try to define the table to a variable (assuming additems takes a table.) aTable=datacommon...

If that doesn't work on init run a loop of your table and use the add item function in the combo box script. I have used the latter method.

Thanks, but the combo box isn't the issue. I cannot get it to work with the String cycler.

bayne7400
September 24th, 2023, 16:44
Where exactly in the button_stringcycler.lua is "additems" function? Additems is part of the combobox script.

Brotherkelly
September 24th, 2023, 16:48
Where exactly in the button_stringcycler.lua is "additems" function? Additems is part of the combobox script.

I think you may have identified where I need to look, thanks.

I will investigate the button_stringcycler.lua function.

Brotherkelly
October 26th, 2023, 19:23
I couldn't resolve my issue so I reverted to just adding the data in the cycler list.

Brotherkelly
October 26th, 2023, 19:36
I have another question regarding the sidebar buttons.

I wanted to add a couple of campaign buttons in my new ruleset for Skillsa and Traits but wasn't sure how to do this. After looking at the videos posted by Damned for the White Lies Ruleset, I found a solution.

I implemented the same code that Damned used but get the result shown in the attached file. The Skills button is labelled but the Traits button is not (the blank one at the top of the Campaign section).

The code I added (in the Strings.xml) was:

<string name="Library_recordtype_label_skills">Skills</string>
<string name="Library_recordtype_label_traits">Traits</string>

And the code I added in the data_library.lua was:

LibraryData.aRecords["skill"] = {
bExport = true,
aDataMap = {"skill" , "reference.skills"},
aDisplayIcon = {"sidebar" , "sidebar_down"},
sRecordDisplayClass = "skills",
sSidebarCategory = "campaign",
}

LibraryData.aRecords["trait"] = {
bExport = true,
aDataMap = {"trait" , "reference.traits"},
aDisplayIcon = {"sidebar" , "sidebar_down"},
sRecordDisplayClass = "traits",
sSidebarCategory = "campaign",
}

Is there anything I am missing?

superteddy57
October 26th, 2023, 19:57
Some are built in, but you would need to create string resources and append the name with the record key.

Example
<string name="library_recordtype_label_trait">Traits</string>
<string name="library_recordtype_single_trait">Trait</string>
<string name="library_recordtype_empty_trait">&#171; New Trait &#187;</string>

This is not dependent on Ruleset Wizard, just overall how that system works within FG.

Brotherkelly
October 27th, 2023, 13:50
Some are built in, but you would need to create string resources and append the name with the record key.

Example
<string name="library_recordtype_label_trait">Traits</string>
<string name="library_recordtype_single_trait">Trait</string>
<string name="library_recordtype_empty_trait"> New Trait </string>

This is not dependent on Ruleset Wizard, just overall how that system works within FG.

I added these extra lines but no change. Maybe there was something else I needed to do.

Anyway, I did some more digging into the Core RPG files and found that 'feats' was already defined. So I modified my code to utilise the feats string (with a minor renaming) and I have got what I want. The Traits sidebar button now shows the correct text and all the items in the list show correctly.

On to the next update.

greybeardgunner70
November 1st, 2023, 02:19
I have built a skills windowlist using Damned's great examples from his Xmas 22 series. Everything works just fine with one exception. See skill_detail image below.

I need to know if there is a special script or function that I need to use to have a dropped skill (using skill_card and skill_detail) pull a number from another script or from another place on the character sheet.
I have a script that automatically calculates "Skill Base" for each skill based on the attributes. I would need skill_detail to reference that script and call the named skill's Skill Base and populate the appropriate window on skill_detail.
I would also like for skill_detail to pull the encumbrance penalty from another window on the CS and populate that.
These numbers are then used to calculate the target number, so that a roll can be made from skill_detail.

greybeardgunner70
November 8th, 2023, 02:19
I think essentially I need a short tutorial on how "getparent" works in a script, so that I can use that to call certain stats off the CS when I use the "onDrop" function.

Brotherkelly
November 8th, 2023, 20:04
I think essentially I need a short tutorial on how "getparent" works in a script, so that I can use that to call certain stats off the CS when I use the "onDrop" function.

getParent() is used to step up a level within the database.

local nodeChar = window.getDatabaseNode().getParent().getParent();

This line provides the database node two levels (two instances of getParent() ) above the current node for the window. The current node in this case being charsheet.id-0001.combatpersonallist.id-0001

Therefore, after the getParent() has been applied, the new node is: charsheet.id-0001

You can now use this node to get data from other child nodes such as bod_current, bod_modifier, etc.

The lines below are from the database of my campaign.

<charsheet>
<id-00001>
<holder name="Octopus Knife Fight" owner="true" />
<age type="string">24</age>
<amount type="number">0</amount>
<appearance type="string">\n</appearance>
<attack_TN type="number">3</attack_TN>
<attack_TN_melee type="number">4</attack_TN_melee>
<attributes_misc_roll_level type="number">0</attributes_misc_roll_level>
<attributes_misc_roll_tn type="number">0</attributes_misc_roll_tn>
<bleeding_check type="string">Bleeding</bleeding_check>
<bod_current type="number">5</bod_current>
<bod_modifier type="number">0</bod_modifier>
<cha_current type="number">5</cha_current>
<cha_modifier type="number">0</cha_modifier>
<cleararmour_label type="string">Clear Amour Values</cleararmour_label>
<combatpersonallist>
<holder name="Octopus Knife Fight" owner="true" />
<id-00001>
<holder name="Octopus Knife Fight" owner="true" />
<attack_level type="number">3</attack_level>
<attribute_modifier type="number">0</attribute_modifier>
<combat_personal_stat type="string">Sm Arms</combat_personal_stat>
<combat_personal_statvalue type="string">smallarms</combat_personal_statvalue>
<combat_personal_weapon type="string">Gunther MP-20 SMG</combat_personal_weapon>
<personal_damage type="number">3</personal_damage>
<personal_target_number type="number">7</personal_target_number>
</id-00001>
</combatpersonallist>
<dex_current type="number">5</dex_current>
<dex_modifier type="number">0</dex_modifier>
<drop_item_check type="string">Drop Item</drop_item_check>
<edge_current type="number">3</edge_current>
<edge_modifier type="number">-1</edge_modifier>
<edge_value type="number">3</edge_value>
<enc_heavy type="number">60</enc_heavy>
<enc_light type="number">30</enc_light>
<enc_overloaded type="number">90</enc_overloaded>
<untrained_misc_roll_level type="number">0</untrained_misc_roll_level>
<untrained_misc_roll_tn type="number">16</untrained_misc_roll_tn>
<updatearmour_label type="string">Update Amour Values</updatearmour_label>
<wil_current type="number">6</wil_current>
<wil_modifier type="number">0</wil_modifier>
</id-00001>
</charsheet>

Hope this helps.

Moon Wizard
November 8th, 2023, 22:59
I recommend using the main DB package functions, instead of the individual node versions. It's safer for error handling, as well as a long term plan to migrate to DB package and deprecate the databasenode versions.

local nodeChar = DB.getParent(DB.getParent(window.getDatabaseNode() ));
or
local nodeChar = DB.getChild(window.getDatabaseNode(), "...");

Regards,
JPG

greybeardgunner70
November 28th, 2023, 03:21
local nodeChar = DB.getParent(DB.getParent(window.getDatabaseNode() ));

Does this direct it to search the entire database or simply go up 1 level and search? The number I am trying to call is on the Notes tab of the CS. I am trying to get it to populate on a windowlist of a sub window of the Abilities tab.

Brotherkelly
November 30th, 2023, 15:08
local nodeChar = DB.getParent(DB.getParent(window.getDatabaseNode() ));

Does this direct it to search the entire database or simply go up 1 level and search? The number I am trying to call is on the Notes tab of the CS. I am trying to get it to populate on a windowlist of a sub window of the Abilities tab.

This will go up two levels from the node you are currently at. Each getParent steps up one level.

greybeardgunner70
December 9th, 2023, 15:43
Is there a discussion somewhere on how to properly setup the file structure so everything will be included in the .pak when it is updated/exported? I clearly haven't done this correctly, since when I open the .pak on my laptop (vs my desktop where I created the ruleset), my graphics aren't importing.

bayne7400
December 9th, 2023, 16:09
Every time you export it pulls the graphics file from your hard drive. So if you move to another computer and the images are not in the same location it cant find them.

greybeardgunner70
December 9th, 2023, 16:31
Right, I understand that part. But if I were to want to export the ruleset and make it public, the images would have to be included in the .pak file. I need to know how to set that up.

The .pak file currently contains a Graphics folder, but it is empty. I could just copy the images into that folder, but there should be a way to have RW package them automatically, every time I generate a new pak file.

psicodelix
December 9th, 2023, 21:43
To make the wizard add the images to the pak file they have to be included in the project, and the path must be correct. Nothing else needs to be done.59436

greybeardgunner70
December 10th, 2023, 14:18
Here is the RW graphics file and the FGU error messages.

psicodelix
December 12th, 2023, 07:47
I think that the file path is not correct. Looking at your screenshot it looks like the path should start with C:\users\toddj\ instead of C:\users\Todd\.

greybeardgunner70
December 12th, 2023, 13:32
That is correct. users/todd is my desktop, users/toddj is my laptop. When I send the RW file or a PAK file to a friend who is assisting me with scripting, the images don't go through to him either. Just as they don't go through when I open the file on my laptop. When I create the frames and icons, I point RW to a folder on my hard drive where the images are kept. So this is my question, when I am ready to share the pak file, how do I package it so the images go with it? When I open the PAK file, it contains all the correct folders (including a graphics folder), but its empty. I know this works somehow, since I have used/opened Damned's tutorial examples. I'm sure I am missing something essential in the process, I just can't see it.

psicodelix
December 13th, 2023, 07:57
The first step would be to create a dedicated folder for your project and put the rwp file in it. Then you create a subfolder for the images, put the graphic files in it and add them to the project.
The last step is to make the wizard use relative paths. For this the simple option is to change the path by hand (by default the wizard uses absolute paths) and leave only the relative part, e.g. yourimgfolder\yourgraphicfile.png.
Another option is to check the advanced development option in the project options. With this option the wizard will use relative paths automatically (as long as the file is in a subfolder) but it will also create other source code management files and folders that you may not be interested in.
In any case, once the files have the relative path you can compress the whole folder and send it to someone else and everything will work correctly.

Elawyn
December 21st, 2023, 22:35
Hi Psicodelix, i have two questions to this action function, you use in your ruleset template (I modified it for my own RW based ruleset but only for the string values shown in chat output):

function action(draginfo)
local nodeWin = window.getDatabaseNode();
local rActor = ActorManager.resolveActor(nodeWin.getChild(".......")); -- To reach Character node
local rRoll = {};
rRoll.sType = "effect";
rRoll.aDice = {};
rRoll.nMod = 0;
rRoll.effect = window.name.getValue();
rRoll.nDuration = window.duration.getValue();
rRoll.sDesc = rRoll.effect .. " : " .. DB.getValue(nodeWin, "wirkung", "") .. "[" ..DB.getValue(nodeWin, "manoever_cycler", "") .. "]";

ActionsManager.performAction(draginfo, rActor, rRoll);

end

First: Is it possible to send that information shown in chat also in the effects field in the CT by ButtonPress (I can handle a ButtonPress command for a chat output)? If so, could you provide an idea, what the proper command/ way is?
Second: is it possible to reach the CoreRPG given field "duration" in the CT to set my operator from the according charsheet field as duration in the CT?
I know about different extensions dealing with actions/ effects for different rulesets. But they are much to complicated for me as non-coder to adapt. I am looking for a good aproach to have an automation for sending an effect in a despriptive way to the CT with the duration beside of dropping it by drag&drop (that works for the description except duration with this function and the corresponding onDragStart command). everything above that is a fruit, hanging too high for me. beside that I am interested in a way to learn about or see a template for RW, that allows such things ;)

Wish you the best and a merry christmas!

Elawyn

greybeardgunner70
January 14th, 2024, 15:10
I have been developing a Harnmaster character sheet using Ruleset Wizard. Everything is working peachy and how I want it, with one exception. When a player fills out their Inventory to the point scrolling is required, when they scroll there are spaces created between items that make it hard to tell exactly where you are. I realize this is very much a third party use of FGU and you guys aren't at all beholden to help someone who is essentially tinkering with your product, but I was hoping perhaps this was something you had run into before and you could tell me what's causing it. I have increased the size of the windowlist thinking perhaps there were built in limits to how small it could be, but that didn't change things. Clicking on anything in the window, resets the list (edit list, item info icon, etc). See image.

59705

59706

Moderator: Moved to the Ruleset Wizard thread.

greybeardgunner70
January 15th, 2024, 13:44
I have been developing a Harnmaster character sheet using Ruleset Wizard. Everything is working peachy and how I want it, with one exception. When a player fills out their Inventory to the point scrolling is required, when they scroll there are spaces created between items that make it hard to tell exactly where you are. I realize this is very much a third party use of FGU and you guys aren't at all beholden to help someone who is essentially tinkering with your product, but I was hoping perhaps this was something you had run into before and you could tell me what's causing it. I have increased the size of the windowlist thinking perhaps there were built in limits to how small it could be, but that didn't change things. Clicking on anything in the window, resets the list (edit list, item info icon, etc). See image.

59705

59706

Moderator: Moved to the Ruleset Wizard thread.

I guess they thought this was a RW problem...

damned
January 16th, 2024, 01:56
Send me the project file(s) and Ill have a look.

Brotherkelly
February 9th, 2024, 19:39
Hi all, not sure if this is the best lace for this query but here goes.

I am still working through building the ruleset for Battletech and part of my update requires the roll of a dice within the function of another roll. I am using the ActionsManager.performAction function. The functions rolls the dice okay but the value it shows in the chat is always 0, never the number actually rolled. The code I am using is below:


local rAreaRoll = {
sType = "Dice",
sDesc = "Explosive Damage",
aDice = {type = "d6"},
nMod = 0,
nBonuses = 0,
TN = 0
};

Debug.chat("Roll",rAreaRoll);
ActionsManager.performAction(nil, rSource, rAreaRoll);
local rMessage = ActionsManager.createActionMessage(rSource, rAreaRoll);
rMessage.text = rMessage.text .. "vs " .. sNodeID;
Comm.deliverChatMessage(rMessage);


Can anyone point me in the right direction to get the desired output in the chat window?

bayne7400
February 9th, 2024, 20:30
Try this for your rRoll Table.
local rRoll = {};
rRoll.sType = "explosive";
rRoll.aDice = "d6";
rRoll.nBonuses = 0
rRoll.nMod = 0;
rRoll.sDesc = "Explosive Damage",

I wouldnt use Dice

Also make sure you have this.

function onInit()
ActionsManager.registerResultHandler("explosive", ExplosiveHandler);

end

then it will look for a function named "ExplosiveHandler" and dump your results into that

Brotherkelly
February 9th, 2024, 20:47
Try this for your rRoll Table.
local rRoll = {};
rRoll.sType = "explosive";
rRoll.aDice = "d6";
rRoll.nBonuses = 0
rRoll.nMod = 0;
rRoll.sDesc = "Explosive Damage",

I wouldnt use Dice

Also make sure you have this.

function onInit()
ActionsManager.registerResultHandler("explosive", ExplosiveHandler);

end

then it will look for a function named "ExplosiveHandler" and dump your results into that

Thanks, this worked.