• 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

Changing Attribute for a Skill, as a Trait

ErinRigh

Well-known member
Hoping someone can quickly point me at an example of an ability that changes the relevant ability score for a skill that could be ported over as a Trait, if it is not one already.

Specifically, I am trying to create a trait called Idiot Savant, which requires that you have an Intelligence of 9 or less. If you take this trait, you may choose one Intelligence skill, and perform it with your Wisdom bonus instead.

This is to create an NPC who is really quite simple-minded, but BRILLIANT at making things (Craft) which is intelligence based.

If this sort of code already exists, can someone please point me in the right direction? If it does not exist, can I get someone to help me write it?

Thanks in advance

Erin
 
You just need to assign a SkillOver tag for whatever attribute you want to use instead of the base, to the skill in question.

Did you want to treat all craft skills as a single selection for the purposes of this trait, or would the user select a single craft skill to get the benefit?
 
Code:
~ Find all Craft Skills
foreach pick in hero from BaseSkill where "Helper.SkCatCraft"
  ~ Make the craft skill use Wisdom
  perform eachpick.assign[SkillOver.aWIS]
nexteach
 
Well, first you'd set up a selector on the trait to choose among all intelligence skills plus the "AllKnow" and "AllCraft" skill helpers. Go to "Develop -> Enable Data File Debugging". Use debug and look at, for example, the Appraise skill by right clicking on it and "Show Debug Tags". Do you see the tag in that list which indicates this skill is based off of INT? For the helpers, just use the thingid tags. When building a tag expression, like for this selector | means "or".

Once that is done, make sure you can choose among the correct skills, then move to the next step, which is the eval. I'll rough something out, with some notes on what you need to complete it. The ~ symbol means that line is a note/instruction, and is ignored for the purpose of code

Code:
~ This line is to stop the code from executing if something disables this trait
doneif (tagis[Helper.FtDisable] <> 0)

~ This line stops the code if our selector hasn't chosen anything yet
doneif (field[usrChosen1].ischosen = 0)

~ The following section sees what we have selected, and depending on that applies a skillover tag to one or more skills.

~ First branch is if we picked Craft. XXX is the unique ID for the All Craft helper
if (field[usrChosen1].chosen.tagis[thingid.XXX] <> 0) then
  ~ cycle all the skills with a tag saying they are craft skills. YYY is the tag ID of this tag
  foreach pick in hero from BaseSkill where "Helper.YYY"
    perform eachpick.assign[SkillOver.aWIS]
    nexteach

~ Second branch is if we picked Knowledge. ZZZ is the unique ID for the All Knowledge helper
elseif (field[usrChosen1].chosen.tagis[thingid.ZZZ] <> 0) then
  ~ cycle all the skills with a tag saying they are craft skills. AAA is the tag ID of this tag
  foreach pick in hero from BaseSkill where "Helper.AAA"
    perform eachpick.assign[SkillOver.aWIS]
    nexteach

~ Third branch is not a group of skills, so just assign the SkillOver to what we selected
else
  perform field[usrChosen1].chosen.assign[SkillOver.aWIS]
  endif
 
Back
Top