• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Data Files Authoring questions

it's hero.delete[].

In the start menu, HeroLab folder, HeroLab Authoring Kit.html - open that, scroll down to "Scripting Basics" - that's where all the arithmetic stuff is. "Script Data Access" is where hero.assign[] and hero.delete[] are.
 
Lawful_g wrote:
>
>
> Here are another two questions.
>
> I am adding a feat called Shield Focus, which boosts the shield bonus
> you get from weilding a shield by 1. How would I script "If you have a
> shield equiped, add +1 shield bonus"? There is also a similar feat
> called Heavy Armor Optimization, which only works with Heavy Armors,
> obviously, and I am not sure how to specify the type of Armor.


I think you already have it working, but another way to do it would be
the following script on the feat at about First/10000:

foreach pick in hero where "mClass.Shield | mClass.Tower"
each.field[mAC].value += 1
nexteach

You can make it work for other types of armor by using mClass.Light,
mClass.Heavy, etc.


> A second issue, I am trying to make a custom staff (The Blue Crystal
> Staff of Mishakal) but I can't figure it out. I copied other staffs and
> they have bootstraps to things called Charges, one for each spell they
> cast. I can't find how to make custom charges to bootstrap to my new
> staff. I seem to remember there being a "charges" tab in the editor a
> few updates ago, but I don't see it anymore. Is there currently a way to
> make charges and therefore staffs at this time?

Charges are now just part of "Specials". Go to the special tab and add
the charge you want, then mark it "Show in Charges List" and set the
appropriate number of total charges. You should then be able to
bootstrap it from the staff and have it work appropriately.



Also, thanks to the other authors who were helping get stuff working! I
appreciate you guys taking up the slack when I'm occupied or out of the
office. :)



--
Colen McAlister, colen@wolflair.com
Chief Engineer, Lone Wolf Development
 
Lawful_g wrote:

>> Also, I set up each custom ability of my class to be only available to
>> certain alignments by setting a pre-requisite... However in the window
>> to select the abilities all are available, not just the ones that the
>> character's prerequisites qualify him for. If you select an ability that
>> you don't qualify for there is a validation error, but is there a way to
>> gray out the abilities you don't qualify for or otherwise make some sort
>> of warning? I notice the Loremaster secrets have req warning messages...
>> can't figure that out for my own ability though.
>
> Has this been fixed in 1.3? I was juct going through my old class and I
> noticed the pre-requisite messages are still not showing. The reason I
> stumbled upon this is because I am trying to code an ability called
> Magic of Hunger. It allows a wizard to memorize one extra spell of any
> level they can cast, but on any day they do so they take 1 point of
> temporary Con damage.


Unfortunately it hasn't been fixed in 1.3. There are a few important d20
bugs that need to be fixed, so I'll try and get it included with the
next release of stuff when I fix those. Sorry!


> What I was thinking of doind, although I am not sure it is possible, is
> set up some sort of script in the custom ability that says "ignore the
> first validation error coming from the selection of too many spells on
> the wizard panel." and then "If the validation error is being ignored,
> apply -1 temporary damage to Con". Is there any way to script the
> ignoring of a validation error from a specific source? if not, how do
> you suggest I impletment the ability?


Wow, that ability is just wacky. :)

Honestly, the easiest way to do this would probably be to use
adjustments. If the character wants to memorize an extra level 5 spell,
add an adjustment allowing the +1 level 5 spells, and then add a second
-1 constitution adjustment.


I'll think about how to come up with a good script solution for this...


--
Colen McAlister, colen@wolflair.com
Chief Engineer, Lone Wolf Development
 
Lawful_g wrote:
>
>
> Now another question, how do you replace one tag with another? I am
> adding an ability that negates encumberance, and the script I am trying is :
>
> var result as number
> if (hero.tagis[Encumbered.Medium] = 0) then
> result = hero.assign[Encumbered.Light]
> elseif (hero.tagis[Encumbered.Heavy] = 0) then
> result = hero.assign[Encumbered.Light]


I think you're doing basically the right thing, but you also need to use
"hero.delete" to remove the Encumbered.Medium or Encumbered.Heavy tags
as some other posters have suggested.


> An alternate method may be to fiddle with the encumberance table and set
> the Light encumberance for the hero to some insanely high weight, or if
> there is a way to override the max Dex bonus to AC due to encumberance
> that is also peachy. Again, don't know how to do either of these things.


That's an interesting idea. I'll add it to the list...


--
Colen McAlister, colen@wolflair.com
Chief Engineer, Lone Wolf Development
 
Another question. I am adding a race that has a variable ability, called single minded, basically they get to pick one skill at creation that they gain a +2 racial bonus to and that becomes a class skill for all subsequent classes.

How would a set up a selection when choosing the race, so that I don't have to re-make the class once for each skill?
 
I'm having trouble getting the skill selection from a menu to use in a later script. I copied the skill focus as a start, and what I want to do is make the selected skill a class skill for all classes. This is the script I am trying.

Phase: UserFirst Priority: 10000 Index: 2
var skill as number
skill = field[fChosen].value
var result as number
result = hero.assign[ClassSkill.skill]

I get an error message that says "Attempt to access a field 'fChosen' defines wih an incompatible style. Expected 'Normal' "... I am not sure what that means.
 
Wow, thanks, that is just about exactly what I was trying to do. Now a second question, about a related ability. The other subrace of this people gain an ability called "Jack of all trades, which makes all skills class skills for all classes, but limits the maximum ranks taken in any skill as though they were cross class (level + 3 then divided by 2). Is there a way to script such a cap on skill ranks taken?
 
Ummm...wouldn't it be easiest to make all skills cross-class, then? 'If feat taken, all skills are cross-class' sort of thing? I'm at work(sshhhh, don't tell anyone) so I don't have HL available to check how to, but it would seem that way to me...
 
If I made them all cross class skills, then they would cost 2 skill points per rank, which is not what I am going for. The point of the ability is to buy any skills you want, but not be able to put many ranks in any of them. Jack of all trades, master of none, as they say.
 
Lawful_g wrote:
>
>
> Wow, thanks, that is just about exactly what I was trying to do. Now a
> second question, about a related ability. The other subrace of this
> people gain an ability called "Jack of all trades, which makes all
> skills class skills for all classes, but limits the maximum ranks taken
> in any skill as though they were cross class (level + 3 then divided by
> 2). Is there a way to script such a cap on skill ranks taken?


Ah, I like the hard ones ;)

So there are two things that need to be done here:

1) Make all skills class skills

2) Enforce a maximum rank limit on each skill

We'll tackle 1) first, since we obey the laws of numbers on these forums.


Each skill has a tag that indicates to the hero that it's a class skill.
So we need to iterate through all skills, and tell them to forward their
tags to the hero.

------
~ Loop through all skills
var result as number
foreach pick in hero where "component.BaseSkill"

~ Tell each skill to forward its class skill tag to the hero
result = each.forward[ClassSkill.?]
nexteach
------

Do this during the First phase and voila, each skill is now a class skill.


Now we need to enforce a maximum rank limit on each skill. To do this,
we'll add an "eval rule" to the ability. We can't directly set the
maximum rank of the skills themselves, but we can cause an error if any
of them go too high.

Add an eval rule with the message "Skill rank too high", any time during
the Validation phase. The rule should loop through all the skills,
making sure that each of them abides by some sort of limit. If it finds
one that has more ranks than the limit, it sets the error message
appropriately and ends.

-------
~ Loop through all skills
var result as number
foreach pick in hero where "component.BaseSkill"

~ If this skill has more than 5 ranks, that's a problem
if (each.field[kUserRanks].value > 5) then

~ Change the error message to refer to this skill
@message = "Skill " & each.field[name].text & " has too many ranks!"

~ We've found an invalid skill, so we don't need to go on.
done
endif

nexteach
-------


Those should do the trick for you.


--
Colen McAlister, colen@wolflair.com
Chief Engineer, Lone Wolf Development
 
Back
Top