Junior Member
Join Date: Feb 2017
Posts: 7
|
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! |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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. |
#2 |
Junior Member
Join Date: Feb 2017
Posts: 7
|
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! |
#3 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
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. |
#4 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Quote:
|
|
#5 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Quote:
|
|
#6 |
Senior Member
Join Date: May 2015
Posts: 830
|
#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. |
#7 |
Junior Member
Join Date: Feb 2017
Posts: 7
|
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) |
#8 |
|
|