Thread: d6 Star Wars
View Single Post
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old September 5th, 2011, 02:44 PM
Quote:
Originally Posted by thedarkelf007 View Post
Star Wars uses a Advancement style similar to Shadowrun's karma advancement.

How can you specify the cost to increase a skill based on the "rank" of the skill and not a default number?

Same for attribute.
You've seen that the cost of an advancement is stored in advCost on the Advance component, right. Okay, so you need to change advCost in a script.

This is handled in the same script that's adding the +1 to that skill/attribute - that way, the cost you're calculating is based on that advancement, and all the advancements to the same thing that came before it, but not any of the advancements that came after it.

I'm presuming that there's a fixed multiplier, and that all attributes have the same multiplier. All skills use the same multiplier as well (which is most likely different from the attribute multiplier). That value you can store on the advancement itself, in thing_advances.dat - add the following line to an advancement to get a x5 multiplier:

Code:
 
<fieldval field="advCost" value="5"/>
Now, to take that multiplier and multiply it by the current value of the thing:

Code:
var basevalue as number
 
~advancements often need to reference their base value in a couple of different places, so put that in a variable now
if (origin.parent.tagis[Advance.Increase] + origin.parent.tagis[Advance.Decrease] <> 0) then
  basevalue = linkage[basis].field[trtUser].value + linkage[basis].field[trtAdvance].value + linkage[basis].field[trtBonus].value + anything else that modifies the value that advancement cost is based upon
  endif
 
if (origin.parent.tagis[Advance.Increase] > 0) then
  linkage[basis].field[trtAdvance].value += 1
  origin.parent.field[advCost].value *= basevalue
elseif (origin.parent.tagis[Advance.Decrease] > 0) then
  linkage[basis].field[trtAdvance].value -= 1
  origin.parent.field[advCost].value *= basevalue
  endif
Note that because you're setting the basevalue aside in a variable before you add the bonus, the cost you calculate will be multiplied by whatever the value of the thing was before adding the advancement, so a x4 multiplier on an advancement from 4 to 5 would mean 16 XP. If it's based on the final value, you can add to basevalue as your're multiplying it:

Code:
 
origin.parent.field[advCost].value *= (basevalue + 1)
Mathias is offline   #19 Reply With Quote