Member
Join Date: Jun 2007
Location: United Kingdom
Posts: 80
|
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 |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Normally, you would bootstrap somethng to your item with this:
Code:
<bootstrap thing="abGroin"/> Code:
<bootstrap thing="abGroin"> <containerreq phase="Initialize" priority="500"><![CDATA[ fieldval:gIsEquip <> 0 ]]></containerreq> </bootstrap> |
#2 |
Member
Join Date: Jun 2007
Location: United Kingdom
Posts: 80
|
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.
|
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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).
|
#4 |
Member
Join Date: Jun 2007
Location: United Kingdom
Posts: 80
|
Thanks, everything is working as intended now.
|
#5 |
Member
Join Date: Jun 2007
Location: United Kingdom
Posts: 80
|
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 |
#6 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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. |
#7 |
Member
Join Date: Jun 2007
Location: United Kingdom
Posts: 80
|
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 by RayPrancer; October 23rd, 2010 at 07:36 AM. Reason: New facts discovered |
#8 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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. |
#9 |
Member
Join Date: Jun 2007
Location: United Kingdom
Posts: 80
|
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.
|
#10 |
|
|