PDA

View Full Version : Help in understanding HL Coding


Theocrat
May 15th, 2010, 10:31 PM
Hi all -
I've posted in various other threads requests for help and understanding - hoping to understand this program. So far, I've spent the 2 weeks of owning HL frustrated and unhappy. I just want to be able to easily add feats, gear, magic items and general things from Seeker of Secrets for use with my character. Because I'm attempting to work on Boon Companion before creating my characters in HL, I haven't even created a character in the program yet.

I've said before in other threads, I want to help - by adding in the content of the Pathfinder Chronicles and other source books, but doing so correctly. But the tutorial isn't all that informative on some of the harder aspects, and waiting around for someone else to code the material just seems like a waste of time. Time that I'm willing to spend with HL to learn that application. But without the proper tools out there - I feel I have to ask multiple times to attempt to understand how to do what I want to do. I don't understand what the different buttons on the left side of the panel mean or do.
When I see other posts in help with getting a feat or other individual aspect of the mechanics work, I have no clue as to why or how they got that information, or how I could begin to find out how they go that information (again, the tutorial isn't in-depth enough for a newbie to programing for this program).
So I've asked for help - either I'll do just the main data entry and someone help with the coding or I'll do all of it if I can find someone to guide me on the coding. I'll try to learn it on my own - but with that, I'm frustrated in that I've spent $50 on the program and haven't really used it (because I haven't created anything that is substantial or helps me with making my character).

Any help? I want to code Seeker of Secrets (except all those ion stones [at least for now]). I'm stuck with Boon Companion. I believe that I've done the gear and spells correctly, as that seems pretty straight forward. But with Boon Companion adding +4 to your level for an Animal Companion, I'm unsure of how to facilitate this. Same with the two other feats.
After Boon Companion is corrected, I do want to add in the Rat looking creature from Kingmaker 1 and do so correctly. Anybody willing to spend a little bit pointing me in right directions?

Thanks in advance for any future helpful discussion.
Theocrat Issak

Mathias
May 17th, 2010, 09:06 AM
Boon Companion:

After you've set up the basics of the feat (name, unique Id, description, summary), go into the options for the feat, and in the Item Selection section, the first option is "Select From" - choose "Classes" from that list.

Now, press the "Eval Script" button on the top right, and "Click to add another Eval Script".

Leave the phase as "First", change the priority to "497", and copy and paste this script into the window:


~if the user hasn't selected a class to apply this feat to,
~there's nothing more we can do, so just get out
doneif (field[usrChosen1].ischosen = 0)

~we'll figure out the total number of hit dice our character has

~start with our class levels
field[abValue].value += #totallevelcount[]

~at First/497, only class HD have been added to #totallevelcount[]
~so, we'll have to look up the racial HD, additional HD,
~and template HD

~add in racial HD
field[abValue].value += hero.findchild[BaseRace].field[rHitDice].value

~HD from additional HD things
foreach pick in hero from BaseHitDie where "thingid.cBonusHD"
field[abValue].value += 1
nexteach

~and HD from templates
foreach pick in hero from BaseTempl
field[abValue].value += eachpick.field[tmHitDice].value
nexteach

~now that we have our total HD, retrieve the current level
~from the class the user has selected, and subtract
~that from the total
field[abValue].value -= field[usrChosen1].chosen.field[cTotalLev].value

~we don't want to add more than 4 levels from this feat, so cap our
~value at 4
field[abValue].value = minimum(field[abValue].value, 4)

~now, apply the adjustment to the companion
hero.childfound[cAnimClass].field[CompClAdj].value += field[abValue].value


I'm sorry for not taking you through the script step-by-step (other than the commenting in the code), but as you can see, it's very complex.

Please don't judge the editor by one of the most involved concepts in the Pathfinder files - animal companions. The animal companion's effective level needs to be set unusually early in the files, because the number of HD, the templates, and the special abilities that the companion gets all depend on that value. That means that unusual timings are needed, and that sometimes requires odd ways of retrieving information.

Theocrat
May 18th, 2010, 09:22 PM
Thanks, that seems to work!
Awesome. I see that animal companion is difficult. What about the two other feats - or some other feat that is harder than normal, but that isn't as difficult as one that revolves animal companions?
How do I even begin to understand what those buttons are and do? Is there a book I can buy that will begin to teach me?

rob
May 18th, 2010, 09:38 PM
You'll find all the basic concepts and terms defined in the HL Authoring Kit wiki. The wiki is freely available, although it's not nearly as visible as it probably should be (we'll change this in the next update).

You can find the wiki by loading the Editor documentation for Pathfinder and scrolling to the bottom. There is a link there. I'll also provide a direct link here:
http://hlkitwiki.wolflair.com

You can probably limit your reading to the main page and then section on Basic Concepts and Terminology. In fact, there are parts of that section that you won't even need. So start there and a great deal of your questions will be answered. Then you'll have a reasonable idea of what's going on and you'll be well on your way towards implementing lots of the things you're looking to add. :-)

Mathias
May 19th, 2010, 12:35 PM
For your other feats - could you please summarize them? I don't have a copy of Seeker of Secrets immediately available.

Also, could you lay out what parts of those feats you can figure out, and what parts you can't - I find that the process of explaining a problem I've encountered - having to lay out what's going wrong and what I've tried, is very helpful to me in figuring out the problem I've encountered.

Theocrat
May 19th, 2010, 09:27 PM
Dilettante - What some would call dabbling you call a wide range of interests. Your breath of knowledge offers unexpected insights in many situations.
Prerequisites: 2 ranks each in 5 different Knowledge skills.
Benefit: You gain a +2 bonus on Knowledge checks if you have 1-5 ranks in that skill. This bonus does not stack with Skill Focus. You can make untrained Knowledge checks with DC's up to 15.
Normal: You may only make untrained Knolwedge checks for common knowledge (DC 10 or lower).
----
Friendly Switch
You elbow an ally out of the way, and take his palce on the battlefield.
Prerequisites: Base Attack Bonus +1
Benefit: As part of your movement or as a 5-foot-step, you can move into the space occupied by an ally of your size or smaller, which displaces the ally into the space you just left. Your ally must be willing and able to move and to occupy the space you were in. This movement does not provoke attacks of opportunity. This does not count toward your ally's movement on this next turn.

-----
I saw somewhere that there was a similar design on a feat to Friendly Switch, - but I don't know for sure.
What I mean for I know some things - I can do the basic data entry and a few things (I think) with the pre-req's and even the category! But now I'm going to be reviewing the Authoring Kit Wiki. I just don't think I'll get as far as I'd like.
I'll keep doing the data entry and hope to get the codes right and ask for the codes that I don't know. Since I'm working slowly, and with the smaller aspects, I hope i'll get the help I need.
Theocrat Issak.

Mathias
May 20th, 2010, 09:57 AM
Friendly switch is text-only, it won't require any coding except for BAB +1, and there are lots of feats that you can look up for a pre-req of BAB+X (like exotic weapon proficiency).

Here's how to build the pre-req for Dillettante:

In the editor, make a copy of one of the +2 to each of 2 skills, like Acrobatic.

Here's how Acrobatic figures out whether or not to grant +2 or +4 to the Acrobatics skill:

#skillbonus[skAcrobat] += 2
if (#skillranks[skAcrobat] >= 10) then
#skillbonus[skAcrobat] += 2
endif

Now you know how to check the number of ranks the skill has, and how to apply a generic bonus.

Next, you'll need to know what distinguishes a knowledge skill from other skills. So, in the develop menu, make sure "Enable Data File Debugging" is enabled (it's the first thing in the menu). Now, add a knowledge skill or two to a character, and right-click on that skill and another skill that isn't a knowledge skill. For each, select "Show Debug Tags for XXX".

You'll find that Knowledge skills have the tag Helper.SkCatKnow.

Also, while you're looking at those tags, find a component tag that's specific to skills - component.BaseSkill.

Now, we'll build the pre-req for the feat:



var skillcount as number

~search through all the skills that are knowledge skills
foreach pick in hero from BaseSkill where "Helper.SkCatKnow"

~every time we find a skill that has at least 2 ranks, increment our count
if (#skillranks >= 2) then
skillcount += 1
endif
nexteach

~if we counted at least 5 skills with 2 ranks, we're good
validif (skillcount >= 5)


Now for the script.

First, you'll need to know how to avoid adding bonuses to skills that skill focus has already added to, since they don't stack.

Make a copy of Skill Focus in the editor. You'll find the following lines among the code:


~ Assign a tag so we know we've taken skill focus
perform focus.assign[Helper.SkillFocus]


You'll also want to note that Skill Focus's script runs at Pre-Levels/5000, so your feat should run shortly after that, so it can make sure not to stack with skill focus, but still get the bonus in place before anything else can look up the skill total.

You'll also want to look at how skill focus checks for the presence of 10 ranks - we'll be modifying that for our script:
if (focus.field[skUser].value + focus.field[skInnate].value >= 10) then

Now, for the Eval Script for the feat. Timing: Pre-Levels/5500


~search through all the skills which are knowledge skills
foreach pick in hero from BaseSkill where "Helper.SkCatKnow"
~only apply the bonus if we DON'T have skill focus on this skill
if (eachpick.tagis[Helper.SkillFocus] = 0) then
~only apply the bonus if we have less than 5 ranks on the skill
if (eachpick.field[skUser].value + eachpick.field[skInnate].value <= 5) then
eachpick.field[Bonus].value += 2
endif
endif
nexteach


Since this was within a foreach search, I couldn't use the #skillranks[] or #skillbonus[] macros, so I used the script on Skill Focus to tell me what code those macros replace, which is why it's looking at field[skUser].value + field[skInnate].value and adding the bonus to field[Bonus].value.

neurotopia
September 6th, 2010, 11:20 AM
sorry if this is the wrong place to ask (the thread title just seemed very appropriate), could someone refer me to a more comprehensive list of skill picks? i know there is a list in the authoring folder, but it's not very long. i am specifically looking for a way to apply a skill bonus to all untrained skills (as per the artificer exemplar ability). should i use an if/then approach, or is there another way? any help is greatly appreciated. and once i have the artificer class finished, i will upload it to the repository for others. my disclaimer, however, is that i've only been working with this program a couple days so i can't promise epic success.

Mathias
September 6th, 2010, 11:39 AM
While you're writing a script, press the "Find Thing" button on the top right of the window. Change the top drop-down to "Skills", then select the skill you're interested in - HL will add its Unique Id to wherever your cursor had been in your script.

Mathias
September 6th, 2010, 12:01 PM
Here's how to find all the untrained skills:

In the main HL window, create a new character. Add some race or another that has racial HD, and pre-selects where those skill points go. Next, add a headband that increases INT on the magic tab, and select some skill to apply its bonus to. Finally, add a few skill points to one of your skills. You've now covered all the ways a skill could receive ranks.

Now, go to the develop menu within HL. Make sure the first option, "Enable Data File Debugging" is checked.

Go to the skills tab. Right-click on many skills, selecting "Show Debug Tags for XXX" and then "Show Debug Fields for XXX" for each.

Study those lists of tags and fields that you have. Compare them - figure out how those ranks are stored within HL. On the tag lists, note that HL applies the Helper.HasRanks tag if any ranks are present.

I'm afraid this is a case where you'd need to ask me about the timing - when in the priority sequence to execute your script.

Unfortunately, Helper.HasRanks is assigned in the same script that totals all the ranks, adds the armor check penalty, adds the class skill bonus, and folds all the generic bonuses into the total. So, you won't actually be able to use Helper.HasRanks as a way to quickly find these skills - by the time HL has assigned it, its too late to add a Bonus and have it reflected in the final total.

So, we'll just check all of the rank fields individually.

Phase: Post-Attributes, Priority: 10000

We'll start by seaching skill-by-skill through all of them:

foreach pick in hero from BaseSkill


Then, for each one, see if the total number of ranks is zero:

if (eachpick.field[skUser].value + eachpick.field[skInnate].value + eachpick.field[skExtRanks].value = 0) then


If that's true, we'll do something (you didn't say exactly what you wanted done, so this example adds a +2 generic bonus):
eachpick.field[Bonus].value += 2

Then close the if-then and the foreach:


endif
nexteach


Assembling all that for easier copying, and adding the standard tests for any class ability:
Phase: Post-Attributes, Priority: 10000


~ If we're not shown yet, just get out now
doneif (tagis[Helper.ShowSpec] = 0)

foreach pick in hero from BaseSkill
if (eachpick.field[skUser].value + eachpick.field[skInnate].value + eachpick.field[skExtRanks].value = 0) then
eachpick.field[Bonus].value += 2
endif
nexteach


Next time, feel free to start a new thread for this sort of thing - titles that say what question they're asking, rather than generic "coding" make it easier to locate them in the future, or for the next person to find them.

neurotopia
September 6th, 2010, 01:44 PM
wow, that was fast! thanks man. okeydoke. i thought i might have to do something along those lines, but wasn't sure. i found the AllCraft pick for adjusting all craft skills (i.e. elbow grease) so i just wanted to check if there was a larger category pick for untrained skills.

and while i have your help, i'm having some difficulty getting the effects of items to take effect when activated. for instance:

my level 1 artificer has modified a buckler with "inertia dampeners" (my steampunk name for a level 1 shield spell). i got the shield set up so it gives me the correct AC adjustment when equipped and the buckler shows up with a checkbox on my in-play tab (as i want to be able to activate my weird science item abilities from that tab). i also made sure to add spShield1 to the gizmo bootstrap with tag groupid: chargeuse, tagid: 1 so i could keep track of the number of times i used the item (manually resetting each day). like i said, i've only been using the program a couple days and apologize if this stuff is obvious (though i have made it a point to read through the documentation and tutorials) and/or my questions don't make much sense.

thanks!!! and btw, figuring this stuff out is fun!

neurotopia
September 6th, 2010, 05:53 PM
mathias, just started looking at the debug info! GREAT STUFF!!! thanks!

neurotopia
September 6th, 2010, 08:46 PM
ooops... nevermind. just realized i should have posted my question in a new thread. :-)

Mathias
September 7th, 2010, 09:37 AM
The ChargeUse (you were careful about capitalization when programming, right?) mechanism only functions on staves, I believe.

There's no reason to add a separate spell to handle the effects. You can handle it all in the shield.

Phase: Pre-Levels, Priority: 10000
Start by checking if the shield is equipped, then make sure it's activated:

if (field[gIsEquip].value <> 0) then
if (field[abilActive].value <> 0) then


Now, apply a shield bonus of +4 to AC (remember, shield bonuses don't stack, so you'll use the #applybonus macro to handle that):

#applybonus[tACShield, hero.child[ArmorClass], 4]
endif
endif

neurotopia
September 7th, 2010, 12:59 PM
ah, ok. what i was doing today was very close to that, so i think im starting to be able to make sense of things.

and yeah, i apologize. i should have blocked the text in code and posted it correctly. i do quite of bit of LAMP server maintenance and development so i'm usually pretty careful about capitalization. i was just being lazy.

again, thanks so much, mathias. you rock! between what i'm able to pull together in tutorials, wikis, and your posts, i should be set!!!!