Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - D&D 5th Edition SRD (http://forums.wolflair.com/forumdisplay.php?f=89)
-   -   Scripting Question (http://forums.wolflair.com/showthread.php?t=60219)

Mergon February 20th, 2018 07:35 AM

Scripting Question
 
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:

dungeonguru February 20th, 2018 10:48 AM

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

component.DamageType
or
component.DamageType & (DamageRes.dtCold|DamageRes.dtFire|DamageRes.dtLig htnin|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...

Mergon February 20th, 2018 10:50 AM

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.

Mergon February 21st, 2018 07:41 AM

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 . . .

BobStumpp February 21st, 2018 10:37 AM

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

Mergon February 21st, 2018 10:48 AM

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:

Quote:

component.DamageType & (DamageRes.dtAcid | DamageRes.dtCold | DamageRes.dtFire | DamageRes.dtLightnin | DamageRes.dtThunder)

dungeonguru February 21st, 2018 04:13 PM

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.

ShadowChemosh February 21st, 2018 08:16 PM

@dungeonguru good info! :)


All times are GMT -8. The time now is 07:09 AM.

Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.