Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System

Notices

Reply
 
Thread Tools Display Modes
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old August 23rd, 2009, 12:09 AM
Ok. I have suggested earlier that people try doing the tutorial, and try copying things from other abilities already programed and given an example of that. I am afraid that I don't know where to start with such a general request as "how to set up a script"... What have you tried already and what specifically is giving you trouble?
Lawful_g is offline   #21 Reply With Quote
Invictus
Junior Member
 
Join Date: Aug 2009
Posts: 8

Old August 25th, 2009, 07:23 AM
I think jack-slash is a lot like me on this one, and I probably should've explained this earlier ...

I don't know anything about writing computer code. And I realize that as a result, some of the things possible in the editor will not be so possible for me. I'd like to learn some of that stuff eventually, and for that reason I thank you Lawful_g, for the lengthy and involved post you provided for me, even though I don't understand a word of it yet. As for the tutorial, I didn't see anything there that I couldn't figure out from knowing the game rules and the fact that I've also worked with the M&M data set.

What I am able to do at this point is hit the buttons that give us choices, and fill in spaces for plain text. So I can add in Spells really easy, and some Feats, too. The Feats that give me a problem are the ones with a prerequisite. 'Cause when I hit the prereq button, I can get this selection menu that looks great, but when I choose from it, I must need to type something else with it (before? after? both?).

Like I say, I'd like to learn the advanced steps sometime. But I don't expect anyone on these boards to give me a full-on free computer programming class, either, so if that's ultimately what I need, I'm probably out of luck. What I am most interested in at the moment is maximizing the utility of what I do know how to do, and recognizing what is within that limit and what isn't. Going back to my "Swashbuckler" Grace example, I created something in "Class special" the other day, and still it didn't show on the character sheet. Does this mean a script is necessary? I was thinking (hoping) that a script only really needed if I wanted the program to do the math, when all I was shooting for at this point was a notation.

Thanks again for your help; I hope letting you know where I'm at on the learning curve makes it a little less frustrating to work with me!
Invictus is offline   #22 Reply With Quote
chiefweasel
Senior Member
 
Join Date: Aug 2008
Location: Miamisburg, OH
Posts: 1,321

Old August 25th, 2009, 07:43 AM
Quote:
Originally Posted by Invictus View Post
I think jack-slash is a lot like me on this one, and I probably should've explained this earlier ...

I don't know anything about writing computer code. And I realize that as a result, some of the things possible in the editor will not be so possible for me. I'd like to learn some of that stuff eventually, and for that reason I thank you Lawful_g, for the lengthy and involved post you provided for me, even though I don't understand a word of it yet. As for the tutorial, I didn't see anything there that I couldn't figure out from knowing the game rules and the fact that I've also worked with the M&M data set.

What I am able to do at this point is hit the buttons that give us choices, and fill in spaces for plain text. So I can add in Spells really easy, and some Feats, too. The Feats that give me a problem are the ones with a prerequisite. 'Cause when I hit the prereq button, I can get this selection menu that looks great, but when I choose from it, I must need to type something else with it (before? after? both?).

Like I say, I'd like to learn the advanced steps sometime. But I don't expect anyone on these boards to give me a full-on free computer programming class, either, so if that's ultimately what I need, I'm probably out of luck. What I am most interested in at the moment is maximizing the utility of what I do know how to do, and recognizing what is within that limit and what isn't. Going back to my "Swashbuckler" Grace example, I created something in "Class special" the other day, and still it didn't show on the character sheet. Does this mean a script is necessary? I was thinking (hoping) that a script only really needed if I wanted the program to do the math, when all I was shooting for at this point was a notation.

Thanks again for your help; I hope letting you know where I'm at on the learning curve makes it a little less frustrating to work with me!

Hey there Inviticus, I also am like you and not a programmer. Even if you were though I beleive the scripting language used by the Lone Wolf guys is created by them (If this isnt true, please corect me). that being said I feel your pain. The one aspect of HL that makes it such a great product is also its greatest weakness, that is that it is highly flexible. I run into problems with code all the time trying to create feats or prestige classes. So far I have been able to muddle through using code examples and pulling information from other HL files. I was extremely lost with HL until I attended a training session at Gen Con last year. I attended one this year as well and earned some new stuff. Although Colen showed me how to create a class variant, which I am still struggling with.

But to address the problem you are having, sometimes a solution comes down to coding. If you are having problems, and it sounds like you are, it might be easier to get some one on one information/help. I can offer my meager knowledge for this, but I might not have the module you are working with. But i can most likely work with the code lawful_g has provided. So if you would like I can take a harder look at the class you are trying to create, but I dont want to promise anything.

On a side note, there is a growing amount of user content available that Lawful_g, Brodin, and myself have created. Just check under the Her Labs User forum for details. But I invite everyone to add user content, eventually all of a game systems content will be available for all users. Which in turn should reduce problems people have with creating content.
chiefweasel is offline   #23 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old August 25th, 2009, 09:13 AM
I know just how you feel Invictus, I started exactly where you are, and you might have noticed that I still clog this forum with questions pestering mghel. Most of all, don't give up, I learned basically everything I know by trial and error or help from others on the forums since I started.

I'll try to give you some basic pointers, and I'll rely on wiser heads to correct me where I am wrong.

You mentioned that you ability "Grace" is not showing when you add the swashbuckler class? I think you might have a problem with bootstraps. Once you have created both the class and the class special, you need to link them so that when you add the Swashbuckler class in HL, it brings the grace ability with it.

The link is called a bootstrap, and you can accomplish it through the editor by highlighting the class you made (make sure it is the class not the class level tab) and then clicking on the Bootstrap button in the upper right. That should bring up boxes, which you type in the unique id for the ability you want to bootstrap (Say, "cSwaGrace" for this example). You can hit the button (Click to add another bootstrap) so you can add other class abilities too. This is the basic way that you build a prestige or normal class, by creating the abilities and bootstrapping them to the class.

For class abilities the level they are added depends on the entry in the class special for "Level Requirement" and that is all you should need for Swashbuckler. In some other cases (usually when a class gains a certain feat at a certain level) you might have to add a Condition to your bootstrap, which I won't go into here, but does much the same thing.
Lawful_g is offline   #24 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old August 25th, 2009, 09:51 AM
The script used is not custom, at least I don't think. It is XML, which I had never used or heard of before I picked up HL. Here i'll give a detailed explaination of the previous code I provided, and hopefully that will provide some insight for you, Invictus.

var result as number
~ The above tells hero lab that we are going to create a variable named "result" and it is going to be a number. The general formula for this sort of thing is "var XXXX as number" and we can put any non-reserved word in the place of XXXX. If it is reserved, you will get an error later.

if (hero.tagis[Encumbered.Medium] + hero.tagis[Encumbered.Heavy] <> 0) then
result = assign[Helper.SpcDisable]
done
elseif (hero.tagis[Hero.MedArmor] + hero.tagis[Hero.HeavyArmor] <> 0) then
result = assign[Helper.SpcDisable]
done
endif

~ The general form HL uses for if/then statements is

"if (some Mathmatical relationship) then
the result
endif"

the result is only performed when some Mathmatical relationship is true. You can nest if/thens within each other to make very specific requirements to execute the result, but each of them needs to have it's own "endif" statment. Also not that if you are not nesting them, but performing them in sucession, the 2nd and all others should be "elseif".

The "hero.tagis[Encumbered.Medium]" is important as well. "hero" tells the program where to look (on your hero, obviously), "tagis" specifies that it is checking to see if a certain tag ("Encumbered.Medium" tags referred to in scripts are in []) exists and if so it will return a 1.

result = assign[Helper.SpcDisable] is a command to assign the tag "Helper.SpcDisable" to the grace ability (rendering it non-functional and greyed out), since this is the second part of an if/then it will only be carried out when the first part is true.

"done" tells the eval script to stop whatever it is doing and get out here. It is only safe to use as the second part of an if/then. If you use it outside of there, all code after it will not be read or carried out.

~ Get the bonus based on our level
var bonus as number
var level as number
level = field[xTotalLev].value
if (level >= 20) then
bonus = 3
elseif (level >= 11) then
bonus = 2
else
bonus = 1
endif


~ Here we set 2 new variables, and defined level based on the value of the field "xTotalLev". Then, depending on what the value of level was, we set the value of bonus. This is a common script you will be using a lot, for just about anything that varies with level.

~ Note that the bonus is a Competence bonus, so I have changed what was previously .field[Bonus] to .field[BonComp]
container.child[vRef].field[BonComp].value = container.child[vRef].field[BonComp].value + bonus

~ Here is where my knowledge gets a little fuzzy and I tend to fiddle around a bit. I am not sure what "container" means but it is the starting point. I think of a "." as sort of an arrow to the next level, so .child[vRef] means "from container go down to vRef" and .field[BonComp].value means "go to the field BonComp and get it's value".

The first part (container.child[vRef].field[BonComp].value) is specifying what we are looking at, and then we set it = to the current value + the bonus we defined before.

There, that completes my little demo. Any questions?
Lawful_g is offline   #25 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,559

Old August 25th, 2009, 10:38 AM
Lawful_g, could you please edit your post to change the:
result = assign[]

statements to use:

perform assign[]

That's the current standard, and I'd rather not teach a new user the old way of doing it.

Also, X = X + Y (like your container[vRef] example, can be replaced with:

X += Y (or -=, *=, /+) to save a bit of typing.

The other usage of var is:
var XXX as string

which tells the compiler you want a string (letters and words) variable. That won't be used as much by the user, but is occasionally needed when you want to generate some text output.

Sorry to hit you again, but as a reminder, competence bonuses in d20 don't stack, so you shouldn't simeply add something to it.

There are macros available to help you with the non-stacking bonuses:

#enhancementbonus[pick, bonus]
#competencebonus[pick, bonus]
#applybonus[type, pick, bonus]
#applypenalty[type, pick, bonus]

In all those cases, pick is the reference of what you want to modify; hero.child[vRef] is the proper way to access the reflex save.

bonus is the new value, and type is the field you want to modify (which sort of thing it is), for example: BonComp, BonEnhance, BonMorale. For the complete list, open up the help page from your editor and go to the "Reference Information" link.

For your competence bonus example, you could either use:

Code:
#competencebonus[hero.child[vRef],bonus]
or

Code:
#applybonus[BonComp,hero.child[vRef],bonus]

Last edited by Mathias; August 25th, 2009 at 11:53 AM. Reason: Competence bonuses don't stack
Mathias is offline   #26 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,559

Old August 25th, 2009, 11:41 AM
Thank you very much for helping a new user - that sort of help from the more experienced users is what got me through my first data file for Armybuilder.

Other new things in the scripting language:

You can replace:

Code:
if (XXX) then
done
endif
with:

Code:
doneif (XXX)
turning it all into one line of code. This would be used when you have a long script, but you don't want the script to run unless some condition is fulfilled. An example of how to use this would be this, from the barbarian's uncanny dodge ability:

Code:
~ If we're not shown, just get out now
if (tagis[Helper.ShowSpec] = 0) then
done
endif
which should now be written as:
Code:
~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] = 0)
To all users: those lines can be added to most class specials - they mean don't do any more of the script unless we're being shown on the specials list (which doesn't happen if a class variant replaces the ability or the class has not leveled enough to get the ability).

The corresponding code for feats is this:
Code:
~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)
(this should be used in most or all feats, because the Skeleton template says that the critter loses all existing feats, which is handled in HL by assigning all feats the Helper.FtDisable tag. It's also needed if a class special wants to replace a bonus feat a class is granting).

In prerequisites, you often need the same sort of thing:

Code:
if (XXX) then
@valid = 1
done
endif
Is now:

Code:
validif (XXX)
This would be useful for a complex prerequisite that said the thing is valid under some condition A, but if A is not correct, B and C have to be correct. So, you would put condition A in the validif statement, then put the tests for B and C after that.

The other new convention to cover is that if you have a prerequisite that consists of:

Code:
if (XXX) then
@valid = 1
endif
(so, something that @valid() can apply to), you can save yourself more time by putting it in an expression requisite. In there, all you have to write down is the stuff inside the if statement:

Code:
XXX
And really, this applies to 90% of the prereqs in d20.
Mathias is offline   #27 Reply With Quote
Invictus
Junior Member
 
Join Date: Aug 2009
Posts: 8

Old August 25th, 2009, 05:41 PM
Wow. Look at all that info! It's obviously going to take some time to digest it, but the cursory once over sure looks like the kind of thing I was looking to know. Thanks to everyone that has replied since my previous post!
Invictus is offline   #28 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,263

Old August 25th, 2009, 05:50 PM
So far i've got 41 Complete Warrior General feats entered and working once all the feats from the book are entered complete they will be available on the website.

As ChiefWeasel has stated there is a growing user content that myself, Lawful_g and Chiefweasel have entered.
The coding techniques used in them are starting points for the weirdness of the splat books!!

http://www.cheeseweasel.net/
bodrin is offline   #29 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,003

Old August 26th, 2009, 12:50 AM
You'll find quite a bit of documentation on the scripting language and how to utilize it within the Authoring Kit documentation. It's all in a wiki for easy reference, and much of the above details provided by others will be found in the wiki. Here's a link to the pertinent section within the wiki:
http://hlkitwiki.wolflair.com/index....pting_Language
rob is offline   #30 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 11:20 PM.


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