Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game

Notices

Reply
 
Thread Tools Display Modes
wiscrhino
Junior Member
 
Join Date: Feb 2017
Posts: 7

Old February 3rd, 2017, 06:17 AM
Hi all, this is my first post, so please excuse any newbie errors.

I am attempting to create a custom magic item and having a bit of trouble in the editor. I have successfully created other magic items in the editor, but running into a jam trying to create a Ring of Shield.

Now, right off the bat let me answer/address 2 questions/comments that are bound to come up:
1) Yes, I have watched the videos and read the very useful articles written by superuser Mathias on how to use the editor. I am still in a pickle and can't figure out the code needed.
2) Yes, I know a ring of shield is sort of a broken thing, that you shouldn't make it, but I want to anyway

Ok, so I have enabled data file debugging, and looked at the selection fields when the spell "Shield" is cast, to get an idea of how to do the coding. I've noticed that when the spell is enabled, the following is noted: "SpellEff.BuffAC".

Additionally, I've noted that the id for the item shield is "pShield" and when it's activated, the id "pAdjust"is activated as well, with a value of "4".

Therefore, I have tried the following code in the editor under "eval scripts":
hero.child[pShield].field[pAdjust].value += 4

However this doesn't seem to work, I get an error message when running the testing, which states:
"Syntax error in 'eval' script for Thing xxxx (Eval Script '#1') on line 1 -> Only derived fields can generally be modified via scripts (field 'pAdjust')

Therefore, I'm a bit stuck. I'd really like to know how to code this in the editor, and can't seem to figure it out. Appreciate any feedback to help me get this corrected!
wiscrhino is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old February 3rd, 2017, 07:55 AM
Remember, in the editor, you can use the "New (Copy)" button at the bottom left to copy an existing item, and look at its eval script to see how it works.

So, try copying the ring of protection - that's an item that applies a different type of AC bonus.

Or try copying the shield adjustment itself, to see how a shield bonus is applied.
Mathias is offline   #2 Reply With Quote
wiscrhino
Junior Member
 
Join Date: Feb 2017
Posts: 7

Old February 3rd, 2017, 08:35 AM
Thanks Mathias. I tried doing exactly that (the New(Copy) function) and looked at both Ring of protection and the shield spell as well. Here's where I ran into problems:

1) Ring of protection has the following eval script:
"hero.child[ArmorClass].field[tACDeflect].value = maximum(hero.child[ArmorClass].field[tACDeflect].value, 1)"

So I wanted to set this up the same way, but don't know what to substitute in for "tACDeflect" - because Shield is not a deflect bonus but is a shield bonus. So didn't know if I should use "pShield" or "pAdjust" somehow. Am a bit stuck here

2) With regards to looking at the shield adjustment - maybe I am doing it incorrectly (very likely) but I tried to find this and failed. In the editor I tried to "New (Copy)" the item the spell Shield - so Magic-> Spell -> New (Copy) -> Shield (spShield1). But when I do so, there is nothing in the Eval Scripts section/button, so I can't see what code is being used there.

Sorry, I know you're trying the "teach a man to fish" approach, but I am just not getting it. Appreciate any guidance or anything else you can offer to steer me on the correct course!
wiscrhino is offline   #3 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old February 3rd, 2017, 09:19 AM
Actually isn't a "Ring of Force Shield" 99% of the logic you want? I would copy it and use that as a bases for a Ring of Shield.

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   #4 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old February 3rd, 2017, 09:38 AM
Quote:
Originally Posted by wiscrhino View Post
2) With regards to looking at the shield adjustment - maybe I am doing it incorrectly (very likely) but I tried to find this and failed. In the editor I tried to "New (Copy)" the item the spell Shield - so Magic-> Spell -> New (Copy) -> Shield (spShield1). But when I do so, there is nothing in the Eval Scripts section/button, so I can't see what code is being used there.
That's the shield spell, not the adjustment to apply the effects of that spell. The adjustment is on the General grouping, Adjustment tab.
Mathias is offline   #5 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old February 3rd, 2017, 09:40 AM
Quote:
Originally Posted by wiscrhino View Post
1) Ring of protection has the following eval script:
"hero.child[ArmorClass].field[tACDeflect].value = maximum(hero.child[ArmorClass].field[tACDeflect].value, 1)"

So I wanted to set this up the same way, but don't know what to substitute in for "tACDeflect" - because Shield is not a deflect bonus but is a shield bonus. So didn't know if I should use "pShield" or "pAdjust" somehow. Am a bit stuck here
If "tACDeflect" is a deflection bonus to AC, maybe tACShield is a shield bonus to AC.
Mathias is offline   #6 Reply With Quote
Minous
Senior Member
 
Join Date: May 2015
Posts: 830

Old February 3rd, 2017, 03:24 PM
#applybonus[tACShield, hero.child[ArmorClass], field[pAdjust].value]

or replace field[pAdjust].value with the shield bonus the ring provides.

that way it takes care of factoring in current shield bonuses and other issues.
Minous is offline   #7 Reply With Quote
wiscrhino
Junior Member
 
Join Date: Feb 2017
Posts: 7

Old February 3rd, 2017, 05:20 PM
Aha, thank you Mathias and all, success. The tACShield makes sense and works for me. Many thanks again. Went with the following and it's working:

hero.child[ArmorClass].field[tACShield].value = maximum(hero.child[ArmorClass].field[tACShield].value, 4)
wiscrhino is offline   #8 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 09:31 PM.


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