DICE PACKS BUNDLE
Page 91 of 109 First ... 41818990919293101 ... Last
  1. #901
    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.

  2. #902

    Join Date
    Nov 2017
    Location
    North Carolina, USA
    Posts
    266
    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?

  3. #903
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,649
    Blog Entries
    1
    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

  4. #904

    Join Date
    Nov 2017
    Location
    North Carolina, USA
    Posts
    266
    OK, thanks, I'll play around with that a bit.

  5. #905

    Join Date
    Nov 2017
    Location
    North Carolina, USA
    Posts
    266
    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.PNG
    Last edited by greybeardgunner70; May 18th, 2023 at 16:57.

  6. #906

    Join Date
    Nov 2017
    Location
    North Carolina, USA
    Posts
    266
    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"

  7. #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.

  8. #908

    Join Date
    Nov 2017
    Location
    North Carolina, USA
    Posts
    266
    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?

  9. #909
    Yeah you can do that. Go look at char main of OSE ruleset.

  10. #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;
    end

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
STAR TREK 2d20

Log in

Log in