Hero Lab scripting 104: Using Math & Text
This article is part of a collection of editor and scripting articles: http://forums.wolflair.com/showthread.php?t=21688
In Hero Lab's scripting languages, the standard math operations are of course available: + - * / So, you can write instructions like: hero.child[skClimb].field[Bonus].value = hero.child[skClimb].field[Bonus].value + 2 There's also a way to abbreviate that, so you don't have to type as much: += -= *= /= Here's the same instruction, with the abbreviation: hero.child[skClimb].field[Bonus].value += 2 These abbreviations remove the need to repeat the base thing. Other common math operations:
|
Here's how to add one piece of text to another in Hero Lab's scripting language:
string = "The quick brown fox" & "jumped over the lazy dog." will set the variable 'string' to: "The quick brown foxjumped over the lazy dog" Note how I forgot to put an extra space in there. Correcting that: string = "The quick brown fox" & " " & "jumped over the lazy dog." Let's say 'string' has already been set to "The quick brown fox", and you want to add more text to it. Here's how to do that: string = string & " " & "jumped over the lazy dog." or, you can abbreviate that, in order to save typing: string &= " " & "jumped over the lazy dog." Other common string operations:
|
Great stuff. Thanks, Mathias!
|
"hero.child[skClimb].field[Bonus].value = hero.child[skClimb].field[Bonus].value + 2"
Is there a write-up on what a string like this means? What is it telling HL to do? Is there a breakdown? Thanks, Edward Nevermind, I saw it on the next post Location Location Location :) |
String in fields selection
Why doesn't something like this work?
var id as string hero.childfound[id].field[cGiveSpec].value+=1 What am I getting wrong? Is there a way to do something like this? |
All times are GMT -8. The time now is 01:19 AM. |
Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.