Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
ErinRigh
Senior Member
 
Join Date: Oct 2016
Posts: 621

Old February 18th, 2017, 09:02 AM
Not really, but I am having problems.

I am trying to code a custom weapon, an artifact, so I need to make it's own entry.

The weapon, a scythe, is both keen edged and a weapon of speed, so I tried to code them into the weapon using copied code from ikeen and ispeed

pre-levels/5000
var result as number
result = container.parent.assign[Helper.Keen]

which gives me the error

Attempt to access non-existent parent pick for a top-level container from script

OK, so I modified some code from a wondrous item to come up with

pre-levels/5000
if (field[gIsEquip].value <> 0) then
foreach pick in hero from BaseWep where "!Helper.ExtraHigh"
perform eachpick.assign[Helper.ExtraHigh]
nexteach
foreach pick in hero from BaseWep where "!Helper.Keen"
perform eachpick.assign[Helper.Keen]
nexteach
endif

This code does what I want it just does it to everything.

My question; How do I modify this code so that it adds the keen quality and speed quality to the weapon without adding it to ALL weapons?
ErinRigh is offline   #1 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old February 18th, 2017, 02:34 PM
Quote:
Originally Posted by ErinRigh View Post
Not really, but I am having problems.

I am trying to code a custom weapon, an artifact, so I need to make it's own entry.

The weapon, a scythe, is both keen edged and a weapon of speed, so I tried to code them into the weapon using copied code from ikeen and ispeed

pre-levels/5000
var result as number
result = container.parent.assign[Helper.Keen]

which gives me the error

Attempt to access non-existent parent pick for a top-level container from script
You are attempting to take code from a weapon power and use it on the weapon. As a result, this error is expected. Remove the reference to container, and it will work. And not to sound like a broken record, but you can further simplify by removing the use of a variable and replacing it with the perform function, as such:

Code:
perform assign[Helper.Keen]
Of course, if all you want to do is assign a tag to the item, you can forget the script completely and assign it in the editor by pressing the Tags button in the upper right and adding the tag directly. Enter "Helper" as the Group Id and "Keen" as the Tag Id.

Quote:
OK, so I modified some code from a wondrous item to come up with

pre-levels/5000
if (field[gIsEquip].value <> 0) then
foreach pick in hero from BaseWep where "!Helper.ExtraHigh"
perform eachpick.assign[Helper.ExtraHigh]
nexteach
foreach pick in hero from BaseWep where "!Helper.Keen"
perform eachpick.assign[Helper.Keen]
nexteach
endif

This code does what I want it just does it to everything.

My question; How do I modify this code so that it adds the keen quality and speed quality to the weapon without adding it to ALL weapons?
This is also not surprising. Let's take a closer look at what we're doing here.

Code:
foreach pick in hero from BaseWep where "!Helper.ExtraHigh"
This line says, "for every weapon this character has that does not have the Helper.ExtraHigh tag assigned to it, do the following".

Taking a look at your script, it appears all you really want to do is assign the Helper.ExtraHigh tag. As above, I would forget using the script and add the tag manually. The only reason to use a script would be if the abilities required activation or could only be used a certain number of times.
Sendric is offline   #2 Reply With Quote
ErinRigh
Senior Member
 
Join Date: Oct 2016
Posts: 621

Old February 18th, 2017, 09:36 PM
Thanks mate
ErinRigh is offline   #3 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 06:51 PM.


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