Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - d20 System (http://forums.wolflair.com/forumdisplay.php?f=46)
-   -   How to build a custom class? (http://forums.wolflair.com/showthread.php?t=9039)

coastiemike August 16th, 2009 06:11 PM

How to build a custom class?
 
I bought a copy of the Hero Lab at Gencon this weekend. I have it installed and am trying to tweak it by creating a custom character class. I have a player who has a Beguiler in my Pathfinder campaign. Beguiler is not a class in the Pathfinder system so I would like to "build" or copy the beguiler class from 3.5 rules set and make some changes to reflect the Pathfinder rules.

How do I get to the create custom class screen? Is there a way to import my created custom beguiler class to my Pathfinder licensed Hero Lab?

Lawful_g August 16th, 2009 08:31 PM

I think custom file creation has not yet been implemented for Pathfinder yet. It should be finished within a week or two. Once that is done it should be accessable through "Tools" -> and "Editor" if it is like the normal 3.5 data set

coastiemike August 17th, 2009 03:33 AM

So, I can still create a custom class using 3.5?

Lawful_g August 17th, 2009 04:12 AM

Yes, but I don't know that it'll show in Pathfinder.

coastiemike August 17th, 2009 10:50 AM

Under 3.5, I go to Tools Menu and choose Launch Editor. I then get a pop up menu. It advises me:

"To start editing a new file, click on the "File" menu and select "New Data File." But, I don't get that option. The only options under File menu are:

New Portfolio
Open Portfolio
Save Portfolio
Save Portfolio As

Where the heck is the Create Custom Class at tab at?

Lawful_g August 17th, 2009 11:57 AM

I think you may be confused about what popped up. It isn't just a message, that should be the editor program.

After Launch Editor, there should be 2 windows open now, one is the Hero Lab program, and under that "File" menu there are the options you listed, having to do with portfolios.

The other window (the one with the message you are reading saying click on New Data File) should also have 4 menues at the top "file" "view" "tools" and "help". Under this file menu you should see Data File options.

coastiemike August 17th, 2009 02:15 PM

Thanks

Lawful_g August 17th, 2009 09:05 PM

No Problem

Invictus August 18th, 2009 12:13 AM

I'm having the same questions, though in my case the difficulty isn't finding the tabs, it's not being clear on how to use them. Adding a Feat or a Spell is nice and simple, but adding in an entire Class still has me confused. I see the "class" tab, and it's clearly how one would start. But there seems like there should be more to it, and what about the "Class level" and "class special" tabs, what's the difference there?

Invictus August 18th, 2009 03:56 AM

Ah, I am learning! Learned a few things by browsing other parts of the forum, and that helped me figure some out myself, especially the "Class" tab even if I'm still not sure how some parts of it are working. Green Ronin's old "Master Class" of "Avatar" doesn't seem to be able to prompt me to learn spells of higher level than zero, even with some showing up on the drop down menu. Hmmm. I'm sure it'll come as I keep working at the puzzle, but any hints are much appreciated!

Lawful_g August 18th, 2009 05:17 AM

A good place to start is with the tutorial, which you can find under the help menu in the editor. It will walk you through the basics, and if you have any questions (which I am sure you will) feel free to ask here in the forums. Mgehl is the master, but I can probably help you with simple things.

Invictus August 20th, 2009 01:15 PM

I've figured out a fair amount at this point, pretty much have the basics. It's oddball, special things that a class can do or gets as a benefit at a given level that I'm most interested in learning right now. Say, for example, the "Grace" class feature of the Completer Warrior's "Swashbuckler". It's a bonus to Reflex saves gained at 2, and improves at 11 and 20. It only applies when wearing light or no armor with light or no load. I see the Special Ability Info button, and it should obviously be put there, but it doesn't show up on the Character Sheet and clearly I wish it would. Presumably the "Special" tab is what I need, but looking at it, I don't see how to go about it.

Lawful_g August 20th, 2009 01:53 PM

Well actually, since it is something you get from a class, "class special" would probably be the more appropriate tag. Oftentimes you can see how to do things by looking at eval scripts already programmed things in HL, for example, the ranger's Evasion requires being in light armor for it to work. You can access the SRD classes through the editor through Open File -> Source folder -> appropriate class or you can just New (Copy) the appropriate special and look at the evals there.

From the ranger's class special evasion I see:

~ If we're wearing medium or worse armor, get out
if (hero.tagis[Hero.MedArmor] + hero.tagis[Hero.HeavyArmor] <> 0) then
var result as number
result = delete[Helper.ShowSpec]
done
endif

Barbarian's Fast movement requires you not be heavily encumbered. I would use Monk's fast movement, but it seems to have dissappeared from the program mysteriously.... Anyway from that eval script I pull:

var result as number
~ If we fail the test for being speedy, get out
if (hero.tagis[Encumbered.Light] + hero.tagis[Encumbered.Medium] = 0) then
result = assign[Helper.SpcDisable]
done
elseif (hero.tagis[Hero.HeavyArmor] <> 0) then
result = assign[Helper.SpcDisable]
done
endif

And finally, adding a bonus based on level requires you to first get your level, and determine the bonus based on that. There are many abilities you can copy to see how to program a variable bonus, and to see how to add to reflex saves, look at the Lightning Reflexes feat. Here is some code I pulled:

~ Get the bonus based on our level
var bonus as number
var level as number
level = field[xTotalLev].value
if (level < 5) then
bonus = -2
elseif (level < 9) then
bonus = -1
else
bonus = 0
endif

container.child[vRef].field[Bonus].value = container.child[vRef].field[Bonus].value + 2

Now you just have to combine the pieces you have gathered and test the code. It may take a little bit of fiddling. I have found that the hardest thing is often getting the right timing for it to work. Here is the final code I would try testing.

var result as number
~ If we fail the test for being speedy, get out
~ Note that I switched this around a little, due to personal preference
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

~ 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

~ 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

Feel free to ask any questions about other class specials and whatnot. You may also want to talk to chiefweasel about posting your finished file for the community to share, he is setting up a website where I am planning to post mine at least.

jack-slash August 22nd, 2009 08:47 PM

What eval script would use for the AC bonus you get with the ninja class?

Lawful_g August 22nd, 2009 09:12 PM

The Ninja's AC bonus works almost exactly the same as the monk's AC bonus, I would look there for inspiration for your eval script. Note that since they do not stack, you'll have to add an if-then statement to eliminate overlaps.

jack-slash August 22nd, 2009 09:24 PM

already tried that nothing came up for the ac bonus

jack-slash August 22nd, 2009 09:51 PM

any other ideas

Mathias August 22nd, 2009 10:44 PM

You'll have to be more specific about how you implemented your AC bonus; what does your script say? What timing does it use?

Lawful_g August 22nd, 2009 10:47 PM

Nothing came up? What do you mean? You copied it through the editor and there was no Eval Script?

If that is the case, you probably copied one of the later Monk AC bonus specials. Generally the very first special has all the coding included in it, and the rest are merely placeholders. The correct one should be named "Improved Armor Class" and the unique ID should be "cMnkAC".

If you copy this one, there should be a button on the upper right that says "Eval Scripts", click on that to see the coding. Did that help you find it?

jack-slash August 22nd, 2009 10:54 PM

thats what i need to know how to set up a script

Lawful_g 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?

Invictus 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!

chiefweasel August 25th, 2009 07:43 AM

Quote:

Originally Posted by Invictus (Post 32368)
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.

Lawful_g 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 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?

Mathias 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]

Mathias 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.

Invictus 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!

bodrin 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/

rob 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

Invictus August 26th, 2009 12:48 PM

Wow again. As mentioned in passing above, I first got the program for Mutants & Masterminds. I was very impressed by how helpful Colen has been over on the Atomic Thinktank for everyone who has questions, and now I'm seeing everybody at Lone Wolf is just as great!

I have been busy the last couple of days, but I did try the bootstrap thing and it worked beautifully. I've also checked out the links above, and that looks like good stuff too. I'll definately be grabbing the "Scout" from chiefweasel's site since that class really sounds like one of my player's description of the kind of thing he'd like to play.

Thanks again; you guys rock!

Lawful_g August 26th, 2009 05:21 PM

Scout is one of mine, please tell me if you run across any errors in it, so I can be sure to fix them.

Invictus August 29th, 2009 04:22 AM

I've snagged the files for the Scout, but I'm not getting him on the selection menu. I placed them in the d20 file, so I don't understand why it doesn't show up as an option.

Lawful_g August 29th, 2009 12:37 PM

.... I just looked at my own HL program and the Scout has disappeared! How weird.... Must have been some sort of recent update or something to HL? I'll post an error report.

Mathias August 29th, 2009 01:22 PM

I just downloaded it from the cheeseweasel site and can see Scout once I select that I'm using the Complete Adventurer source.

Lawful_g August 29th, 2009 01:55 PM

D'oh! Now I feel dumb.

Invictus August 29th, 2009 11:42 PM

Ah ha! That was the problem. Man, I tried everything else, including opening it up in the editor, testing, and getting the word that it would now be usable in Hero Lab. I was just the one little checkbox away the whole time.


All times are GMT -8. The time now is 01:16 AM.

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