Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System

Notices

Reply
 
Thread Tools Display Modes
Kaelryk
Junior Member
 
Join Date: Sep 2010
Posts: 7

Old October 16th, 2010, 03:13 PM
I'm attempting to reproduce the Bladesinger prestige class, specifically the Bladesong Style ability, but I cannot find the correct field value to reference whether or not a given weapon is wielded/equipped. If I use the script below, it returns a valid condition whenever the character possesses the weapon, whether or not it is wielded. Any help would be greatly appreciated!

Quote:
if (hero.childlives[wLongsword] <> 0) then

Last edited by Kaelryk; October 16th, 2010 at 06:22 PM. Reason: added more info
Kaelryk is offline   #1 Reply With Quote
Kaelryk
Junior Member
 
Join Date: Sep 2010
Posts: 7

Old October 20th, 2010, 05:46 AM
Anyone know the tag I'm looking for? Devs, anyone? I've tried variations on this:

if (hero.tag[IsEquip.wLongsword] <> 0) then

but I keep getting errors, so I'm obviously not guessing correctly. I know there has to be some tag that indicates whether or not a given item is equipped; I just can't find it. I would greatly appreciate any help or input anyone could provide. Thanks in advance!
Kaelryk is offline   #2 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old October 20th, 2010, 05:54 AM
You should look for the field[gIsEquip] instead.

foreach pick in hero from BaseWep where "IsWeapon.wLongsword"
if (each.field[gIsEquip].value <> 0) then
whatever you want to happen when equipped
endif
nexteach
Lawful_g is offline   #3 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old October 20th, 2010, 05:54 AM
Hope that helps. Sleep time in Korea now.
Lawful_g is offline   #4 Reply With Quote
Kaelryk
Junior Member
 
Join Date: Sep 2010
Posts: 7

Old October 20th, 2010, 12:08 PM
Awesome!! That's exactly what I was looking for! I really appreciate your help--I've been trying to figure this out for days, and it's been driving me nuts! Thank you for helping me retain my sanity (what little of it remains...)
Kaelryk is offline   #5 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old October 20th, 2010, 12:21 PM
A revision:

Code:
 
var hasweapon as number
foreach pick in hero from BaseWep where "IsWeapon.wLongsword"
  if (eachpick.field[gIsEquip].value + eachpick.field[wIs2nd].value <> 0) then
    hasweapon = 1
    endif
  nexteach
 
if (hasweapon <> 0) then
  ~whatever you want to happen if it's equipped
  endif
You want to check for the longsword equipped in the off-hand, too, in case a charactee is dual-wielding longswords. Also, if a character is wielding two longswords, you don't want to apply your changes twice (heck, they could be a Marilith wielding 6 longswords).
Mathias is offline   #6 Reply With Quote
Kaelryk
Junior Member
 
Join Date: Sep 2010
Posts: 7

Old October 20th, 2010, 01:16 PM
I didn't know about the 'wIs2nd' field, but then I'm sure there are quite a few fields I don't know about. I assume it indicates a second copy of the referenced item in inventory? Since I don't have open access to the source code, I just sorta make this stuff up as I go along...

I used this:

Quote:
if (hero.tagis[Hero.EquipOff] <> 0) then
result = assign[Helper.SpcDisable]
done
endif
to ensure an empty off hand, and I have the elf/half-elf race as a requirement for the prestige class (should keep those pesky mariliths away). So far everything seems to be working fine, but if there's a way to exploit something I've missed, I'm sure my players will find it! lol
Kaelryk is offline   #7 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old October 20th, 2010, 01:31 PM
If your ability is already requiring that nothing's equipped in the off-hand, then you don't need to test for whether the longsword's equipped in the off-hand, and can go with Lawful_g's version of the script.
Mathias is offline   #8 Reply With Quote
Kaelryk
Junior Member
 
Join Date: Sep 2010
Posts: 7

Old October 20th, 2010, 02:28 PM
So what exactly does the [wIs2nd] field represent? I thought at first it was to indicate a second copy of the item in the inventory, but since you referenced it in your code, I thought it must refer to a second copy of the item being equipped, but then wouldn't it be called [gIs2nd], to keep the naming conventions consistent?
Kaelryk is offline   #9 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old October 20th, 2010, 02:36 PM
[wIs2nd] tells you if the weapon is equipped in the off-hand or 2nd hand. The primary hand being considered the 1st hand.

So the following is basically saying that IF equipped in the primary hand or off-hand then do something:
Code:
if (eachpick.field[gIsEquip].value + eachpick.field[wIs2nd].value <> 0) then

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   #10 Reply With Quote
Reply

Thread Tools
Display Modes

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 01:27 AM.


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