Senior Member
Join Date: Apr 2010
Posts: 152
|
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 Matt Droz Community material (Forgotten Realms & Non-SRD/Retro) |
#1 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
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 Quote:
|
|
#2 |
Senior Member
Join Date: Apr 2010
Posts: 152
|
Got that:
raDrBreath: abValue = 12 abValue2 = 6 abValue4 = 1 BloodEner.Acid Matt Droz Community material (Forgotten Realms & Non-SRD/Retro) |
#3 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
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 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)" |
#4 |
Senior Member
Join Date: Apr 2010
Posts: 152
|
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.
Matt Droz Community material (Forgotten Realms & Non-SRD/Retro) |
#5 |
|
|