• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Adding Abilities when Item Equipped

RayPrancer

Well-known member
As you may remember I have been converting my homebrew world to use the "Authoring Kit Sample" system.

My current goal is that I have a type of armor called "RoboRoo Disguise" (armRoboRoo) that grants an ability "Cyborg Groin" (abGroin) when equipped. I've located the script to do this with a d20 file, but it doesn't work as the fields for armor are different.

I also have a second type of armor "Boom Boxers" (armBoomBox) that grants a +1 bonus to spellcasting skill (skSpell) but again only while equipped. The relevant unique IDs I've used are in brackets. As well as this I have two types of armor that boost health "Modern Outfit" (armTech) granting a +1 and Full Plate (armPlate) granting a +2.

I'm sure this is quite simple to do, but not sure how to do this. Can you offer some help - at least by advising the syntax to see if something is equipped or not?

Here's the current script I'm trying to use for the Boom Boxers. I'm sure at least the name of the field "gIsEquip" is incorrect. I'm sure it's almost identical for the two Health modifying armors to the correct code although the trait to be modified is of course trHealth and not skSpell. I'm a bit more confused about the adding abilities as I would think it would be a conditional bootstrap.

Code:
      if (field[gIsEquip].value <> 0) then
        #traitbonus[skSpell] += 1
        endif
 
Normally, you would bootstrap somethng to your item with this:

Code:
<bootstrap thing="abGroin"/>

Here's how to modify that so that the ability is only live while the item is equipped:

Code:
<bootstrap thing="abGroin">
  <containerreq phase="Initialize" priority="500"><![CDATA[
    fieldval:gIsEquip <> 0
    ]]></containerreq>
</bootstrap>

Could you tell me what's going wrong with the script you've given? I don't see anything that should keep it from working. That looks correct for how you can apply scripted effects only while an item is equipped.
 
The error message is that it isn't recognising the field "gIsEquip" as valid - it says "Non-exsistant field gIsEquip used by script". However having looked through the data files properly it seems that due to the system I'm using I should set it to "Equipped" instead of "gIsEquip" but that's producing the same error message.
 
Oops, it looks like the field is grIsEquip for game systems derived from the skeleton files (It's gIsEquip for game systems derived from d20, and I had forgotten that there was a difference) - you can see the definition of the field on line 191 of equipment.str (or search for the Equippable component if you've made changes to equipment.str that move it around).
 
Following yesterday's success I was inspired to create a "Fan of Comliness +1" (wpFanCom1) - the fan counts as a knife so I started by copying the Knife (wpKnife) included in the files to a Battle Fan (wpFan) which is the mundane counterpart then copying that to actually create the item. If working correctly then when it's equipped Charisma (attrCha) goes up by 1 and Power Points (trPowerPts?) go down by 2. However I think I've set it to the wrong phase/priority combination as Power Points are actually going up by 1 instead.

I've currently got the script for Charisma running at Initilization priority 100 and working correctly and an equivelent script (reproduced below) running at Final priorty 100 for the Power Points.

Code:
if (field[grIsEquip].value <> 0) then
#traitbonus[trPowerPts] -= 2
endif
 
Try the Effects phase - you are applying the effects of this item to another thing in the files.

Or the Pre-Traits phase - you're making modifications to the value of a trait, so pre-traits gets the modification done before the final value of the trait is calculated in the Traits phase.

Final is too late for making modifications - it's generally only used for calculating things that apply only to the thing making the calculations - not for applying changes that other things will rely upon or that other things may want to look up.
 
Both of those were to early - I discovered a script that was setting it to a certain value at Traits with Priority 4000. I've now got it to work by using Traits and Priority 5000 for the Power Points element of script I want to run - and given what's neccessary need to change the penalty to -3 due to the Charisma element there as it's the addition that causes the Power Points to increase.
 
Last edited:
I found that many of the traits in the skeleton files calculated their final values like:

@value = B + C

by changing those to:

@value += B + C

You're adding to the value that already exists, rather than replacing it - that widens the window for other things to add to the value - like you're trying to do here.
 
I'm trying to avoid doing that because I'm working with the files in the folder labelled "Sample" which are automatically updated each time HeroLab is. Another complication is that one of the two values used for calculating Power Points is Charisma.
 
Copy them to another folder within HeroLab/data then.

Actually, in the tools menu, use the "Duplicate Game System" option to make a duplicate of the skeleton files, and work in that folder - that's the standard way to get started on a new game system.

Okay, so for the power points one, you'll need to put your phase and priority pretty close to the final calculations for the power points trait, so that other things have time to alter CHA before you look it up.

Looking at the Derived component, the derived trait final script is at Traits/6000, so I'd recommend Traits/5900.
 
Back
Top