View Single Post
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old May 9th, 2018, 09:49 PM
Quote:
Originally Posted by karpana View Post
Code:
fieldval:gIsEquip <> 0 & hero#SpeakLang.lFirstSpch = 0
This bootstrap condition is a little off. You got it really close!

SpeakLang.lFirstSpch is a tag and you can simply check for the presence or absence of the tag without adding any = 0 stuff. To check for 'no tag' you use ! in front of the tag name:
Code:
fieldval:gIsEquip <> 0 & !SpeakLang.lFirstSpch
If you really wanted to use the = 0 logic you would need to "count" the tags to see if you have none. This is also great for if you need to count class levels:
Code:
fieldval:gIsEquip <> 0 & count:SpeakLang.lFirstSpch = 0
Now then the next issue is timing. I just ran some tests to see when the tag becomes live on the hero. I used the following script to test up to Pre-Levels/9999:
Code:
debug hero.tagis[SpeakLang.lFirstSpch]
Unfortunately it appears that the tag does not get on to the hero until Pre-Levels/10001. This means you can't use this tag in the bootstrap logic.

Going to have to do a little bit of a work around to get this to work as you will have to "manually" check for the existence of the language yourself.
First/400:
Code:
~ If language found set abValue5 to 1 so we can check in the bootstrap
If (hero.childlives[lFirstSpch] = 1) Then
  field[abValue5].value = 1
Endif
Then change the Bootstrap logic to be this at First/500:
Code:
fieldval:gIsEquip <> 0 & fieldval:abValue5 <> 0
Now you get to know if the language is live or not by First/500. I used abValue5 as its not often used and makes things easy for checking a simple value on our self.

Hope that helps.

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