Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - D&D 5th Edition SRD
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Mergon
Senior Member
 
Join Date: Sep 2012
Location: Ottawa, Canada
Posts: 788

Old June 25th, 2016, 11:41 AM
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

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

Quote:
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?

Watch your back, Conserve your ammo,
and NEVER cut a deal with a dragon!
Mergon is offline   #1 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old June 25th, 2016, 01:35 PM
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.

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #2 Reply With Quote
Mergon
Senior Member
 
Join Date: Sep 2012
Location: Ottawa, Canada
Posts: 788

Old June 25th, 2016, 08:12 PM
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

Watch your back, Conserve your ammo,
and NEVER cut a deal with a dragon!
Mergon is offline   #3 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old June 26th, 2016, 10:13 AM
Quote:
Originally Posted by Mergon View Post
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.

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #4 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 10:22 AM.


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