Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System

Notices

Reply
 
Thread Tools Display Modes
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220

Old December 5th, 2013, 10:37 AM
For the fields you will have to reference them based on what they are attached to. So, usually things are attached to a Hero context, which has a child context (usually the thing you are referencing, or what you select in the Floating Windows) which itself has field context (the fields listed in the Floating Windows thing you have selected).

Hero field contexts are simple, you just reference these by herofield[<fieldname>].value (for numeric values, for strings you will use .text). These fields are always on the Hero itself.

Things assigned to the hero are child contexts (armor class, race, class, equipment, etc.). When you are in the Floating Windows and you go to Selection (fields, tags, or tasks) you can select one of the things (child contexts) on the Hero. These are used as hero.child[<thingname>].field<fieldname>.value (or text).

The fields are exactly as you see them, except some fields take an arrayvalue[index] or arraytext[index], with an index that starts at 0 for the first item, 1 for the second item, and so forth. These would be used as hero.child[<childname>.field[<fieldname>].arrayvalue[index].

The final thing is to get the child name's correct. They are not the listed names in the Selection list, but rather they are the indentifiers associated with them. In the Floating Windows, when you use a Selection to select a thing, the child name will be listed at the top of the window that shows the thing's fields. So, for example, on a dwarven hero you have created, if you go to the Floating Windows and use Selection Fields you will see something called 'Dwarf' there, but when you open that window to look at the fields, you will notice the actual identifier for the Dwarf is 'rDwarf'. One of the fields on a Dwarf is rHP, so if you wanted to assign default hit points to the Dwarf, you could do so in a script thusly:
Code:
hero.child[rDwarf].field[rHP].value = hero.child[rDwarf].field[rHP].value + 1
However, if the script you are writing is actually part of the child context (the script is actually added to the rDwarf in the Editor), you can do the following without the hero context (since you are actually editing the thing it applies to).
Code:
field[rHP].value = field[rHP].value + 1
Tags work in a similar way, assigning and deleting them. You will really only want to assign a tag to a context if it either doesn't already have one when only one is needed, or if an additional one is needed (every hit die assigns a new Hero.HitDice to the hero context).

Assigning and deleting a hit die to the Dwarf context, as an example only:
Code:
perform hero.child[rDwarf].assign[Hero.HitDice]
perform hero.child[rDwarf].delete[Hero.HitDice]
or if you are already within the rDwarf in the Editor:
Code:
perform assign[Hero.HitDice]
perform delete[Hero.HitDice]
By the same token, when you are looking for a tag, it may not be a tag on the thing you are scripting from in the Editor. For example, a Dwarf will have the Race.Dwarf tag, so the script can reference it easily from within the rDwarf using tagis[Race.Dwarf]. However, remember that these also get migrated to the Hero context, so from the dwarven waraxe in the Editor, you would script it to look for the dwarf race by hero.tagis[Race.Dwarf].

One last note, the child contexts can only be bootstrapped to a thing. Bootstraps are added to the hero dynamically during Character Creation (choosing a race, class, equipment, etc.). Unfortunately, you can't do this with a script, you have to use the Editor to bootstrap anything you want something to make it available. For example, if you want your Dwarf to give your hero Darkvision, you will have to bootstrap the rDarkvis special to the rDwarf in the Editor (and this in turn makes rDarkvis and child of the hero if you select a Dwarf in Character Creation).

That should be enough information for now, don't want to overload you with details. Hope this is helpful!

Last edited by Kendall-DM; December 5th, 2013 at 10:41 AM.
Kendall-DM is offline   #21 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 10:08 PM.


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