• 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

Coding to add skill ranks

ErinRigh

Well-known member
Hey group!

I am trying to code some skills so that adding ranks to one skill automatically adds ranks to another skill; so that, for example, adding 5 ranks to Rituals: Cha will automatically add the same number to Rituals: Con.

This is what I came up with, what am I missing?

Pre-Attrib (User)/5000

var Ritranks as number
Ritranks = #skillranks[kRitualCha]

hero.child[kRitualCon].field[kUserRanks].value = hero.child[kRitualCon].field[kUserRanks].value + Ritranks
 
If I remember correctly, skill ranks are part of an array (skills x classes) so when you are adding "ranks" you will have to identify which class the ranks are being added under. I'm not sure about the specifics of your usage, but you may want to add additional ranks to the class to compensate for these ranks.

It might be easier to just apply the ranks of Rituals (cha) as a bonus to Rituals (con). Though I understand this would allow the players to bypass the skill point cap imposed by level.
 
Hey group!

I am trying to code some skills so that adding ranks to one skill automatically adds ranks to another skill; so that, for example, adding 5 ranks to Rituals: Cha will automatically add the same number to Rituals: Con.

This is what I came up with, what am I missing?

Pre-Attrib (User)/5000

var Ritranks as number
Ritranks = #skillranks[kRitualCha]

hero.child[kRitualCon].field[kUserRanks].value = hero.child[kRitualCon].field[kUserRanks].value + Ritranks

One way you could do it is by creating a synergy ( I think that is what you are referring)

I do it like this, though those more learned than I may have a better way.

In the Eval Scripts

Phase:Prelevels Priority: 10000
if (#skillranks[kHandleAnm] >= 5) then
field[Bonus].value = field[Bonus].value + 2
endif

In this case I was adding a synergy to a profession: Animal Trainer using a synergy with the Skill: Handle Animal.
 
If you place this eval script into the Rituals: CON skill, it will increase automatically when you add ranks to Rituals: CHA.

Code:
Pre-Levels/6000

field[kUserRanks].value += #skillranks[kRitualCha]

The problem here is if the user decides to add point to Rituals: CON, it does not automatically increase Rituals: CHA. I don't know how to resolve that yet, but if it's needed I can try to look into it some more.
 
@Erin,
I guess I don't fully understand what it is you are trying to accomplish.

In my first read through I thought it was 2 skills that gave bonuses to each other (similar to synergy), but using skill ranks to limit the total bonus for the 2 skills.

Now I am thinking it is a single skill (like Intimidate) that is either invoked through physical prowess, or force of personality. This leads me to ask, do you really need both skills, or would a single skill using the higher attribute bonus work?
Code:
Post-attributes/ any time before 10000
~ this is to set our attribute bonus to the greater of our Con or Cha modifiers
if (hero.child[aCON].field[aModBonus].value > hero.child[aCHA].field[aModBonus].value) then
field[kAttrValue].value = hero.child[aCON].field[aModBonus].value
else
field[kAttrValue].value = hero.child[aCHA].field[aModBonus].value
endif

If you do need both skills listed separately, are they supposed to have the same non-attribute bonuses, or do they increase individually? For example, would Skill Focus: Ritual(cha) improve the Ritual(con) skill?

~if you are just matching the ranks but not other bonuses, here is a pair of eval scripts to add to R-Con

Code:
Pre-levels/6000
~ as sendric pointed out, but note it is Pre-levels and not Pre-levels (Users)

~ this will add our ranks in RitualCha to RitualCon
field[kUserRanks].value += #skillranks[kRitualCha]

Code:
any time before Pre-levels/5000

~ this is to prevent us from adding ranks to RitualCon except through RitualCha
trustme
field[kValue0].value = 0
field[kValue1].value = 0
field[kValue2].value = 0
field[kValue3].value = 0
field[kValue4].value = 0
field[kValue5].value = 0
field[kUserPts].value = 0
 
Last edited:
Back
Top