Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
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.
|
#11 |
Junior Member
Join Date: Aug 2009
Posts: 8
|
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.
|
#12 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
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. |
#13 |
Junior Member
Join Date: Aug 2009
Posts: 4
|
What eval script would use for the AC bonus you get with the ninja class?
|
#14 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
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.
|
#15 |
Junior Member
Join Date: Aug 2009
Posts: 4
|
already tried that nothing came up for the ac bonus
|
#16 |
Junior Member
Join Date: Aug 2009
Posts: 4
|
any other ideas
|
#17 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
You'll have to be more specific about how you implemented your AC bonus; what does your script say? What timing does it use?
|
#18 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
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? |
#19 |
Junior Member
Join Date: Aug 2009
Posts: 4
|
thats what i need to know how to set up a script
|
#20 |
|
|