• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Manipulating field/thing and if statements

BoomerET

Well-known member
I have a summary tab that I want to display the stats.

However, I want to convert the stats to hex, and then concat them into one string.

For example, if my stats are Str: 8, Cha: 12, Edu: 14

I want the top of the summary tab to display:
8CE

My problem is that I don't know how to reference each indiviual value, I've tried a few things I've seen in the samples, but nothing is currently working.

field[chaStr].value

(All my stats are called Characteristics, so they all start with cha)

Also, is it possible to do an if statement on .text?

For example if (field[name] = "MyValue")

The example if statements I've seen only compare numbers.

LW: Thanks for such an awesome product and allowing us the ability to create our own Game Systems!!


BoomerET

EDIT: Found this link that answers my if statement, guess I should search before asking.
http://forums.wolflair.com/showthread.php?t=21668&highlight=compare+string
 
Last edited:
You've already written a finalize script for the trtFinal field that displays the values of characteristics as hex, right?

Then,

@text = hero.child[chaStr].field[trtFinal].text & hero.child[chaCha].field[trtFinal].text & hero.child[chaEdu].field[trtFinal].text

Would be the code you'd put in the portal that's displaying the result.
 
Awesome, that line did the trick.

No, I'm allowing the user to select 2-12, and then I'll have to put in code to convert to Hex. Maybe it's not a bad idea to just skip 2-12, and go with 2-C, but not exactly sure how I would go about doing that in the chooser.

Sounds like another thing that will help cement my abilities in learning to write a Game System.


BoomerET
 
Fields in Hero Lab are either numerical or text - nothing in between.

That's what finalize scripts are for - to format the numbers so that the user sees the presentation you want for that value.
 
Back
Top