|
Senior Member
Join Date: Jul 2007
Location: Walbridge, Ohio
Posts: 767
|
Hey all,
I am still working L5R (I know its taking me forever, but I am not a prgram) ok so I have this working but I have one snag. In L5R you have two abilities that make one Ring Ie Reflexes and Awareness (the game calls these Traits, I have them as Attributes ie attrRef and attrAwa) combine and the lower of the two make the score for the Air Ring( I have the the Rings made as Traits for the program so trAir). This all works. A player may increase a trait by spending exp/CP at the start the cost is = to the new trait level * 4 ie reflex of 2 to increase to reflex of 3 cost 12 points (3*4=12) BUT Because it has no Traits, the Void Ring may be increased on its own. This is more expensive. Increasing a character’s Void Ring costs a number of points equal to six times the new rank. For example, increasing a character’s Void Ring from 2 to 3 would cost 18 Experience Points. I have Void as a Trait so I am stuck on how to make only the Void cost *6 when I have the other still *4? Here is the trait.str lines I have for trait cost: <!-- Each attribute point above one that is allocated by the user costs 4CP * the level, per level --> <eval index="3" 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> Thanks for any help everyone. Sean |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
See how you have traitcost = 4 in your script?
How about storing that in a field whose value you can define in thing_attributes.dat and thing_traits.dat? Add this to the traits component in traits.str: Code:
<field id="trtCPCost name="CP Cost Multiplier" type="derived"> </field> Code:
traitcost = 4 Code:
traitcost = field[trtCPCost].value Code:
<fieldval field="trtCPCost" value="4"/> Last edited by Mathias; April 23rd, 2011 at 10:35 AM. |
#2 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
(or, you can skip defining all those variables as intermediate steps):
Code:
<!-- Each attribute point above one that is allocated by the user costs 4CP * the level, per level --> <eval index="3" phase="Traits" priority="10000"> <before name="Calc resLeft"/> <after name="Bound trtUser"/><![CDATA[ hero.child[resCP].field[resSpent].value += (field[trtCPCost].value / 2 * (field[trtUser].value ^ 2 + field[trtUser].value)) - 12 ]]></eval> |
#3 |
Senior Member
Join Date: Jul 2007
Location: Walbridge, Ohio
Posts: 767
|
Mathias
First off thanks that is working method 1. BUT Now my starting character points is off (it should be 40/40 but it shows 34/40). This is my traits.str line <!-- Each attribute point above one that is allocated by the user costs 4CP * the level, Void is *6CP, per level --> <eval index="3" 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 = field[trtCPCost].value finalvalue = traitcost / 2 * (traitlevel * traitlevel + traitlevel) hero.child[resCP].field[resSpent].value += finalvalue - 12 ]]></eval> I am guessing its in here some place? |
#4 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Can you give me the breakdown of what goes into the 34/40?
How many things are being added into that? What are their trtUser values and trtCPCost values? |
#5 |
Senior Member
Join Date: Jul 2007
Location: Walbridge, Ohio
Posts: 767
|
Hey Happy Easter Mathias and all,
I have included examples of the files and what I am pulling them out of I hope this is not to long but I do not want to leave something out, I hope this covers the "bases" Sean From the actor.str <!-- Starting character points to allocate --> <field id="acStartCP" name="Character Points" type="user" defvalue="40"> </field> from my thing_traits.dat file an example of <!-- Water Trait --> <thing id="trWater" name="Water" compset="Trait" isunique="yes" description="Water is the least static element, ever changing. It is the element of strength and clarity. Water is represented by the twin Traits of Perception and Strength."> <fieldval field="trtAbbrev" value="Water"/> <tag group="explicit" tag="2"/> <eval index="1" phase="Traits" priority="4000"> <before name="Derived trtFinal"/> <after name="Calc trtFinal"/><![CDATA[ ~Water is the lower of the character's Perception and Strength. field[trtBonus].value += minimum(hero.child[attrPerc].field[trtFinal].value, hero.child[attrStr].field[trtFinal].value) ]]></eval> </thing> <!-- Void Trait --> <thing id="trVoid" name="Void" compset="Attribute" isunique="yes" description="Void is poorly understood by mortals, who seek quantify all things. It is everything and nothing and it binds the four rings together."> <fieldval field="trtAbbrev" value="Void"/> <fieldval field="trtUser" value="2"/> <fieldval field="trtCPCost" value="6"/> <tag group="explicit" tag="9"/> <tag group="AllowAttri" tag="Attribute"/> <eval index="1" phase="Traits" priority="4000"> <before name="Derived trtFinal"/> <after name="Calc trtFinal"/><![CDATA[ ~ field[trtBonus].value = 0 ~Void does not have traits associated with it. Instead, a character gains a number of Void points per day equal to his Void Ring. ]]></eval> </thing> AND then from the thing_attributes.dat example: <!-- Reflexes Attribute --> <thing id="attrRef" name="Reflexes" compset="Attribute" isunique="yes" description="measures how quickly characters can react to events unfolding around them."> <fieldval field="trtAbbrev" value="Ref"/> <fieldval field="trtUser" value="2"/> <fieldval field="trtCPCost" value="4"/> <tag group="explicit" tag="7"/> <tag group="AllowAttri" tag="Attribute"/> </thing> |
#6 |
Senior Member
Join Date: Jul 2007
Location: Walbridge, Ohio
Posts: 767
|
I have an attached file too from the traits.str which is what I think you are asking me about the info.
|
#7 |
Senior Member
Join Date: Jul 2007
Location: Walbridge, Ohio
Posts: 767
|
For charater creation CP starts at 40, then the player can use it to
1. raise traits (which I have as attributes in the programing, two per Ring) or void 2. buy skills 3.buy advantages (still working on making this happen) 4. increase starting CP by taking disadvantages (still working on making this happen) End character CP points. |
#8 |
|
|