• 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

Modifying Animal Companion

I believe setfocus has to end on a pick, after the "minion" transition you are effectively at a new actor (equivalent to being at "hero." but on a new creature).

As for still getting an error, I tested that code on an adjustment and it worked alright. There must be something else going on to interfere. Why don't you post the current state of your code including where you pasted that, so I can see it in context. Also, please post the error you're still getting.
 
Last edited:
Code:
~ If we're not shown, just get out now
      doneif (tagis[Helper.ShowSpec] = 0)

   doneif (hero.childlives[cAnimComp] = 0)


hero.childfound[cAnimComp].minion[AnimComp].child[aSTR].field[aStartMod].value -= 2
hero.childfound[cAnimComp].minion[AnimComp].child[aDEX].field[aStartMod].value += 4
hero.childfound[cAnimComp].minion[AnimComp].child[aINT].field[aStartMod].value += 2
hero.childfound[cAnimComp].minion[AnimComp].child[aCHA].field[aStartMod].value += 2
#situational[hero.childfound[cAnimComp].minion[AnimComp].child[svAll], "+4 against mind-affecting effects", field[name].text]
hero.childfound[cAnimComp].minion[AnimComp].child[ArmorClass].field[tACNatural].value -= 1

perform hero.childfound[cAnimComp].minion[AnimComp].child[skAcrobat].assign[Helper.ClassSkill]
perform hero.childfound[cAnimComp].minion[AnimComp].child[skBluff].assign[Helper.ClassSkill]
perform hero.childfound[cAnimComp].minion[AnimComp].child[skFly].assign[Helper.ClassSkill]
perform hero.childfound[cAnimComp].minion[AnimComp].child[skStealth].assign[Helper.ClassSkill]

if (field[xAllLev].value >= 15) then
   field[abValue].value += 10
elseif (field[xAllLev].value >= 5) then
   field[abValue].value += 5
endif

hero.childfound[cAnimComp].minion[AnimComp].child[xDamRdIron].field[abValue].value += field[abValue].value

perform hero.childfound[cAnimComp].minion.child[xDamRsCold].setfocus
      
      doneif (state.isfocus = 0)
      
     focus.field[abValue].value = maximum(focus.field[abValue].value, 10)
perform hero.childfound[cAnimComp].minion.child[xDamRsElec].setfocus
      
    doneif (state.isfocus = 0)
      
      focus.field[abValue].value = maximum(focus.field[abValue].value, 10)
if (field[xAllLev].value >= 7) then
   field[abValue2].value = round(hero.childfound[cAnimComp].minion[AnimComp].child[Speed].field[tSpeed].value * 1.5, 0, -1)
   hero.childfound[cAnimComp].minion[AnimComp].child[xFly].field[abValue].value += field[abValue2].value
      if (hero.childfound[cAnimComp].minion[AnimComp].child[xFly].tagis[Maneuver.Good] <> 0) then
        perform hero.childfound[cAnimComp].minion[AnimComp].child[xFly].assign[Maneuver.Perfect]
	  else
	    perform hero.childfound[cAnimComp].minion[AnimComp].child[xFly].assign[Maneuver.Good]
	  endif
endif

Code:
Attempt to access non-live child pick 'xDamRsCold' from script
- - -
Attempt to access non-live pick via script fails for pick 'xDamRsCold'

I also get the error for xDamRsElec if that is the first one listed.
 
Last edited:
You have to clear the focus before setting it a second time.

Code:
    perform hero.childfound[cAnimComp].minion.child[xDamRsCold].setfocus
    
    doneif (state.isfocus = 0)
    
    focus.field[abValue].value = maximum(focus.field[abValue].value, 10)

[B]perform state.clearfocus[/B]

    perform hero.childfound[cAnimComp].minion.child[xDamRsElec].setfocus
    
    doneif (state.isfocus = 0)
    
    focus.field[abValue].value = maximum(focus.field[abValue].value, 10)
 
Alright, so after fiddling and comparing, for some reason the previous code seems to work for Damage Reduction, but not for Damage Resistance (it was originally taken from the Nature Warden's Silverclaw ability). Both are present on all heroes, so why is it working for one but not the other? I've no bloody clue, and that annoys me.

Try this:

PostLevel 10000
Code:
  hero.childfound[cAnimComp].minion[AnimComp].child[xDamRsFire].field[abValue].value = maximum(hero.childfound[cAnimComp].minion[AnimComp].child[xDamRsFire].field[abValue].value,field[abValue].value)

It's getting towards the end of the month, and I've got a lot of work to do prepping for the release next week. I do want to help you but if this doesn't work, I'm going to have to beg off until next month, when we have the release out. If you're still having trouble with this then, I'll take another crack at it.
 
Alright, got the "What" of this figured out, and I've fixed it for the next release, though I'm not completely clear on the "Why". As part of the Celestial Servant feat, we've got a copy of the Celestial template bootstrapped to all animal companions, which looks for certain conditions before becoming live. Since Celestial was created before we bootstrapped all Damage Resistances to all heroes, it was bootstrapping a couple resistances it would have needed back then. Because of that, the Unique DamRs specials were not going live because their root was not live, and that was why you were getting errors when you tried to access or manipulate those specials. Until next release it looks like there's no good way to manipulate Acid, Cold, or Electricity damage resistance (Fire and Sonic are fine), or Evil Damage reduction.

I've sent your file back through the e-mail, with minor changes, so that it remains secure.
 
Back
Top