• 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

Odd scripting behaviour

The One

Member
Ok, well I say odd, it's understandable but I'm not sure on the correct syntax to use.

Basically, trying to add a Torch to couple with the feat from Goblins of Glorian, Fire Hand, which gives weapon proficiency in the torch, and grants +1 to attack with it.

So the script currently is as follows.

if (#hasfeat[fFIreHand] <> 0) then
perform hero.assign[WepProf.wTorch]
foreach pick in hero from BaseWep where "IsWeapon.wTorch"
eachpick.field[wAttBonus].value += 1
nexteach

endif

foreach pick in hero from BaseWep where "IsWeapon.wTorch"
#extradamage[eachpick," plus 1 fire",field[livename].text]
nexteach

The problem I'm getting is that both of the foreach scripts add one iteration per copy of the torch weapon, so if I have 2 torch weapon entries (for dual weilding pyromanic goodness), I end up with getting +2 to attack, and the damage reading +1 fire +1 fire.

Any suggestions as to alternative scripts that I can use? Unfortunately I can't modify the feat to include the script (which I suspect may help matters) as the feat is from a suppliment and non-cloneable.
 
Any suggestions as to alternative scripts that I can use? Unfortunately I can't modify the feat to include the script (which I suspect may help matters) as the feat is from a suppliment and non-cloneable.
You can do "new copy" against the feat. Then do "new blank" to create a new feat where you manually copy all the settings from the Fire Hand to your new "Fire Hand" feat. Then use the "Replace Thing ID" setting to override your version with the official one.
 
Just in case this comes up for anyone else, figured out a solution which works

My main issue turned out to be trying to apply the #extradamage during the wrong phase, it needed to be within Postlevels /10000, whilst the assigning weapon proficiency needed to remain within First /5000


The two scripts were

Code:
      if (#hasfeat[fFIreHand] <> 0) then
        perform hero.assign[WepProf.wTorch]
      endif

and then

Code:
If (container.ishero = 0) then
  #extradamage[container.parent, "+1 fire" ,field[name].text]
  if (#hasfeat[fFIreHand] <> 0) then
    field[wAttBonus].value += 1
  endif
else
  #extradamage[this, "+1 fire" ,field[name].text]
  if (#hasfeat[fFIreHand] <> 0) then
    field[wAttBonus].value += 1
  endif
endif

That gives me a weapon which gives +1 fire damage all the time, and if the relevant feat is selected, also gives weapon proficiency in it.
 
Back
Top