• 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

Custom Weapon Creation Question

gauldin

Active member
I'm creating a new weapon for my Bard to use, a Crystal Echoblade (stolen I think from 3.5). I created the weapon in the editor (using Rapier as the starting point) and can add a normal version to my character just fine. However, if I try to add a Magic or Masterwork version (e.g. to give it +1), I get this error:

Attempt to access non-existent child pick 'wMAGCrysBl' from script

(it comes up 3 times actually). 'wMAGCrysBl' is the unique ID I gave the new weapon.

I'm sure I've overlooked something simple in creating the new weapon - can anyone tell me what I've done? Thanks!
 
Did you put a script on the weapon?

Honestly from that little info I don't know. My advice would be to post the .user file and I can take a quick look tonight. Otherwise what you did starting from the Rapier is the right move.
 
Re: Weapon Script

Yes, I did create a script to add Sonic damage equal to half your Bard level - here's the script:

hero.child[wMAGCrysBl].field[wDamExtra].text = " + " & round(hero.child[cBard].field[cLvlIndex].value/2,0,1)

hero.child[wMAGCrysBl].field[wDamExtra].text &= " Sonic"

I've attached the .user file (at least I hope so - first time using this forum).

Thanks in advance for your help!
 

Attachments

Yes, I did create a script to add Sonic damage equal to half your Bard level - here's the script:

hero.child[wMAGCrysBl].field[wDamExtra].text = " + " & round(hero.child[cBard].field[cLvlIndex].value/2,0,1)

hero.child[wMAGCrysBl].field[wDamExtra].text &= " Sonic"

I've attached the .user file (at least I hope so - first time using this forum).

Thanks in advance for your help!
Yea from what I can see is the problem is in the script. You see once you made it into a magic weapon it was placed inside a Gizmo. This means their is NO child thing "wMAGCrysBl" that is live on the hero. Your script says find the the child thing "wMAGCrysBl" which is not live.

Try this. I am not near HL currently but I think this should work. I removed some of your code and replaced with macros with are those things that start with #. Also you want to make sure this is running at post-levels/10000 at least otherwise the Bard levels will not have been calculated yet.

Code:
var Damage as string

~ Build damage bonus
Damage = " + " & round(#levelcount[Bard]/2,0,1) & " Sonic"

~ If we are on the gizmo
If (container.ishero = 0) then
  #extradamage[container.parent, Damage ,field[name].text]
~ If not on a gizmo
else
  #extradamage[this, Damage ,field[name].text]
endif
 
That did the trick - thanks! I've just started using Hero Lab and so far my "training" on the editor consists of watching your videos and reading Mathias' posts. I clearly need to understand the whole container structure better, but it's surprising to me how easy it is to just jump in and start to actually do something useful. I appreciate you taking time to help me out.
 
Back
Top