Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit

Notices

Reply
 
Thread Tools Display Modes
SAbel
Senior Member
 
Join Date: Jul 2007
Location: Walbridge, Ohio
Posts: 761

Old July 9th, 2009, 07:08 PM
Okay so heres my new one
to purchase attributes the cost is the new level *4
example Awareness starts at 2 the cost for making it 3 = 12 (new rank x4, or in this case 3x4=12) if the character wants to go from 2 to 4 the cost is 28 (first 3x4=12 then the next rank 4x4 = 16 so that the total is 12 + 16 = 28) so how do I make this happen?
SAbel is offline   #11 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old July 13th, 2009, 07:06 PM
Please do *NOT* worry about trying to handle character advancement yet. If that's what you're doing, you're getting *way* ahead of yourself.

If the cost of a trait during creation uses the scaling system you describe, you can simply calculate the total cost within a script. You know what the base value of the trait is, right? Then you can calculate the cost of raising it from the base value to its current value. That total value then represents the cost of that attribute.

Hope this helps....
rob is offline   #12 Reply With Quote
SAbel
Senior Member
 
Join Date: Jul 2007
Location: Walbridge, Ohio
Posts: 761

Old July 14th, 2009, 08:58 AM
Hello Rob I am no were near advancement yet!
(but the mechanic stays the same so)
When createing a character in L5R the player starts with 45 CP (character points) on attributes, skills, advantages extra heritage rolls, they may take an additional 10 cp points in disadvantages which adds to the pool making a max of 55 cp to spend.

Abilities cost the next rank * 4 (example if rank {starts at} 2 and player would like it to become 3 the cost is 12 CP (rank 3 * 4 = 12) but if the player wanted to go all the way to 4 the cost would be 28CP (rank 3 {12 points} + rank 4 {16 points})
So I need to find a way to make the cost =new rank * 4.
The player must pick a clan to start in that sets up the next two factors of
Clan Family (which gives a bonus +1 to a set attribute (a few are players choice attirbute) then the Clan school which also gives a +1 to set attribute (a few are players choice attirbute) and the characters starting Koku (money) and outfit (equipment)

Skills work 1 cp to purchase granting rank 1 in the skill then the cost is the new rank ex. Stealth rank 1 would cost 1 cp to go to rank 2 would cost 2 cp and to go to rank 3 would cost 3 cp, as a note a skill can not be raised higher than +2 ranks over the starting value.
Advantages all have a set cost so that is straight forward.
Disavantages add to the CP start total but a play may not add more than 10 points in this manner (they may end up with more through pour heritage results but those would be "free" add)

I also was wondering how to have the system not count the starting attributes when calculating CP. I have the attributes set to 2 (basic setting for the game) but it seems to charge them for the points at the begining.
SAbel is offline   #13 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old July 14th, 2009, 02:23 PM
Here's how to go about this. What you need (as Rob said), is a mathematical formula that expresses the total cost of buying that level, as a function of the level.

So, for attributes:
2 0
3 12
4 28
5 48

If you're good at math, you can derive the formula yourself. My training was in the sciences (I have a BS Biology, and I've now ended up as a computer programmer - go figure), so I was trained in how to get Excel or my graphing calculator to get it for me. You enter that data into excel, produce a scatter plot of it, and then tell Excel to generate a trendline.

What you get for that data above is:

y = 2x^2 + 2x - 12

for skills:

1 1
2 3
3 6
4 10
5 15

in this case:
y = 1/2x^2 + 1/2x

so, the attribute cost function in the skeleton files is:

Code:
 
<!-- Each attribute point above one that is allocated by the user costs 7 CP -->
<eval index="2" phase="Traits" priority="10000">
<before name="Calc resLeft"/>
<after name="Bound trtUser"/><![CDATA[
hero.child[resCP].field[resSpent].value += (field[trtUser].value - 1) * 7
]]></eval>
You'll replace that with:
Code:
 
<!-- Each attribute point above one that is allocated by the user costs 4CP * the level, per level -->
<eval index="2" phase="Traits" priority="10000">
<before name="Calc resLeft"/>
<after name="Bound trtUser"/><![CDATA[
var traitlevel as number
var traitcost as number
var finalvalue as number
 
traitlevel = field[trtUser].value
traitcost = 4
 
finalvalue = traitcost / 2 * (traitlevel * traitlevel + traitlevel)
 
hero.child[resCP].field[resSpent].value += finalvalue - 12
]]></eval>
See how the multiplier for attributes is set up as traitcost = 4

If you calculated the function for attributes from 0, you'd find that level 1 would cost 4 points, and level 2 would cost 8 points, so the finalvalue variable that's been calculated represents the total cost to get to the level we're at. Since level 2 should be free, and it would normally cost 12 points to get there, subtract 12 from finalvalue to get the cost of increasing things from 12.

For skills, you can use the same function. All you have to do is set traitcost = 1 and remove the -12, since there are no free points for skills.
Mathias is offline   #14 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old July 14th, 2009, 02:28 PM
For the use of anyone else working with this sort of character creation point cost, where the value of a trait level is the sum of all the levels that have come before it, the equation is:

y = (trait cost multiplier) /2 * (x^2 + x)
Mathias is offline   #15 Reply With Quote
SAbel
Senior Member
 
Join Date: Jul 2007
Location: Walbridge, Ohio
Posts: 761

Old July 14th, 2009, 08:30 PM
mgehl you are a super genius!! It works perfectly and resets my starting CP so that the default does not count the skills for starting at rank 2.
By the I have a BS in Art Education and have no idea what miracle you made happen in excel and I helped create a grade books system that my school used for nearly 5 years so I am bowing at your screen name right now in praise!

Thanks you rock!
SAbel is offline   #16 Reply With Quote
SAbel
Senior Member
 
Join Date: Jul 2007
Location: Walbridge, Ohio
Posts: 761

Old July 14th, 2009, 09:32 PM
So then the skills would look like this just to double check with what you have typed

The current script
<!-- Each skill point that is allocated by the user costs 2 CP -->
<eval index="2" phase="Traits" priority="10000">
<before name="Calc resLeft"/>
<after name="Bound trtUser"/><![CDATA[
~if this skill is not added directly to the hero (i.e. an advance), skip it entirely
if (origin.ishero = 0) then
done
endif

~adjust the resource appropriately
hero.child[resCP].field[resSpent].value += field[trtUser].value * 2
]]></eval>

The changed script

<!-- Each skill point that is allocated by the user costs the next rank in CP-->
<eval index="2" phase="Traits" priority="10000">
<before name="Calc resLeft"/>
<after name="Bound trtUser"/><![CDATA[
var traitlevel as number
var traitcost as number
var traitvalue as number

traitlevel = field[trtUser].value
traitcost = 1
finalvalue =traitcost / 2 * (traitlevel * traitlevel + traitlevel)
hero.child[resCP].field[resSpent].value += finalvalue
]]></eval>
SAbel is offline   #17 Reply With Quote
SAbel
Senior Member
 
Join Date: Jul 2007
Location: Walbridge, Ohio
Posts: 761

Old July 14th, 2009, 09:51 PM
I may have a typo in there so this is the "fixed version" though I am not sure what id mess up PS to everyone this is located in the traits.str file

<!-- Each skill point that is allocated by the user costs the next rank in CP-->

<eval index="2" phase="Traits" priority="10000">
<before name="Calc resLeft"/>
<after name="Bound trtUser"/><![CDATA[
var traitlevel as number
var traitcost as number
var finalvalue as number

traitlevel = field[trtUser].value
traitcost = 1

finalvalue = traitcost / 2 * (traitlevel * traitlevel + traitlevel)

hero.child[resCP].field[resSpent].value += finalvalue
]]></eval>
SAbel is offline   #18 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old July 14th, 2009, 09:56 PM
Leave in the section (4 lines) that starts "~if this skill is not added directly..." Otherwise, when your character spends XP to learn a new skill later on, it will have to start with field[trtUser].value = 1, because that's the minimum value, and therefore, this script will charge character creation points, while the advancement mechanisms also charge XP.

This doesn't need to be in the attribute section, because you start with all the attributes - you can't add a new one during play.

I hadn't thought to take a look at the skills to see if there was anything else to that script.
Mathias is offline   #19 Reply With Quote
SAbel
Senior Member
 
Join Date: Jul 2007
Location: Walbridge, Ohio
Posts: 761

Old July 14th, 2009, 10:24 PM
Ouch I get an error

The data files could not be loaded due to the following errors:

Syntax error in 'eval' script for Component 'Skill' (Eval Script '#2') on line 15
-> One or more 'if' statements is missing the closing 'endif' statement
One or more timing errors were identified. Please review the timing report and correct the errors. You can access the report under the 'Develop' menu or by clicking this link.

I placed it as follows

<eval index="2" phase="Traits" priority="10000">
<before name="Calc resLeft"/>
<after name="Bound trtUser"/><![CDATA[
~if this skill is not added directly to the hero (i.e. an advance), skip it entirely
if (origin.ishero = 0) then
var traitlevel as number
var traitcost as number
var finalvalue as number

traitlevel = field[trtUser].value
traitcost = 1

finalvalue = traitcost / 2 * (traitlevel * traitlevel + traitlevel)

hero.child[resCP].field[resSpent].value += finalvalue

]]></eval>
SAbel is offline   #20 Reply With Quote
Reply

Thread Tools
Display Modes

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 06:33 PM.


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