PDA

View Full Version : Help to code an item


Yaourth
May 11th, 2010, 11:48 AM
Hi all !

i'm a new Hlab user and very very weak in code making... so the Editor is like a alien artefact for me :o
But, i've mastered the D1 module (Crown of Kobold King) and one of my player (sorcerer) have looted the famous Crown.
And i'm not able to create the correct item in Herolab...

this is the basic stats :

Alteration Bonus +2 Charisma (easy)
Natural Armor +2 (easy)
and... the hardest part :
If the character is a Sorcerer, he casts spells with +1 NLS. It's not a basic NLS+1...

is it possible to code that in a wonderous item ?

Thanks a lot for help (and apologies for my poor english)

Mathias
May 11th, 2010, 12:21 PM
I'm sorry, I don't recognize the abbreviation "NLS".

ShadowChemosh
May 11th, 2010, 05:51 PM
Found it in my copy of the module. He means +1CL for sorcerer levels only


Wearing the crown grants a +2 enhancement bonus to Charisma and a +2 natural armor bonus. You are immune to the frightful presence ability of all dragons. If you are a sorcerer you cast spells at +1 caster level.

Yaourth
May 12th, 2010, 07:50 AM
ooops sorry... NLS is the french code for CL... :o

Theocrat
May 12th, 2010, 08:59 AM
Although, I'm not working on this area - I too am like Yaourth, I don't know much. The tutorial isn't that much help. Is there a forum area that lists more in detail how to do such things? I'm having many troubles with many of the things that I'm trying to code.

Mathias
May 12th, 2010, 09:15 AM
Here's the method you'd use to figure this out:

Add a level of sorcerer to a blank character.

In the develop menu, make sure that "Enable Data File Debugging" is checked at the top, and then select the "Floating Info Windows" option at the bottom of the develop menu. Select "Show Selection Fields" from that list, and then find Sorcerer. You'll see that there are two Sorcerer entries, so select both and press OK.

You'll now have two windows open, each telling you what the field values are for those picks. You'll see that one, labeled "cHelpSor" has quite a lot more information than the one labeled "cSorcerer" - that's because the Class Helper (they all start with "cHelp" is where the majority of the information for a class is stored. So, close the window for the "cSorcerer" thing - you won't need it.

Look through the list of fields for the Sorcerer Class Helper - in this case it's very easy to find what you're looking for, since the cMagicLev and cCasterLev fields are right at the top.

Now, to make sure these are what we want, add 2 levels of Eldritch Knight (ignore the validation errors). On the Eldritch Knight tab, add a magic level, and select sorcerer as what that magic level should improve.

Look back at the list of fields for the Sorcerer, and you'll see that cMagicLev and cCasterLev have both increased by 2.

What's actually happening behind the scenes is that the prestige class is adding to the Sorcerer's cMagicLev, then cMagicLev is added to the cCasterLev. In most cases, they're identical. cMagicLev is the level that the class is for the purpose of what spells they can cast, cCasterLev is the caster level.

Now, choosing a timing; caster level and magic level are a function of the level of a class, so that suggests that Hero Lab is using either the Levels or Post-Levels phase to make all the calculations relating to the magic level and caster level. Therefore, you'll put your script in the Pre-Levels phase, before both of those. Any priority within Pre-Levels should be fine, so leave it at the default 100.

You'll simply need to add 1 to the caster level:


hero.childfound[cHelpSor].field[cCasterLev].value += 1

Mathias
May 12th, 2010, 09:25 AM
Although, I'm not working on this area - I too am like Yaourth, I don't know much. The tutorial isn't that much help. Is there a forum area that lists more in detail how to do such things? I'm having many troubles with many of the things that I'm trying to code.

Studying existing things is the best way to figure out how to accomplish something - break what you want to do into component pieces (like how Yaourth listed out the things he wanted to accomplish in his original email), and think of something that already exists that does the same thing.

Adding a bonus to Charisma - the Headband of Alluring Charisma
Adding a bonus to Natural Armor - the Amulet of Natural Armor

So, pull those items up in the editor, and study their scripts, and figure out how they accomplish their task.

There is no good example of something that modifies caster level, so my previous post explained a more advanced technique for figuring out how information is stored.

chiefweasel
May 12th, 2010, 11:06 AM
Also for some training sessions, the good folks at Lone Wolf give classes at Gen Con. I have been to a few of them myself and they have ben very helpful. If anyone is going to Gen Con this year check out the schedule and see where they are having the sessions this year.

ShadowChemosh
May 12th, 2010, 11:52 AM
Too bad I am not going to Gen Con. Maybe Lone Wolf should record those sessions and post them to their website. I am sure I am not the only one that would be willing to watch them from home. :)

Theocrat
May 12th, 2010, 09:34 PM
My biggest concern with the editor is the little buttons on the right side. I don't understand any of them. I can figure out a couple of the bottom buttons, but when I'm trying to work on the Seeker of Secrets feats, spells and magic items there is some problems that I don't know how to work out.
I'll be at Strategicon/Gamex as well as NeonCon but with still no job - there's no way I can make GenCon (unless I get room/board/flight for volunteering). So I agree, making these seminars sounds great - even better if they're online.
Be Well. Be Well Webed.
Theocrat Issak

Yaourth
May 13th, 2010, 10:51 AM
Many many thanks for this help and for great explanation about caster level !! I will test this code tonight and try to really understand it :)

Just another question : i'm trying to create an special item giving Magic Resistance (15) and i thought it should be easy to start from the Scarab of Protection (MR 20). But i'm not able to found an eval-rule for MR in the scarab template. Is it normal ?
I hope find something like (magicresist) =20 somewhere....

Mathias
May 14th, 2010, 01:01 PM
It appears that the scarab of protection doesn't currently do anything. That's on my to-do list.

So, check something else that grants SR, like the Drow race. You'll find that among the list of bootstraps on the race is the xSplRs pick. Next, check the Eval Script, and you'll see:


~SR 6 + class levels
var SR as number
SR = 6 + #totallevelcount[]
#applysr[SR]


Since you want a fixed SR 15, all you'll need is:


#applysr[15]


(don't forget to add the bootstrap, too, or the script won't have anything to modify).

Yaourth
May 15th, 2010, 12:59 AM
Ok !!
I'm trying that !

Thanks a lot again for all !