Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633

Old May 9th, 2014, 07:30 PM
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
I am trying to build a table that displays names of the class specials similar to pathfinder.

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.
RavenX is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old May 10th, 2014, 07:55 AM
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
Mathias is online now   #2 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633

Old May 10th, 2014, 02:24 PM
What am I doing wrong? It keeps giving me an error message:

Quote:
Syntax error in script for Procedure 'cSpecInfo' on line 8
-> Invalid syntax within 'foreach' statement
What is the invalid syntax that it is complaining about?

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.
RavenX is offline   #3 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old May 10th, 2014, 02:31 PM
Code:
foreach bootstrap in this from ClassAbil
You have to start the foreach already on the class, then you're looking up the class abilities that are bootstrapped to it.
Mathias is online now   #4 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633

Old May 10th, 2014, 03:38 PM
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.
RavenX is offline   #5 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old May 11th, 2014, 09:07 AM
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.
Mathias is online now   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old May 11th, 2014, 09:08 AM
Why don't you tell me what the objective is here. I think there's going to be a better way to approach it.
Mathias is online now   #7 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633

Old May 11th, 2014, 10:34 AM
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.
RavenX is offline   #8 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old May 11th, 2014, 10:58 AM
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",", ")
Then, your mouseinfo script only needs a for loop to read off the text in each row.
Mathias is online now   #9 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old May 11th, 2014, 10:59 AM
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.
Mathias is online now   #10 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:18 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.