• 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

Well, now I've gone and done it!

ErinRigh

Well-known member
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?
 
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.

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.
 
Back
Top