Senior Member
Volunteer Data File Contributor
Join Date: Jan 2007
Posts: 591
|
I a trying to script an edge that adds +2 Language slots. How would I do this?
|
#1 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2007
Posts: 591
|
Here is the scrip I am using
hero.child[resLang].field[resMax].value += 2 Phase: Pre Attribute Priority: 5000 Timing: Before scripts Calc trtFinal |
#2 |
Senior Member
Volunteer Data File Contributor
Join Date: Aug 2009
Posts: 1,550
|
This appears to work:
#resmax[resLang] += #trait[attrSma] #resleft[resLang] += #trait[attrSma] Phase: Final Priority: 2000 Timing: Before:Calc trtFinal The first line adds to the maximum number of languages, and the second line adds to the number of languages remaining. This version changes the number of language slots to be equal to Smarts instead of equal to Smarts/2 for the Linguist Edge. If you want to add a specific number of language slots, substitute a number for #trait[attrSma]. |
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232
|
Dartnet's solution is more appropriate. The value of #resleft is set equal to #resmax during the evaluation logic. If you increase the maximum before #resleft is set, then you only have to change one value PLUS any logic that uses #resleft is guaranteed to work as well.
The only change to Dartnet's code would be to use #resleft instead of the expanded syntax. So the line would change to: Code:
#resmax[resLang] += 2 Code:
#resmax[resPowers] += 1 phase = PreTraits priority = 5000 timing before "Calc trtFinal" Given that Dartnet's script uses that exact timing, I'm guessing that he copied the timing from the edge. |
#4 |
|
|