• 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

Scripting Question

Mergon

Well-known member
I am pretty sure I've done this before, but for the life of me I can't remember how.

I am trying to set up an Adjustment that allows you to select a DamageRes from a drop down in an Adjustment, then use a perform hero.assign[DamageRes.xxx] where xxx is the chosen damage type.

For the life of me I can't get a DamageRes or a DamageType to be selected from an Adjustment . . .

Any ideas? Or am I wrong in thinking this is possible from an Adjustment?

:confused::confused::confused:
 
You mean like on the adjustment menu you have your custom expression like

component.DamageType
or
component.DamageType & (DamageRes.dtCold|DamageRes.dtFire|DamageRes.dtLightnin|DamageRes.dtPoison)

and your script looks something like this

first/100
Code:
~ If we're disabled, do nothing & 
doneif (field[pIsOn].value = 0)
~ If nothing chosen then get out now!
doneif (field[pChosen].ischosen = 0)

perform field[pChosen].chosen.pulltags[DamageRes.?]
perform hero.pushtags[DamageRes.?]

Yeah, I think I learned that from a convo between you and Shadow...
 
Last edited:
I knew there was a way. For the life of me I couldn't remember it and I couldn't find where I had done it before.

Thanks.

I'm just builing a bunch of spell adjastments for myself like mage Armor, Shield, Absorb Elements, etc.
 
Well, I finally got around to trying out the scripting you presented and I have similar issues to what I was already having.

component.DamageType & (DamageRes.dtCold|DamageRes.dtFire|DamageRes.dtLig htnin|DamageRes.dtPoison)

That gives my a list of everything, probably includign what I want if I could find it. :)

component.DamageType

This me no options at all.

I also tried: component.DamageRes and got nothing.

When you have a moment or two, could you try create an Adjustment and see what you get. Maybe my HL is messed up . . .
 
Interesting, I just tried putting together a quick adjustment with the Custom Expression of

Code:
component.DamageType & (DamageRes.dtCold|DamageRes.dtFire|DamageRes.dtLightnin|DamageRes.dtPoison)

With a Restriction to "All Things", and I get a pull down of of Cold, Fire, Lightning, and Poison.

Hope this helps....

- Bob
 
Selecting all things from the drop down worked. LW must have made a change. I don't remember ever having to select that before . . .

I could be wrong though.

I used the following for Absorb Elements:

component.DamageType & (DamageRes.dtAcid | DamageRes.dtCold | DamageRes.dtFire | DamageRes.dtLightnin | DamageRes.dtThunder)
 
Anyone following this conversation, free tip, you can get the Combined Damage types (like bludgeoning, piercing or slashing from nonmagical weapons) via component.DamComType

and your push/pull tags are

DamComRes.?
for resistance

DamComImm.?
for immunity

my personal catch-all damage resistance adjustment goes like this:

Custom Expression: (component.DamageType | component.DamComType)
Restrict First List to: All Things

My code, which I run at first/100 but can be run anywhere early:

Code:
~ If we're disabled, do nothing & 
doneif (field[pIsOn].value = 0)
~ If nothing chosen then get out now!
doneif (field[pChosen].ischosen = 0)

perform field[pChosen].chosen.pulltags[DamageRes.?]
perform field[pChosen].chosen.pulltags[DamComRes.?]
perform hero.pushtags[DamageRes.?]
perform hero.pushtags[DamComRes.?]

I have another adjustment for immunity that is almost exactly the same, just uses the DamageImm.? and DamComImm.? tags.
 
Back
Top