• 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

Trait: Substituting skill bonus attribute

I'm making a trait which switches the attribute bonus from cha to int. I found flexing arm which substitutes str for dex in escape artist attempts and copied it but it's giving errors when i try to load hero lab

the eval script is


Code:
      doneif (tagis[Helper.FtDisable] <> 0)

      #situational[hero.child[skEscape],"+1 trait bonus to free yourself from bondage",field[thingname].text]

      if (#attrbonus[aSTR] > #attrbonus[aDEX]) then
        perform hero.child[skEscape].assign[SkillOver.aSTR]
        endif


which i changed to


Code:
      doneif (tagis[Helper.FtDisable] <> 0)

      #situational[hero.child[skUsemagic],"+1 trait bonus to free yourself from bondage",field[thingname].text]

      if (#attrbonus[aINT] > #attrbonus[aCHA]) then
        perform hero.child[skUsemagic].assign[SkillOver.aINT]
        endif


but on startup i get the following error

Syntax error in 'eval' script for Thing 'prag_act' (Eval Script '#1') on line 4
-> Non-existent thing 'skUsemagic' used by script

I got the skillname "Usemagic" from the trait "Dangerously curious" which gives a bonus to use magic device. I then tried "skUsemagicdevice" just to be sure and it gave me a slightly different error

Syntax error in 'eval' script for Thing 'prag_act' (Eval Script '#1') on line 4
-> Invalid id specified for thing

Anyone able to point out what i'm doing wrong?
 
Anyone able to point out what i'm doing wrong?
Wrong Unique ID for the Skill Use Magic Device. Two ways to solve:

In the script window click on "Find Thing" and enter text "Use Magic Device" that will let you select the skill and insert it into your script.

Second way is go right click on the skill "?" and select "Copy Thing ID".

Either way will get you the correct Thing ID. :)
 
Thanks, i found out the problem was that i didn't capitalise correctly, it's UseMagic not Usemagic

Now that i fixed that and it boots up it doesn't actually seem to be working when i select the trait. My use magic device skill is still using the much lower cha bonus instead of int

I also tried deleting the middle part where it gives the +1 bonus but that didn't change anything.

If i'm reading the last line correctly what it's saying is

if (#attrbonus[aINT] > #attrbonus[aCHA]) then perform hero.child[skUsemagic].assign[SkillOver.aINT] endif

If INT is greater than CHA then for the skill Use Magic Device override the skill with attribute INT?
 
the trait i copied "flexing arm" didn't have any timing so i left it blank. The only other modifications i made was to change the trait category from religion to magic and removed the deity allowed checkbox

It looks like timing allows you to choose the order scripts run in? I don't have any other scripts, the only other two custom traits i've added are text only with no eval script
 
The Timing is the Phase/Priority that you set at the top of the script. I'm betting it says First/100 which is too early for that script to work, I'd change it to Post-Attributes 5000
 
Ok, now i see how the timing bit works.

It was set to pre-levels priority 10000 index 1

I tried setting it to post attributes and post attributes(user) 5000 but still no luck.

Also tried setting it to final phase to try that out
 
Ok I figured out the problem, it's the if statement, the values don't get assigned until sometime during attributes phase so you can't check for those. What you need to use is SkillOpt.skUseMagic instead of Skill Over and assign it Pre-levels 10000 so you're code will look like

Code:
       ~ If we're disabled, do nothing
    doneif (tagis[Helper.FtDisable] <> 0)

    perform hero.child[skUseMagic].assign[SkillOpt.aINT]
 
lol, thank you, so it's not just me then :P

I tried putting it back to pre-levels and that didn't work either.

I removed the if/then and just changed it to

Code:
 doneif (tagis[Helper.FtDisable] <> 0)

        perform hero.child[skUseMagic].assign[SkillOver.aINT]

It works now and since the only reason anyone would take this trait is if they have higher int than charisma anyway the if/then wasn't really necessary.

I've submitted a bug report but i'm wondering whether the issue is that it only applies to "escaping from bondage" rather than escape artist as a whole and something in the code is telling it that?
 
Last edited:
Back
Top