View Single Post
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old September 28th, 2017, 03:59 PM
Quote:
Originally Posted by Mathias View Post
Yeah, visual elements can get regenerated several times. Does that happen to be the first item in the table - that could mean a pass specifically to get the height of the first element, which will then be used to lay out the rest of the table.

Is it an option to build all this text in a component field, which the visual element can just look up? That saves the foreach from having to run so many times.
As to the first part of your comment, what I'm getting from it is that the script is being called for reasons which might not be obvious to me, so this isn't completely unexpected.

As to the second part of your comment ... maybe, but that wouldn't solve my whole problem, and I'm not sure that would be the best solution. There are attributes, skills, and specializations. I'm emulating the official character sheet in putting all things related to a given attribute on the same line. So three columns:

Attributes | Skills | Specializations

I have a template that includes:
- One portal for attributes that looks up each attribute.
- One portal for skills that looks up each skill linked to that attribute.
- One portal for specializations that looks up each skill linked to that attribute, then for each skill, it looks up each specialization linked to that skill.

Wherever I determine these output fields, I'd have to have equivalent loops somewhere. The loops that will run the least are the ones for printing character sheets.
EightBitz is offline   #13 Reply With Quote