xCount / FirstCopy
I am working on a dataset where I need to use something similar to the xCount/xIndex/Helper.FirstCopy functionality.
I figured I could set up a component with both fields, and if the component becomes a pick and doesn't have the FirstCopy tag, add it. How so i deal with the count and index fields though? Are they in incremented by scripts on the overall component or something on the fields themselves? Any suggestions or examples? :) TC |
The xCount and xIndex fields are generated with a foreach that uses a sort order to search through the abilities in order by the level they're added at.
The script that assigns them runs after FirstCopy is assigned, and is only run by the firstcopy. As it finds each copy, it increments a variable by +1 and then assigns the current value of that variable to that copy's xIndex. Then at the end, that variable's value becomes xCount, and then in a script soon after that, all the other copies find the firstcopy of themselves, and set their own xCount equal to the firstcopy's xCount. |
Hmmm.... I think I'm missing something on adding the FirstCopy tag....
Code:
<component Code:
|
Maybe a foreach that assigns firstcopy and then exits after 1 is assigned, or a findchild or something that only gets 1 response.
|
Okay, looks like the quickadd mechanism that we use isn't in any of the documentation, so here's the relevant scripts in Pathfinder;
On the hero: Code:
<eval value="31" phase="PostLevel" priority="149" name="Prepare First Copy"><![CDATA[ Code:
<!-- Note that the first part of this, "Prepare First Copy" has been moved |
Thank you Mathias!
I'll see what I can do with this. I'm sure this will help others too, so I'll post what I do. :) |
Mathias, I'm trying to implement this code. I had to guess at the sortsets (included below). I also have a SpecSource script to copy source from parents, so duplicate specials from different classes have different SpecSource values.
The xTotal, xAllLev, and xMaxLev are not right. I suspect it's from the SortSets and the missing Calculation scripts. xIndex is right (starts at 1 on first copy and goes up.) But xCount isn't right either. Are there examples of Helper.MultiCopy in pathfinder? Code:
My SortSets |
@risner: See if this helps. :)
In my system, Talents (the Talent component) can be taken multiple times and so need the xCount/Index functionality. "Effects" is a phase right after Setup. 1) Add xCount and xIndex (and xTotal, xAllLev, and xMaxLev if using them ) fields to the component you want to use this on 2) Add the "Prepare First Copy" script to the actor component. 3) Add the other scripts on the component you want to track. I'm not using the xTotal, xAllLev, and xMaxLev because the system doesn't need it. Does that help? |
@Mathias:
How would this need to be modified if the component also includes a Domain (domDomain field)? For example, I have a talent called Expertise which allows for user entry of the specific expertise. Right now, if I take expertise and specify a domain value, it correctly is tagged as a FirstCopy/OnlyCopy with xIndex/xCount of 1/1. If I take Expertise again, no matter if I specify a different domain value, it's counting the first Expertise taken as the FirstCopy, and the xCount goes to 2. First take: Expertise: Ancient Gods; xCount = 1, xIndex = 1, Helper.FirstCopy, Helper.OnlyCopy, User.NeedDomain take a second and third time: Expertise: Ancient Gods; xCount = 3, xIndex = 1, Helper.FirstCopy, User.NeedDomain Expertise: Firearms; xCount = 2, xIndex = 2, Helper.SpecUp, User.NeedDomain Expertise: Firearms; xCount = 2, xIndex = 3, Helper.SpecUp, User.NeedDomain I'm looking for it to be: Expertise: Ancient Gods; xCount = 1, xIndex = 1, Helper.FirstCopy, Helper.OnlyCopy, User.NeedDomain Expertise: Firearms; xCount = 2, xIndex = 1, Helper.FirstCopy, User.NeedDomain Expertise: Firearms; xCount = 2, xIndex = 2, Helper.SpecUp, User.NeedDomain Does that make sense? Any suggestions? Thanks! TC |
Well, after a few stops and starts and bumps, I've managed to get this working the way I intended. :)
It required some extra Helper/User tags, but in the end it works. I'll eventually make notes and share. :) |
All times are GMT -8. The time now is 10:58 AM. |
Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.