Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Savage Worlds
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
dartnet
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2007
Posts: 591

Old September 26th, 2010, 11:45 AM
I a trying to script an edge that adds +2 Language slots. How would I do this?
dartnet is offline   #1 Reply With Quote
dartnet
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2007
Posts: 591

Old September 26th, 2010, 03:49 PM
Here is the scrip I am using

hero.child[resLang].field[resMax].value += 2

Phase: Pre Attribute
Priority: 5000
Timing: Before scripts Calc trtFinal
dartnet is offline   #2 Reply With Quote
CapedCrusader
Senior Member
Volunteer Data File Contributor
 
Join Date: Aug 2009
Posts: 1,550

Old April 23rd, 2011, 03:43 AM
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].
CapedCrusader is offline   #3 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old April 23rd, 2011, 11:56 AM
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
In situations like this, it's best to look for existing mechanics that do similar things. For example, the "New Power" edge increases the number of arcane powers by one. This is analogous to increasing the number of languages. The script for that edge is:

Code:
#resmax[resPowers] += 1
It has timing characteristics of:
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.
rob is offline   #4 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:22 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.