• 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

Getting weapon damage type

Mergon

Well-known member
Ok, I'm tidying up my .user file for the Unearthed Arcana: Mystic class v2. What I have works, but its a bit kludgy, so I decided to tidy up my scripts with what I now know.

One of the Class Specials adds damage to the weapon damage of the same type as the weapon does.

This is there script I am using:
Phase: Final Phase, Priority: 10000

doneif (tagis[Helper.ShowSpec] = 0)

doneif (tagis[Helper.Disable] <> 0)

~ If not active, get out.
doneif (field[abilActive].value = 0)

doneif (field[usrChosen1].ischosen = 0)
~ doneif (field[pChosen].ischosen = 0)

var iDice as number
var sDice as string
var sDmgType as string
iDice = field[actUser].value
sDmgType = field[usrChosen1].chosen.field[wDmgType].text
sDice = signed(iDice) & "d10 " & sDmgType

#extradamage[field[usrChosen1].chosen,sDice,field[name].text]

Everything functions properly except for gettign the weaon's damage type.

sDmgType = field[usrChosen1].chosen.field[wDmgType].text
is supposed to get the damage type from the selected weapon. Unfortunately, I am getting no damage type text . . .

Any ideas what I am doing wrong? :confused:
 
If you can see Text in that field in debug (i.e. NOT final text) then my guess would be timing. Your script is running before a value is put into that field. Try increasing your timing to later.

NOTE: If the value you wish is only in the Final Text part of the field you can NOT get at it with a script. :(
 
Bah, humbug. It is only in the Final text section. :(

Any clues on how I can access the damage type text? I'll be taking a look at your adjustments again tomorrow to see if you've done anythign similar . . .

Thx for the reply
 
Bah, humbug. It is only in the Final text section. :(

Any clues on how I can access the damage type text? I'll be taking a look at your adjustments again tomorrow to see if you've done anythign similar . . .

Thx for the reply
So yeah LW really needs to stop using Final scripts for stuff like this. Its not helpful at all. :(

But you can get around it the same way they are filling the damage final text. Its called "tagnames[]".

Code:
var sDice as string
sDice = signed(field[actUser].value) & "d10 " & field[usrChosen1].chosen.tagnames[DamageType.?]
Thats your multiple lines of code and variables all done in one line using Tagnames.

Now then with tagnames[] if you know you can have multiple tags you need to tell it how to separate the words. Lets say something does Slashing/Piercing damage.
Code:
field[usrChosen1].chosen.tagnames[DamageType.?," and "]

Would get you a result of "Slashing and Piercing".

For way more examples I recommend searching for tagnames[] in the community Pathfinder Repository.

Of course to find all such functions the HL Wiki HERE is your best friend. :)
 
Back
Top