Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Ckorik
Member
 
Join Date: Apr 2014
Posts: 52

Old March 26th, 2016, 11:55 AM
I'm trying to add an ability that only works on an equipped shield.

So I am building a spell effect - and have "current armor" in my showmenu #1

The code I'm using is this:

Code:
 doneif (field[pIsOn].value = 0)
   doneif (field[pChosen].ischosen = 0)

var isShield as number
isShield = 1
isShield = compare(field[pChosen].chosen.field[arCategory].text,"Shield")

if (isShield = 0) then
 doneif (field[pChosen].chosen.field[gIsEquip] = 0)
   if (hero.child[xSplRs].field[abValue].value = 0) then
      #value[xSplRs] = 10
      done
   endif

   if (hero.child[xSplRs].field[abValue].value > 0) then
     if ((hero.child[xSplRs].field[abValue.value + 5) then
       #value[xSplRs] = 10
       done
     endif
      #value[xSplRs] += 5
   endif
However it bombs at the if (isShield = 0) - I'm not sure why - any ideas?
Ckorik 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 26th, 2016, 12:15 PM
Lot easier to just test the tag on the hero for an equipped shield actually. Text compare is really slow in HL.

If you equip a shield and look at the tags on the hero you find two really helpful ones. Hero.EquipShld and ShldClass.? (Light, Heavy, Buckler).

You can change your script to:
Code:
~ If we have a shield equipped get out now!
doneif (hero.tagis[Hero.EquipShld] = 1)

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
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old March 26th, 2016, 12:17 PM
Just for information. field[arCategory].text can't be used for the test as it contains no text (ie Value). If you look at the field in debug you can see that it only has a 'Final' not a "Value".
Shhield.jpg

You can't access the "Final" value only something that is in the "Value" column.

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   #3 Reply With Quote
Ckorik
Member
 
Join Date: Apr 2014
Posts: 52

Old March 26th, 2016, 12:29 PM
Yeah I wasn't sure about that - I just honestly wasn't sure how else to check for a shield - I think the herotag method works better honestly.

Thank you!
Ckorik is offline   #4 Reply With Quote
Ckorik
Member
 
Join Date: Apr 2014
Posts: 52

Old March 26th, 2016, 12:45 PM
As a follow up using the hero tag worked perfectly and did exactly what I wanted - including the character loosing the bonus if the shield was unequipped.

Thanks again!
Ckorik is offline   #5 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 08:26 AM.


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