• 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

Script question

Looking at the Mathematical Prodigy trait I see this:

#applybonus[BonTrait,hero.childfound[skKnowArca],1]
#applybonus[BonTrait,hero.childfound[skKnowEng],1]

perform field[usrChosen1].chosen.assign[Helper.ClassSkill]

I understand lines 1 and 2 give the +1 bonus to the two knowledge skills. But could someone please break down line 4 for me so I can understand what each thing does?
Its performing an action to assign the Helper.ClassSkill tag to the User Chosen Skill that was selected from the Drop Down box. On the trait Thing their is a section called Custom Expression that lists what Things will show up in the drop down box. So that last line is saying what ever skill is chosen by the user is to get the Helper.ClassSkill tag.

Also, I'm trying to create a script for an ability that lasts 1 round per 2 cleric levels. This is what I have, but it doesn't work. Can someone tell me why?

field[abSumm].text = "Inflicts a -2 penalty to attacks, skills and saving throws for " & (hero.child[cHelpClr].field[cCleric].value)/2 & " rounds."

I also want to say thanks again to everyone for all of your help.
HL uses a scripting language and not a HLL(High Level Language) so sometimes you have to take things in smaller steps for it. use the following code instead:
Code:
var Dur as number
Dur = round(hero.child[cHelpClr].field[cCleric].value/2,0,-1)
field[abSumm].text = "Inflicts a -2 penalty to attacks, skills and saving throws for " & Dur  & " rounds."

So first do the calculation then combine the numeric number into the string.

Hope that helps.
 
I apologize, I didn't read my examples carefully enough, and they aren't actually good examples of what I was trying to point you to.

Here's the script for the trait "Lost Love (Orphaned)" (from the Curse of the Crimson Throne adventure path):

Code:
      ~get out if we haven't selected anything yet
      doneif (field[usrChosen1].ischosen = 0)
 
      ~add to our chosen skill
      field[usrChosen1].chosen.field[Bonus].value += 2

So, instead, make a copy of the "Lost Love (Orphan)" and "Drug Addict (Friend)" traits, and see how they handle designating which skills to select.
 
Okay, let's go with the Monk version.

Here's an Eval Script for that:

Phase: First, Priority: 510
Code:
perform hero.assign[TypeAndAug.tpDragon]

You'll add the sleep and paralysis immunities, the darkvision and low-light vision and the skill bonus from the feat, since it's adding only some of the Dragon type's effects.

I have a related question. I have a template that can be applied to an animal, a humanoid, or a magical beast. When applied to an animal, it changes the type to magical beast without recalculating effects (the animal "is treated as a magical beast, though no changes to its statistics are made").

I tried:
Phase: First, Priority: 510
Code:
if (#hastype[tpAnimal] <> 0) then
    perform hero.assign[TypeNoEff.tpMagBeast]
endif

However the condition is never true (it works if I do it unconditionally). Moving the check to a later phase doesn't work (the type doesn't change even if I do it unconditionally). What's the right way to do this?
 
The tag that #hastype[] is looking for is assigned in the same script that checks to see whether there's a TypeNoEff tag, so you can't look up one in order to decide whether or not to use the other.

I'd duplicate the template - one for animals, the other for humanoids and magical beasts (the same way the Advanced Creature template has to be split).
 
I'd duplicate the template - one for animals, the other for humanoids and magical beasts (the same way the Advanced Creature template has to be split).

I currently do have two templates, but was hoping to be able to combine them. Thanks for confirming this is not possible.
 
Back
Top