• 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

SetDraWep and SetDraFly

Matt Droz

Well-known member
I just noticed these procedures in the Dragon races to set their special weapons and fly statistics. I'm trying to use SetDraWep for a new dragon, but when I added it to the dragon's Pre-Levels: Priority 9900, I'm getting the following error:

Code:
Attempt to access 'focus' pick from script when no focus exists
Location: Procedure 'SetDraWep' near line 30

Attempt to access 'focus' pick from script when no focus exists
Location: Procedure 'SetDraWep' near line 41

Ideas/Suggestions?
 
I could be wrong but I'm guessing that you need to make sure you have:

raDrBreath

bootstrapped to the race and have the fields abValue, abVaule2, and abValue4 properly set according to what the special says

~ The dragon race should bootstrap this special with an abValue = the
~ number of dice, and abValue2 = to the die size and a BloodEner.? tag
~ for the energy type. Lines should set abValue4 equal to 1. The procedure
~ we call will set the range (stored in abValue3) & livename based on those
~ and the variables we set before calling it.

You also need to have the BloodEner.? tag set to the proper energy type. This is all just my guess looking at the scripts for the items. I can't see the actual procedure but I'm guessing it's trying to do a setfocus on the raDrBreath thing and if it's not there it can't set focus.
 
It's complaining about SetDraWep (which sets the damage and hide-state of dragon natural weapons based on size). I believe the notes you are referring to are talking about the other procedure. Here are both of them, for your examination:

SetDraWep
Code:
    ~ Modified natural weapons according to size... If we are too small hide the
    ~ weapons.

    ~ Handle each weapon in turn, to minimize the number of findchilds we have to do

    ~ Wing is hidden at Small and smaller
    perform hero.findchild[BaseNatWep,"IsWeapon.wWing & SpecSource.TrueDragon"].setfocus

    if (herofield[tSize].value <= -1) then
      perform focus.assign[Hide.Weapon]
      endif

    ~ Tail Slap is hidden at Medium and smaller
    perform state.clearfocus
    perform hero.findchild[BaseNatWep,"IsWeapon.wTailSlap & SpecSource.TrueDragon"].setfocus

    if (herofield[tSize].value <= 0) then
      perform focus.assign[Hide.Weapon]
      endif

    ~ Crush is hidden at Large and smaller, and needs damage set at higher sizes
    perform state.clearfocus
    perform hero.findchild[BaseWep,"IsWeapon.wCrush & SpecSource.TrueDragon"].setfocus

    if (herofield[tSize].value <= 1) then
      perform focus.assign[Hide.Weapon]
    elseif (herofield[tSize].value = 2) then
      perform focus.assign[wMain.2d8_204]
    elseif (herofield[tSize].value = 3) then
      perform focus.assign[wMain.4d6_106]
    elseif (herofield[tSize].value >= 4) then
      perform focus.assign[wMain.4d8_206]
      endif

    ~ Tail Sweep is hidden at Huge and smaller, and needs damage set at higher sizes
    perform state.clearfocus
    perform hero.findchild[BaseWep,"IsWeapon.wTailSweep & SpecSource.TrueDragon"].setfocus

    if (herofield[tSize].value <= 2) then
      perform focus.assign[Hide.Weapon]
    elseif (herofield[tSize].value = 3) then
      perform focus.assign[wMain.2d6_104]
    elseif (herofield[tSize].value >= 4) then
      perform focus.assign[wMain.2d8_204]
      endif

SetDraBre
Code:
    ~ We don't want to overwrite any existing livename that has been set, so
    ~ stop if there is something already in the livename.
    doneif (field[livename].isempty = 0)

    ~ Set the name, range (based on size) and damage of our breath weapon.
    var conebreath as number
    var linebreath as number

    var range as string
    var damage as string

    if (field[abValue4].value <> 0) then
      if (herofield[tSize].value <= -2) then
        field[abValue3].value += 30
      elseif (herofield[tSize].value = -1) then
        field[abValue3].value += 40
      elseif (herofield[tSize].value = 0) then
        field[abValue3].value += 60
      elseif (herofield[tSize].value = 1) then
        field[abValue3].value += 80
      elseif (herofield[tSize].value = 2) then
        field[abValue3].value += 100
      elseif (herofield[tSize].value = 3) then
        field[abValue3].value += 120
      elseif (herofield[tSize].value >= 4) then
        field[abValue3].value += 140
        endif

    else
      if (herofield[tSize].value <= -2) then
        field[abValue3].value += 15
      elseif (herofield[tSize].value = -1) then
        field[abValue3].value += 20
      elseif (herofield[tSize].value = 0) then
        field[abValue3].value += 30
      elseif (herofield[tSize].value = 1) then
        field[abValue3].value += 40
      elseif (herofield[tSize].value = 2) then
        field[abValue3].value += 50
      elseif (herofield[tSize].value = 3) then
        field[abValue3].value += 60
      elseif (herofield[tSize].value >= 4) then
        field[abValue3].value += 70
        endif
      endif

    field[livename].text = "Breath Weapon (" & field[abValue3].value & " ft "

    if (field[abValue4].value <> 0) then
      field[livename].text &= "line, "
    else
      field[livename].text &= "cone, "
      endif

    field[livename].text &= field[abValue].value & "d" & field[abValue2].value & " " & tagnames[BloodEner.?,"/"] & ", every d4 rds)"

Based on looking at those, I would guess the problem is you need to bootstrap the race's natural weapons with the SpecSource.TrueDragon tag.
 
That does look like what the issue was. On another note, however, I'd point out that wCrush and wTailSweep are not in the Natural Attacks choices, so users need to set them directly in the Bootstraps.
 
Back
Top