Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
Hmmm. I'm going to have to look at this some more. I do see how timing caused the xp cost to fail.
The problem I see is that cost is going to vary based on which attribute is chosen. However, as soon as they pick "Increase Attribute" though, Increase Attribute runs its evals and applies a cost, before they pick which ability! So, is that timing as well? Or do I need to run the cost script on the tab instead? Or should I just make twelve advances for attributes, two for each one, and put them all under Gain a New Ability choices? |
#101 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,214
|
In Shadowrun, I had to move the calculation of advCost into the same script in the CanAdvance component that handles adding the trtBonus for advancements. I also had to re-construct trtFinal within that script, so that I could use the un-modified value to calculate the cost of that advancement:
Code:
~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] <> 0) then if (tagis[component.SkillIndiv] <> 0) then basevalue = maximum(linkage[basis].field[trtUser].value, linkage[basis].field[sklGroup].value) + linkage[basis].field[trtAdvMod].value + linkage[basis].field[trtBase].value + linkage[basis].field[trtBonus].value else basevalue = linkage[basis].field[trtUser].value + linkage[basis].field[trtAdvMod].value + linkage[basis].field[trtBase].value + linkage[basis].field[trtBonus].value endif The way it ends up happening is that each item on the advances table runs that script - they calculate their own advCost, and then they add +1 to trtBonus. Then, the next item on the advances table runs its script. Since the trtBonus from the last one has been added, when this one calculates its advCost, a different result is generated, and then this one adds +1 to trtBonus, and so on. Oh, and the way you get at advCost has to change if you do that: Code:
origin.parent.field[advCost].value += linkage[basis].field[trtAdvCost].value |
#102 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
Thanks! Looking into making that work!
edg |
#103 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
Okay, my mind is mush but I'm asking several questions anyway.
1 - I have created an ability thing that's an advancement. Code:
<thing id="abexMortal" name="Extra Mortal" compset="Ability" isunique="yes" description="One extra mortal durability"> <fieldval field="xpCost" value="20"/> <!-- handle costs for different professions --> <eval value="1" phase="Traits" priority="5000"><![CDATA[ if (hero.tagis[Profession.CombatSpec] <> 0) then field[xpCost].value = 8 endif if (hero.tagis[Profession.Diplomat] <> 0) then field[xpCost].value = 10 endif if (hero.tagis[Profession.Mindwalker] <> 0) then field[xpCost].value = 12 endif ]]></eval> <!-- Define any script needed to apply changes to other traits --> <eval value="2" phase="Traits" priority="8000"><![CDATA[ ~if we haven't been activated, just get out (only needed for user-activated abilities) ~doneif (field[abilActive].value = 0) ~apply whatever adjustment(s) are needed here if (container.ishero <> 0) then #traitbonus[trDMor] += 1 endif ]]></eval> </thing> 2- In form_advance.dat, the advBoost chooser. How do I limit what is displayed based on tags? I have tried several variations with the candidatefield but can't get it to work. 3 - I bootstrap some skills automatically. They work fine during character creation for any prereqs. In advance mode, skills that require them are showing up fine in the pick list but then showing as validation errors, giving the error that the prereq isn't selected. I assume it's because of the context but how do I override it to check the correct context? I think that's enough for now. Thanks! edg |
#104 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,214
|
I need to know the phase & priority of your various Calc trtFinal scripts.
I also need to know when the script that turns xpCost into something that gets subtracted from the resources happens, and what it's doing. 2 & 3) http://hlkitwiki.wolflair.com/index....ements_(Savage) - the skill sections. |
#105 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
Thanks, Mathias. I needed a push to get going on it. Haven't figured out the other timings but I did get several other things to work.
edg |
#106 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
I'm trying to advance a skill. Again, skills come in two types, Broad and Specialty. Broad skills are only a have or don't, they don't have ranks. Specialty skills can have up to 12 ranks.
In advances, they add the broad skill and that works. They add the first rank of the specialty skill under the broad skill and that works. It is added and I set it's trtBonus field. However, when I go to advance it again, it doesn't work. I am not sure why. So, my solution to this was to count up the number of times that skill has been added via tagcount and put that value into trtBonus. So, how do I find the tag of the skill that they are advancing and then put that in a tagcount[IsAdvance.xxxx] at the xxxx's so that I only count that skill's advances? Or, am I doing this wrong and I should be doing something else? Thanks! edg |
#107 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,214
|
If it's not working, show me the code, so I can look at it. Also, please be more specific than "it doesn't work" - how is it failing?
|
#108 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
Sorry for not being more specific.
In advancement.core, under component CanAdvance, I have this: Code:
<!-- If this is an increase, add one to the trait, and subtract one for a decrease --> <eval index="4" phase="Traits" priority="9000"><![CDATA[ doneif (tagis[Advance.Gizmo] = 0) if (container.ishero = 0) then if (tagis[Skills.Specialty] = 1) then field[trtBonus].value += 1 <== Right here I want tagcount[IsAdvance.(CurrentSkillBeingAdvanced)] instead of 1. That would seem to fix my issue. endif hero.child[resXP].field[resSpent].value += linkage[basis].field[baseCost].value + linkage[basis].field[trtBonus].value else Thanks! edg Last edited by evildmguy; March 7th, 2013 at 08:55 AM. |
#109 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,214
|
I also need the phase & priority of Bound trtUser, Calc trtFinal, and any Calc trtFinal #2, #3, Final, etc. scripts you've added.
Like I said, that script needs to go inbetween Bound trtUser and the first Calc trtFinal, and Traits/9000 would be well after all those, unless you've changed their priorities from the priorities that are used in the skeleton files for those scripts. I'll also need to see the script that's calculating field[baseCost].value. |
#110 |
|
|