Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
Okay.
Bound trtUser: Traits, 1000 Calc trtFinal: Traits, 3001 Calc trtFinal 2: Traits, 9000 baseCost is on component Trait and then defined on the things themselves. I haven't changed how that works, as far as I know! For example: Code:
<thing id="skAdmin" name="Administration" compset="Skill" isunique="yes" description="Description goes here"> <fieldval field="trtAbbrev" value="Admin"/> <fieldval field="baseCost" value="4"/> <fieldval field="skType" value="Broad"/> <tag group="explicit" tag="6000"/> <tag group="Skills" tag="Broad"/> <tag group="Profession" tag="Diplomat"/> <link linkage="attribute" thing="attrWil"/> </thing> Again, my thought for the trtBonus field was to count the number of advance tags for that skill. In the Administration skill above, it would be [IsAdvance.skAdmin]. I don't know how to dynamically create that to do a tagcount on it. Thanks! edg |
#111 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
Please re-read my post 102 in this thread. In that thread, I tried to explain how to set up a system that adds bonuses and calculates the costs at the same time. If I didn't explain well enough, please ask.
The mechanism I'm proposing has nothing to do with tagcounts. |
#112 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
Quote:
Sorry. I have had a bad week for sleep and comprehension. edg |
|
#113 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
Mathias, I think I will need more explanation on the how the advances work.
I am trying to increase a skill by increasing it's trtBonus field every time it is picked. (This is in advancement.core, under component CanAdvance. Code:
<eval index="4" phase="Traits" priority="2000"><![CDATA[ ~we only worry about this on actual advances - not traits added at creation doneif (tagis[Advance.Gizmo] = 0) ~increase and decrease advancements often need to look up the base value of the thing they're working with if (origin.parent.tagis[Advance.Increase] + origin.parent.tagis[Advance.Decrease] + origin.parent.tagis[Advance.AddNew] <> 0) then if (tagis[component.Skill] <> 0 ) then if (tagis[Skills.Specialty] <> 0) then field[trtBonus].value += 1 endif endif endif ]]></eval> This is why I was wondering if I have to do a count on the number of times a specialty skill is increased and put that into trtBonus? I thought it was timing, so I changed the above from 2000 to 3002 because calc trtFinal runs at 3001 and I even added <after name="Calc trtFinal"/> but that doesn't seem to work. The other piece of information is this. I have Gain a New Skill and Advance a skill. I have to use Gain a new Skill the first time to add the Broad skill and then the specialty skill. Those are then gone from the Gain a New Skill list, as they should be. And up until that point, it works. What I have for adding the broad skill and adding the specialty skill (as well as the cost but that's in a different eval) the first time work. The Broad skill is added and the specialty skill is added at rank one. All looks good. It's when I use Increase Skill that it doesn't work. So, I'm stumped as to what I'm doing wrong. Thanks! edg In case they are needed: Gain a New Skill: Code:
<thing id="advNSkill" name="Gain a New Skill" compset="Advance" description="Select a new skill to learn."> <fieldval field="advAction" value="New Skill"/> <fieldval field="advDynamic" value="component.Skill & !FX.Psionics"/> <tag group="Advance" tag="AddNew"/> <!-- Modify tagexpr to deny abilities that have already been added to the character --> <eval index="1" phase="Render" priority="1000"> <before name="Assign Dynamic Tagexpr"/><![CDATA[ ~get the list of all abilities on the hero and assemble it as a list of precluded tags var tagexpr as string tagexpr = hero.tagids[Skill.?," & !"] ~if there are any tags to exclude, append them to the tagexpr appropriately field[advDynamic].text = splice(field[advDynamic].text,tagexpr," & !") ]]></eval> <!-- Attach the child entity for tracking the advance --> <child entity="Advance"> <tag group="Advance" tag="MustChoose"/> </child> </thing> Code:
<thing id="advSkill" name="Increase Skill" compset="Advance" description="Select a skill to increase by one."> <fieldval field="advAction" value="Increase Skill"/> <fieldval field="advDynamic" value="component.Skill & !Helper.Maximum & !Hide.Skill & !Skills.Broad"/> <tag group="Advance" tag="Increase"/> <!-- Attach the child entity for tracking the advance --> <child entity="Advance"> <tag group="Advance" tag="MustChoose"/> </child> </thing> |
#114 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
linkage[basis].field[trtBonus].value
linkage[basis].tagis[component.Skill] linkage[basis].tagis[Skills.Specialty] |
#115 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
Okay, I see that it's the context.
But if I change the line: Code:
field[trtBonus].value += 1 Code:
linkage[basis].field[trtBonus].value += 1 Code:
Linkage pick 'basis' not located for current context Location: 'eval' script for Component 'CanAdvance' (Eval Script '#4') near line 22 Thanks! edg |
#116 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
What type of advance are you testing this on? Only Advance.Increase and Advance.Decrease have a linkage[basis] - Advance.AddNew should not be adding to trtBonus - Advance.AddNew usually adds things at their default ratings, not their default + 1.
|
#117 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
If you do find that you need to use this script to make modifications to Advance.AddNew, you'll just alter the values directly;
field[trtBonus].value tagis[component.Skill] |
#118 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
Mathias, thanks! I have no idea what I was on or doing but that ended up being as simple as you had shown. I was really making it complex. But I got the advances working.
Of course, then something else comes up! I have a Cybertech tab that is basically a specialized Gear tab at the moment. (I copied the Gear tab over to the Cybertech tab.) The automatic setting of the price doesn't work when a thing is picked as it does for gear. (So the "($XX if zero)" on the buy screen.) I have set the choosetemplate="grGrThing", the same as the gear one but that didn't do it. What else needs to be set for that to work on the buy screen? Thanks! edg |
#119 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
This is from tab_gear.dat in the skeleton files.
Code:
<table_dynamic component="Gear" showtemplate="grGrPick" choosetemplate="grGrThing" buytemplate="BuyCash" selltemplate="SellCash"> This is from the Gear component in equipment.str Code:
<component id="Gear" name="Gear" isgear="yes" autocompset="no" ispublic="no"> |
#120 |
|
|