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 March 24th, 2016, 03:59 PM
Ok, on an adjustment I have it set up on pChosen2 to selected a Damage Resistance from the drop down. No problem. But how do you get the name of the selected item?

I've tried the following:
field[pChosen2].chosen.field[livename].text
field[pChosen2].chosen.field[thingname].text

Is there way to get the name off the DamageRes.? where the ? is the element selected (i.e.; dtFire would give Fire)?

The adjustment I'm trying to create is on a cantrip Makeshift Wand. This cantrip turns a small, 1-handed , holdable item into a wand. The item can then fire a single bolt of elemental damage based on the choice you have made.

Basically the item's livename should look something like this:

Makeshift wand (2d6 fire damage).

What I keep getting is:

Makeshift wand (2d6 ???? damage).

Eval script Render, Priority: 10000

Quote:
~ If we're not enabled, get out now
doneif (field[pIsOn].value = 0)
~ If nothing's been chosen, get out now
doneif (field[pChosen].ischosen = 0)
~ If nothing's been chosen, get out now
doneif (field[pChosen2].ischosen = 0)

var iHD as number
var iDice as number
var sText as string
var sElement as string
iHD = #totallevelcount[]

if (iHD >= 17) then
iDice = 4
elseif (iHD >= 11) then
iDice = 3
elseif (iHD >= 5) then
iDice = 2
else
iDice = 1
endif

sElement = field[pChosen2].chosen.field[thingname].text
~sElement = right (sElement, length (sElement)-2)

sText = iDice & "d8 " & sElement & " damage."

field[pChosen].chosen.field[DescAppend].text = sText

field[pChosen].chosen.field[livename].text = "Makeshift wand (" & field[pChosen].chosen.field[thingname].text & ", " & sText & ")"

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 March 24th, 2016, 04:44 PM
Quote:
Originally Posted by Mergon View Post
I've tried the following:
field[pChosen2].chosen.field[livename].text
field[pChosen2].chosen.field[thingname].text
As they are Things you may need to use field[name].text


Quote:
Originally Posted by Mergon View Post
Is there way to get the name off the DamageRes.? where the ? is the element selected (i.e.; dtFire would give Fire)?
tagnames[DamageRes.?] if you have multiple tags you will get multiple names.

But if this is a "thing" I am not 100% sure tagnames will work actually...

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 March 24th, 2016, 04:49 PM
field[name].text

^^ Did the trick, many thanks. Not a field name I knew of. Added to my list of references.

Watch your back, Conserve your ammo,
and NEVER cut a deal with a dragon!
Mergon is offline   #3 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 03:15 AM.


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