Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Pathfinder Roleplaying Game (http://forums.wolflair.com/forumdisplay.php?f=62)
-   -   How do you create a Ring of Shield? Code in editor not working (http://forums.wolflair.com/showthread.php?t=57604)

wiscrhino February 3rd, 2017 06:17 AM

How do you create a Ring of Shield? Code in editor not working
 
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!

Mathias 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.

wiscrhino 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!

ShadowChemosh 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.

Mathias February 3rd, 2017 09:38 AM

Quote:

Originally Posted by wiscrhino (Post 243245)
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 February 3rd, 2017 09:40 AM

Quote:

Originally Posted by wiscrhino (Post 243245)
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.

Minous 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.

wiscrhino 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)


All times are GMT -8. The time now is 02:49 AM.

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