• 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

Loop

Frodie

Well-known member
Need help with a look. IDK what it need to look through. I am trying to get it to look through all spell like abilities and find a custom tag. I was trying to use AbilType.SpellLike, but that is not it. Any ideas?

Thank you


Post levels 10000

if (field[abilActive].value <> 0) then
var div_ranks as number

div_ranks = #skillranks[skSpellcr]

field[abValue].value += round(div_ranks/2,0,-1)

~ Loop through all SpellLike
foreach pick in hero from AbilType.SpellLike where "Custom.Spellcrafter"
~ increase caster level
eachpick.field[abDC].value += field[abValue].value
nexteach
endif
 
Never mind, I found it. Thank you.


post levels 10000

if (field[abilActive].value <> 0) then
var div_ranks as number

div_ranks = #skillranks[skSpellcr]

field[abValue].value += round(div_ranks/2,0,-1)
var searchexpr as string
searchexpr = "!component.BaseFeat & (AbilType.SpellLike)"
foreach pick in hero from Ability where searchexpr
~ increase caster level
eachpick.field[abDC].value += field[abValue].value
nexteach
endif
 
Never mind, I found it. Thank you.


post levels 10000

if (field[abilActive].value <> 0) then
var div_ranks as number

div_ranks = #skillranks[skSpellcr]

field[abValue].value += round(div_ranks/2,0,-1)
var searchexpr as string
searchexpr = "!component.BaseFeat & (AbilType.SpellLike)"
foreach pick in hero from Ability where searchexpr
~ increase caster level
eachpick.field[abDC].value += field[abValue].value
nexteach
endif
Shorter is always a little better. Allot of those steps could be combined together like so:

Code:
~ If not active get out now
doneif (field[abilActive].value <> 1)
  
~ Our bonus is equal to half our spell craft ranks
field[abValue].value += round(hero.child[skSpellcr].field[Ranks].value/2,0,-1)
~ Loop though all the Spell-Like Abilities to increase their DC value
foreach pick in hero from Ability where "!component.BaseFeat & (AbilType.SpellLike)"
   ~ increase DC
   eachpick.field[abDC].value += field[abValue].value
nexteach

You sure you need to say "!component.BaseFeat"? I am pretty sure that Ability Picks do not include feats. So really you just should be able to say "Abiltype.SpellLike".
 
Just to explain to other curious folk who might need things a little more clearly explained. Every type of thing in HL is defined by it's compset.

For example, Feats are things with the "Feat" compset. A compset is, as the name implies, a set of components.

Components are what define fields, and can have eval scripts that run on everything with that component. This is useful because you only have to have an eval script set up once on the component, and it can run on many different types of things (since it can be part of many different compsets). You can tell which things have which components by looking at the "component" tags on a particular pick.

Well, looking closer, it seems I misspoke. The Ability Component defines such fields as "abDC" and "abSumm" (the various abValue fields are defined in the "Value" component instead). I should have said "Actually, feats do have the Ability component. Otherwise they wouldn't have abDC fields."

So in this case, the "Ability" component defines the abDC and other fields, and that component is used in many different compsets (for example, Feats, Traits, Racial Abilities, Class Abilities, Custom Special Abilities, among others).
 
Back
Top