|
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633
|
Mathias,
I'm trying to get this procedure to work so that it shows the names of all class features in a list. What am I doing wrong with it? Code:
<procedure id="cSpecInfo" scripttype="mouseinfo"><![CDATA[ @text = "{b} - Class Features & Special Abilities - {/b}{br}{align left}" var i as number for i = 1 to 30 @text = @text & "{br} {b}Level " & i & ":{/b} " ~display our Spells per day values based on class foreach pick from Class where "component.ClassAbil" if (eachpick.tagvalue[ClSpecWhen.?] = i) then @text = @text & field[name].text & ", " endif nexteach ~ If this was the last level we got to, change the color of the rest ~ of the text if (i = field[cTotalLev].value) then @text = @text & "{text clrdisable}" endif next RavenX Pronouns: She/Her Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you. I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all. Last edited by RavenX; May 9th, 2014 at 07:33 PM. |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
This is the type of foreach pathfinder uses to assemble the list of class specials for an archetype, when you're choosing which archetype to add:
Code:
foreach bootstrap in this |
#2 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633
|
What am I doing wrong? It keeps giving me an error message:
Quote:
Code:
<!-- Proceedure cSpecInfo Presents a table that the user can see which displays various Special Ability details. --> <procedure id="cSpecInfo" scripttype="mouseinfo"><![CDATA[ @text = "{b} - Class Features & Special Abilities - {/b}{br}{align left}" var i as number for i = 1 to 30 @text = @text & "{br} {b}Level " & i & ":{/b} " ~display our Spells per day values based on class foreach bootstrap in Class where "component.ClassAbil" if (i = eachthing.tagvalue[ClSpecWhen.?]) then @text = @text & field[name].text & ", " endif nexteach ~ If this was the last level we got to, change the color of the rest ~ of the text if (i = field[cTotalLev].value) then @text = @text & "{text clrdisable}" endif next ]]></procedure> RavenX Pronouns: She/Her Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you. I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all. |
|
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
Code:
foreach bootstrap in this from ClassAbil |
#4 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633
|
How do I start the foreach on the class?
This will recompile and load but the table isn't displaying anything. Code:
<!-- Proceedure cSpecInfo Presents a table that the user can see which displays various Special Ability details. --> <procedure id="cSpecInfo" scripttype="mouseinfo"><![CDATA[ @text = "{b} - Class Features & Special Abilities - {/b}{br}{align left}" var i as number for i = 1 to 30 @text = @text & "{br} {b}Level " & i & ":{/b} " ~display our Spells per day values based on class foreach bootstrap in this from ClassAbil if (eachthing.tagvalue[ClSpecWhen.?] = i) then @text = @text & field[name].text & ", " endif nexteach ~ If this was the last level we got to, change the color of the rest ~ of the text if (i = field[cTotalLev].value) then @text = @text & "{text clrdisable}" endif next ]]></procedure> RavenX Pronouns: She/Her Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you. I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all. |
#5 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
What is the context of the portal that is calling this mouseover?
Or is this something you're calling from the Descript procedure? I just looked at that - DAMN that'll be slow code - a 30-item for loop, each loop calling a foreach - that'll take forever to generate. |
#6 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
Why don't you tell me what the objective is here. I think there's going to be a better way to approach it.
|
#7 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633
|
Slow? Yes you have 30 levels to iterate through but you don't have class features at each and every level. 2e was sort of sparse in terms of class features.
What the objective is, was to get this information called in through a portal on the Class Tab, similar to what Pathfinder used for Specials, which lists out the name fields of each class feature at the level you gain it. That way someone could just mouse over the table and look to see what features they get and when they become active. Unlike Pathfinder, where you gain something just about every level, they're more spread out. Sometimes you don't get a new one between 9th and 21st level. I am just trying to have it list the level and class feature name fields in a list based on level using the ClSpecWhen tag that's assigned to it. RavenX Pronouns: She/Her Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you. I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all. |
#8 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
In that case, what you want to do is create a text array on the class. Then, you put a script on the ClassAbil component that puts the name of that class special into the correct row of that array:
Code:
root.field[whatever].arraytext[level -1] = splice(root.field[whatever].arraytext[level -1], "The new text",", ") |
#9 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
BTW, the fact that the foreach doesn't find anything at most levels doesn't speed things up much - just starting a foreach is time consuming.
|
#10 |
|
|