Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
I'm trying to script a Pre Req for the Psychokinetic Burst [Synergy] property from Magic Item Compendium Pg41.
I've managed to remove the Psychkinetic text from an equipped weapon so it only shows Psychokinetic Burst once added, therefore tidying up character sheet. Works a treat! Remove Script Code:
~ Don't show the previous version of Psychokinetic Weapon, to avoid clutter on the weapon description. perform hero.childfound[ipPsiPsyKi].delete[Helper.ShowSpec] I keep getting an Hero Lab was forced to stop compilation after the following errors were detected: Syntax error in 'pre-requisite rule' script for Thing 'ipPsiPsyKB' on line 1 -> Reference to undeclared variable: 'validif' Script i've tried so far. Code:
Error Message : Psychokinetic property required. validif (hero.childlives[ipPsiPsyKi].tagis[Helper.ShowSpec] <> 0) |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
childlives[] is a question - it will answer 1 if the thing is there, and 0 if it isn't.
You can't transition from childlives[] to tagis[]. Code:
if (hero.childlives[ipPsiPsyKi] <> 0) then validif (hero.childfound[ipPsiPsyKi].tagis[Helper.ShowSpec] <> 0) endif |
#2 |
Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
Thanks for the clarification. I had it in the back of my mind that because I was removing the spechelper Psychokinetic then the burst version was invalidating itself.
I'll try the code later as not got hl with me at moment! |
#3 |
Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
Okay i've tried this script
Code:
~ Check for Psychokinetic property on weapon ~ If we are there then we're valid if (hero.childlives[ipPsiPsyKi] <> 0) then validif (hero.childfound[ipPsiPsyKi].tagis[Helper.ShowSpec] <> 0) endif Screen-shot attached. |
#4 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
The weapon properties don't live in the hero, they live in a special gizmo container within the weapon.
This is why Shock and Shocking burst are two separate item powers, rather than shocking burst being an upgrade of shock. |
#5 |
Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
So is it possible to check for the gizmo for the purposes of a pre requisite script?
|
#6 |
|
|