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
karpana
Junior Member
 
Join Date: Jan 2016
Posts: 25

Old May 9th, 2018, 06:48 PM
Hi There,

I'm working on a some custom "Rings of Eloquence", and have copied out all the pertinent bits to provide the skill bonuses (using the uncopy-able one from a supplement).

What I'm trying to do is add the 4 custom languages, so that they show up in the character's languages known, and have successfully determined that each of the languages needs to be "bootstrapped" in. So this is working.

I've also determined, thanks to the wonderful "401" conditions page figured out that I can use "fieldval:gIsEquip <> 0" to only action the bootstrap if the magic ring is listed as equipped. So this is working.

What isn't working is detecting whether the bootstrapped language is already present on the character or not... I've been trying to use "SpeakLang.lFirstSpch" and "hero#SpeakLang.lFirstSpch" do not provide any results.

The compiler won't let me put the timing any later than Pre-Levels 10000, so I'm at a loss...

How do I get the condition to detect that 1) the language in question doesn't already exist on the character, so that when the ring is equipped, it adds the language in the bootstrap.

This is what I currently have for my lFirstSpch bootstrap
Code:
fieldval:gIsEquip <> 0 & hero#SpeakLang.lFirstSpch = 0
THanks in advance.
karpana 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 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
karpana
Junior Member
 
Join Date: Jan 2016
Posts: 25

Old May 10th, 2018, 03:26 AM
Thank you ShadowChemosh.

I rather suspected it was a timing problem, as the syntax that you provided for the condition, was a solution I had tried at one point, which failed, evidently because of the timing problem.

As for the First/400 code, I'm assuming this is an eval script?

I do have one more question, and it stems from the use of the abValue5.
The Ring of Eloquence grants 4 separate languages, and my current solution is to use 4 separate bootstraps for each granted language, with the objective being to only add the given language if it doesn't exist.

I have a wacky idea using "pipe-delimited strings" being loaded into abValue5 for each found language, and then using the "pos" command to locate the first occurence of the given language.

Can I load strings into abValue5?
karpana is offline   #3 Reply With Quote
karpana
Junior Member
 
Join Date: Jan 2016
Posts: 25

Old May 10th, 2018, 05:59 AM
I took a quick stab a trying to push a string into the abValue5 variable. Suffice to say it doesn't work. (not unexpected mind you).

In looking at the fields (using the debug info screen), at least for this specific magical item (ring), it would seem that the abValue2 through abValue5 don't change, or seem to not be used. Leading me to think that I should be pretty safe to to use them as 'flag fields' for each of the four languages I'm putting into this "Ring of Eloquence".

Are there any pitfalls I should be aware of, considering it was indicated that abValue5 is the least used, in using abValue2, abValue3 and abValue4?

Alternatively, would it better/safer to create some unique fields or tags, to store these unique flags for myself?

Last edited by karpana; May 10th, 2018 at 06:13 AM.
karpana is offline   #4 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old May 10th, 2018, 11:21 AM
Quote:
Originally Posted by karpana View Post
Are there any pitfalls I should be aware of, considering it was indicated that abValue5 is the least used, in using abValue2, abValue3 and abValue4?
The abValue to abValue5 field are generic value fields for you to use when building Things. What makes them so nice is that scripts outside of your Thing can access them and change them. Without knowing the rest of your script logic I didn't know if you where already using them.

In this case it sounds like you can easily use 2-5 as flag values to control the other bootstraps.

Quote:
Originally Posted by karpana View Post
Alternatively, would it better/safer to create some unique fields or tags, to store these unique flags for myself?
You can't add new "fields" to Picks. This can only be done by LW for Pathfinder as it requires access to the skeletal files that we don't have access too.

But you can make up new tags. The easy way in the editor is near the bottom look for "User Tags" which always start with group "Custom.?". You could create your own tags and instead of setting a value into abValue fields you could assign the tag to the hero and then check for that in the bootstrap condition.

Code:
~ If language found set Custom.lFirstSpch tag on Hero container
If (hero.childlives[lFirstSpch] = 1) Then
  perform hero.assign[Custom.lFirstSpch]
Endif
Bootstrap:
Code:
fieldval:gIsEquip <> 0 & !Custom.lFirstSpch
Another way to go that would use tags but would prevent the need of using Custom.? tags is to manually push the SpeakLang.? tags to the hero yourself at first 400. This is a bit more advanced and most likely overkill as it uses a Foreach loop:

First/400
Code:
~ Pull the LangSpeak tag from each Base Language Pick to our self
foreach pick in hero from BaseLang
  perform eachpick.pulltags[LangSpeak.?]
nexteach

~ Push all collected LangSpeak tags from our self to the hero
perform hero.pushtags[LangSpeak.?]
The foreach loop finds all Picks on the hero of the Base Language type. We then pull the tag LangSpeak using a wild card ? to pull any specific tags. So in example when we find common we will pull the SpeakLang.lCommon specific tag. Then at the end pushtags sends all the SpeakLang tags we have collected to the hero allowing the bootstrap to test for them.

First/600
Code:
~ Remove all LangSpeak tags from hero so we don't get double
perform hero.delete[LangSpeak.?]
To prevent issues with any later scripts that may do tagcount[LangSpeak.?] we then delete the tags.

Bootstrap:
Code:
fieldval:gIsEquip <> 0 & !LangSpeak.lFirstSpch
I am just showing some different examples here to show how you can use the HL scripting language to solve an issue different ways.

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   #5 Reply With Quote
karpana
Junior Member
 
Join Date: Jan 2016
Posts: 25

Old May 10th, 2018, 11:27 AM
Solid Examples ShadowChemosh. Thank you!

I'll pore of these a bit more tonight when I get in front of an HL Editor.
abValueX seems the simplest way, but I think going with Custom.X might equally set my needs.
karpana is offline   #6 Reply With Quote
karpana
Junior Member
 
Join Date: Jan 2016
Posts: 25

Old May 10th, 2018, 02:52 PM
ShadowChemosh

I'm thinking this might be something I've done wrong, at least with using the custom tags, but I'm finding that the following four statements always return "1" unless the eval script (which is on the magic ring), is set to "pre-level/10000".

The result of which, is that because the Bootstrap Condition, which can't run any later than "pre-level/10000", I end up with the problem that the bootstrap conditions always return true, (I'm assuming because they essentially run before for the eval, even when also set to "pre-level/10000"), and thus all four languages are always added, even though lFirstSpch already exists on the character.

Thoughts or ideas?

Edit: I've attached a copy of four of the languages on my character
Common ... Added as part of race
Druidic ... Added as part of class
FirstSpeech ... Added as part of high Int (via the Background Tab)
Ignan ... added as a result of having ranks in linguisitics (via the Personal Tab)
Looks like, apart from Common, they're all running in "Pre-Level/10000" :/

Code:
debug "eval2"
debug hero.childlives[lFirstSpch]
debug hero.childlives[lDraconic]
debug hero.childlives[luIobarian]
debug hero.childlives[lGiant]


If (hero.childlives[lFirstSpch] = 1) Then
  perform hero.assign[Custom.lFirstSpch]
Endif

If (hero.childlives[lDraconic] = 1) Then
  perform hero.assign[Custom.lDraconic]
Endif

If (hero.childlives[luIobarian] = 1) Then
  perform hero.assign[Custom.luIobarian]
Endif

If (hero.childlives[lGiant] = 1) Then
  perform hero.assign[Custom.lGiant]
Endif
Attached Images
File Type: jpg Timing.jpg (295.0 KB, 3 views)

Last edited by karpana; May 10th, 2018 at 03:10 PM. Reason: Added image of timing
karpana is offline   #7 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old May 10th, 2018, 03:09 PM
Can you attach your .user file to this thread. It will just make it way easier to make sure we are both on the same page. Plus I can play around with the file real quick to see what is going on....

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   #8 Reply With Quote
karpana
Junior Member
 
Join Date: Jan 2016
Posts: 25

Old May 10th, 2018, 03:12 PM
Sure thing...

Equipment -> Ring -> Karp_RoE_1
Attached Files
File Type: email Karpana_Custom.user (30.4 KB, 2 views)
karpana is offline   #9 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old May 10th, 2018, 03:26 PM
Your eval script and your bootstrap conditions are both at Pre-Level/10000 - the eval script needs to come first, so maybe Pre-Level/9990. If two things are at the same time, it's random which one HL will execute first.
Mathias is online now   #10 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 01:28 PM.


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