Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit

Notices

Reply
 
Thread Tools Display Modes
sincla
Member
 
Join Date: Aug 2014
Posts: 52

Old September 6th, 2014, 05:56 PM
The following code:

Code:
 <creation><![CDATA[
              var level as number
	      foreach pick in hero where "ClassLevel.?"
	         level += eachpick.tagvalue[ClassLevel.?]
	         nexteach
              level += 1
	      perform this.assignstr["ClassLevel." & level]
	      ]]></creation>
gave me the following error:

Quote:
Syntax error in 'creation' script for Component 'Class' on line 3
--> Reference to undeclared variable: foreach

Last edited by sincla; September 6th, 2014 at 06:00 PM.
sincla is offline   #1 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,603

Old September 6th, 2014, 07:32 PM
Code:
  foreach pick in hero from component where "the tags"
Look at your script, it's missing something...

RavenX

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   #2 Reply With Quote
sincla
Member
 
Join Date: Aug 2014
Posts: 52

Old September 6th, 2014, 08:17 PM
I added in the component:

Code:
foreach pick in hero from Class where "ClassLevel.?"
and I get the same error.

I didn't know the from Component was required. The wiki example doesn't have it:

Code:
foreach pick in hero where "group.tag"
            debug "id: " & eachpick.idstring
            nexteach
and I've succesfully executed foreach loops without it, even in the skeleton code there are examples such as:

Code:
foreach pick in hero where "system_tag.minion"
Was that not what you were getting at? Did I totally miss your point?
sincla is offline   #3 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,603

Old September 6th, 2014, 08:30 PM
Usually specifying the component is important, otherwise you're searching through all the picks on the actor having the tag...

I'd say lookup foreach context in the kitwiki and read it. I'm not sure if you can use a foreach loop during a creation script, as you usually set field limitations and default user values with a creation script. I think creation scripts are for preadvancement phase characters. Once a character is locked for advancement those scripts are done running.

What are you trying to do specifically with your foreach loop? What are you trying to tell the compiler to do?

RavenX

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   #4 Reply With Quote
sincla
Member
 
Join Date: Aug 2014
Posts: 52

Old September 6th, 2014, 08:53 PM
Oh this is just one of my convoluted schemes to try and get sequential ordering of the class rows in the level column of the class level table like the d20 system. I was trying to make class picks not unique, give each one a separate level tag for the character level at which it was added, and display that in the level portal of the table dynamic.

To be completely clear about the ultimate goal, I've attached a screenshot. I hope it's helpful.
Attached Images
File Type: jpg level ordering.jpg (56.1 KB, 7 views)
sincla is offline   #5 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,603

Old September 6th, 2014, 11:32 PM
Table Dynamic Element in the wiki

look for:
orderfield=""

You don't need a foreach loop for that...

RavenX

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   #6 Reply With Quote
sincla
Member
 
Join Date: Aug 2014
Posts: 52

Old September 7th, 2014, 09:21 AM
Quote:
Originally Posted by RavenX View Post
Table Dynamic Element in the wiki

look for:
orderfield=""

You don't need a foreach loop for that...
Thank you. I feel chastened once again that it was something with a dedicated feature I was overlooking.
sincla is offline   #7 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,603

Old September 7th, 2014, 02:59 PM
Quote:
Originally Posted by sincla View Post
Thank you. I feel chastened once again that it was something with a dedicated feature I was overlooking.
It took me awhile to figure out, its not so easy to figure out honestly. I've had to ask for help many times.

RavenX

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
sincla
Member
 
Join Date: Aug 2014
Posts: 52

Old September 8th, 2014, 10:12 PM
Thanks, that makes me feel a little less of an idiot .
sincla is offline   #9 Reply With Quote
Reply

Thread Tools
Display Modes

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 12:35 AM.


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