-
March 11th, 2023, 18:03 #901
- Join Date
- Dec 2018
- Location
- England, UK
- Posts
- 168
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.
-
May 18th, 2023, 14:03 #902
- Join Date
- Nov 2017
- Location
- North Carolina, USA
- Posts
- 255
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?
-
May 18th, 2023, 14:22 #903
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
-
May 18th, 2023, 15:20 #904
- Join Date
- Nov 2017
- Location
- North Carolina, USA
- Posts
- 255
OK, thanks, I'll play around with that a bit.
-
May 18th, 2023, 16:02 #905
- Join Date
- Nov 2017
- Location
- North Carolina, USA
- Posts
- 255
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?
Capture.PNGLast edited by greybeardgunner70; May 18th, 2023 at 16:57.
-
May 18th, 2023, 19:59 #906
- Join Date
- Nov 2017
- Location
- North Carolina, USA
- Posts
- 255
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"
-
May 18th, 2023, 22:58 #907
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.https://forge.fantasygrounds.com/shop/items/199/view
Old School Essentials Ruleset
https://www.dmsguild.com/product/352...eon-Builder-5E
5e Random Dungeon Generator!
-
May 19th, 2023, 01:05 #908
- Join Date
- Nov 2017
- Location
- North Carolina, USA
- Posts
- 255
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?
-
May 19th, 2023, 01:49 #909
Yeah you can do that. Go look at char main of OSE ruleset.
https://forge.fantasygrounds.com/shop/items/199/view
Old School Essentials Ruleset
https://www.dmsguild.com/product/352...eon-Builder-5E
5e Random Dungeon Generator!
-
May 19th, 2023, 02:16 #910
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;
endhttps://forge.fantasygrounds.com/shop/items/199/view
Old School Essentials Ruleset
https://www.dmsguild.com/product/352...eon-Builder-5E
5e Random Dungeon Generator!
Thread Information
Users Browsing this Thread
There are currently 2 users browsing this thread. (0 members and 2 guests)
Bookmarks