Spy
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220
|
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 Code:
field[rHP].value = field[rHP].value + 1 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] Code:
perform assign[Hero.HitDice] perform delete[Hero.HitDice] 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. |
#21 |
Thread Tools | |
Display Modes | |
|
|