Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Adam.Ormond
Senior Member
 
Join Date: May 2010
Location: Maryland
Posts: 167

Old May 9th, 2011, 05:16 PM
I'm working on implementing a few Weapon Crystals from the Magic Item Compendium, and I'm not quite sure how to create them such that they're tied to a specific weapon.

Thanks in advance for any advice!

Here's my definition so far:
Code:
  <thing id="ioLfeDrnk1" name="Crystal of Life Drinking, Least" description="This transparent black crystal has a faint, sickly glow.\n\nA crystal of life drinking bestows a small amount of life energy upon you each time you damage a living creature with the weapon to which the crystal is attached. Dealing nonlethal damage with the weapon doesn’t activate the crystal’s effect.\n\nEach time you deal damage to a living creature with the weapon to which this crystal is attached, you heal 1 point of damage. When the crystal has healed a total of 10 points of damage, it becomes inert until the following day." compset="Wondrous" summary="Heal 1hp each time you deal damage to a living, up to 10 hps/day">
    <fieldval field="gCost" value="400"/>
    <fieldval field="trkMax" value="10"/>
    <tag group="gType" tag="Wonder"/>
    <tag group="Helper" tag="EquipAvail"/>
    <tag group="Helper" tag="EquipMag"/>
    <tag group="Custom" tag="WpnCrystal" name="Weapon Crystal"/>
    <tag group="Helper" tag="NoPathSoc"/>
    <tag group="iSchool" tag="Necromancy"/>
    <tag group="Helper" tag="ShowSpec"/>
    <eval phase="Final">if (this.field[gIsEquip].value = 1) then
  perform this.assign[User.Tracker]
endif</eval>
    </thing>
Adam.Ormond is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old May 9th, 2011, 05:44 PM
As before - what do these do? What rules are you trying to implement?

And just as a note, I have to read so much code during the day that my eyes just glaze over if I see large blocks of code included in a question. I'd much rather you describe what you're trying to accomplish, and then describe what portions of that you have been able to accomplish and what portions you are not sure about.
Mathias is offline   #2 Reply With Quote
Adam.Ormond
Senior Member
 
Join Date: May 2010
Location: Maryland
Posts: 167

Old May 9th, 2011, 06:34 PM
A Weapon Crystal attaches to a weapon. Ideally, weapons would be gearholders that could hold one Weapon Crystal, but I think that'd be a lot of work involving recreating every weapon as a gearholder.

I'd like to tie a Weapon Crystal magic item to a specific Weapon. If multiple Weapon Crystals are tied to a single weapon, an error should occur.

I have the Weapon Crystal defined as a Wondrous Item right now. I have the first "Select from..." option setup for a user to define an Energy Type. The "Second Selection from..." I've tried "All Weapons" and "All Picks on Hero", but that doesn't seem to work at all (just shows me two options: Ranged Touch and Unarmed). I've also tried "Melee Weapons" and "All Picks on Hero", and that shows me the melee weapons I've picked, but it hides the first "Select from...".

edit: I just swapped the order of the First and Second Selections, and that is now working. Now I just need an Eval Rule -- I'm not quite sure how to proceed. I can find all my Weapon Crystal picks and Weapon picks, but I'm having trouble figuring out how to determine what the user selected on the Weapon Crystal to know if multiple Weapon Crystals share the same weapon.

And why doesn't "All Weapons" list work? A Weapon Crystal shouldn't be limited to melee weapons -- a hack would be to create two types of weapon crystals for each, one that ties to Ranged and one for Melee.
Adam.Ormond is offline   #3 Reply With Quote
evilash
Member
 
Join Date: Sep 2009
Posts: 55

Old May 9th, 2011, 09:22 PM
I would probably do weapon and armor crystals as Item Powers instead of Wondrous Items.
evilash is offline   #4 Reply With Quote
chiefweasel
Senior Member
 
Join Date: Aug 2008
Location: Miamisburg, OH
Posts: 1,322

Old May 10th, 2011, 04:53 AM
The 3.5 MIC had these crystals that went into slots for weapons and armor. I always thought they would be a good item but touch to code. i would most likely go with Evilash's idea. make them each a specific wonderour item and pit an activation button on it. then have the ability effect the weapon or armor. that way you would need to mess with each weapon and armor individually.

Web site - Cheese Weasel Logistics - www.cheeseweasel.net
Twitter - @CheeseWeaselGMZ
For user created content check out www.d20pfsrd.com and www.cheeseweasel.net
For video demos of Hero Lab go to http://www.youtube.com/user/TheChiefweasel?blend=9&ob=5
chiefweasel is offline   #5 Reply With Quote
Adam.Ormond
Senior Member
 
Join Date: May 2010
Location: Maryland
Posts: 167

Old May 10th, 2011, 05:32 AM
I have the tracker currently set on the Wondrous Item, but I'd like to tie it to the weapon. Is it possible to set the parent's trkmax if I don't know the parent's thingid?
Code:
perform this.parent.assign[User.Tracker]
var parentPick as string
parentPick = this.parent.idstring
#trkmax[parentPick] = 30
If anyone's interested in how I have this thing defined, below is the definition:
Item Power: Life Drinking, Least
Code:
  <thing id="ipLfeDrnk1" name="Life Drinking (Least)" description="Each time you deal lethal damage to a living creature with this weapon, you heal 1 point of damage. When the weapon has healed a total of 10 points of damage, this power becomes inactive until the following day." compset="ItemPower" summary="Heal 1hp each time you deal lethal damage to a living creature,  up to 10 hps">
    <tag group="PowerType" tag="Weapon"/>
    <tag group="Helper" tag="NoPathSoc"/>
    <tag group="Custom" tag="WpnCrystal"/>
    <tag group="Custom" tag="wcLfeDrnk2"/>
    <tag group="Helper" tag="NotMagicPw"/>
    <eval phase="Final">perform this.parent.assign[Custom.WpnCrystal]
perform this.parent.assign[Custom.wcLfeDrnk1]
</eval>
    <evalrule phase="Validation" index="2" message="Only one weapon crystal may be attached to a weapon">validif (this.parent.tagcount[Custom.WpnCrystal] = 1)</evalrule>
    <prereq message="Wondrous Item: Crystal of Life Drinking, Least must be equipped">
      <validate>validif (hero.childfound[ioLfeDrnk1].field[gIsEquip].value = 1)</validate>
      </prereq>
    </thing>
Wondrous Item: Crystal of Life Drinking, Least
Code:
<thing id="ioLfeDrnk1" name="Crystal of Life Drinking, Least" description="This transparent black crystal has a faint, sickly glow.\n\nA crystal of life drinking bestows a small amount of life energy upon you each time you damage a living creature with the weapon to which the crystal is attached. Dealing nonlethal damage with the weapon doesn’t activate the crystal’s effect.\n\nEach time you deal damage to a living creature with the weapon to which this crystal is attached, you heal 1 point of damage. When the crystal has healed a total of 10 points of damage, it becomes inert until the following day." compset="Wondrous" summary="Heal 1hp each time you deal damage to a living, up to 10 hps/day">
    <fieldval field="gCost" value="400"/>
    <fieldval field="trkMax" value="10"/>
    <fieldval field="iCL" value="5"/>
    <tag group="Helper" tag="EquipAvail"/>
    <tag group="Helper" tag="EquipMag"/>
    <tag group="Helper" tag="NoPathSoc"/>
    <tag group="iSchool" tag="Necromancy"/>
    <tag group="gType" tag="Wonder"/>
    <tag group="Custom" tag="wcLfeDrnk1"/>
    <eval phase="Final">if (this.field[gIsEquip].value = 1) then
  perform this.assign[User.Tracker]
endif</eval>
    <evalrule phase="Validation" message="Crystal must be attached to a weapon"><![CDATA[var crystals as number
crystals = 0
var attached as number
attached = 0

if (this.field[gIsEquip].value = 1) then
  foreach pick in hero where "Custom.wcLfeDrnk1"
    if (eachpick.tagis[gType.Wonder] <> 0) then
      crystals += 1
    elseif (eachpick.tagis[IsWeapon.?] <> 0) then
      attached += 1
    endif
  nexteach
endif

@valid = 0
if (this.field[gIsEquip].value = 0) then
  @valid = 1
elseif (crystals = attached) then
  @valid = 1
endif]]></evalrule>
    </thing>

Last edited by Adam.Ormond; May 10th, 2011 at 07:47 AM.
Adam.Ormond is offline   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old May 10th, 2011, 07:39 AM
BTW,

Code:
 
this.
is assumed at the beginning of every line in a script in Hero Lab, and you don't need to keep typing it yourself.
Mathias is offline   #7 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old May 10th, 2011, 07:41 AM
parent.field[trkMax].value = 30
Mathias is offline   #8 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old May 10th, 2011, 07:42 AM
You did note that trkMax is already in use for many weapons - the count of a stack of daggers, for example.
Mathias is offline   #9 Reply With Quote
Adam.Ormond
Senior Member
 
Join Date: May 2010
Location: Maryland
Posts: 167

Old May 10th, 2011, 07:52 AM
Quote:
Originally Posted by Mathias View Post
You did note that trkMax is already in use for many weapons - the count of a stack of daggers, for example.
Ah yes, good point; I had already forgotten I'm going to break that if I set the trkmax on the parent, won't I? I suppose I need to keep the tracker on the Wondrous Item.
Adam.Ormond is offline   #10 Reply With Quote
Reply


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:49 PM.


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