Member
Join Date: Oct 2013
Posts: 30
|
Ok, I think I now have "Increase Basic Skill" working, and I did some revamping on Character Generation, although I now need to go back and retest Character Generation to make sure I didn't break anything with the changes I made getting advancement working.
I'm going to attempt to add an Import file here, hopefully I created it correctly. |
#91 |
Member
Join Date: Oct 2013
Posts: 30
|
It looks like doing Advances on Attributes could be challenging. Increasing an attribute by 1 pip will increase all the associated skills by a pip as well, I'll just have to make sure that doing that doesn't cause existing Advancements on skills to change their costs, but Advancements on skills done after the Advancement on the associated Attribute will need to use the new value. Timing will be everything
|
#92 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
As I mentioned in that post, in Shadowrun, the script that calculates advCost and the script that adds to the trtBonus of the thing being advanced needed to be the same script. Because the Advancements are added in a particular order, and that script is tied to that particular order, each one only sees the advancements that were added before it.
|
#93 |
Member
Join Date: Oct 2013
Posts: 30
|
Yeah, right now things are pretty convoluted and spread out.
In advancement.core in the "CanAdvance" component I store the current trait bonus of the Skill into the Advance in a field called "advTrtBns" Code:
<!-- If this is an increase, add one to the trait, and subtract one for a decrease --> <eval index="4" phase="Effects" priority="1000"><![CDATA[ ~we only worry about this on actual advances - not traits added at creation doneif (tagis[Advance.Gizmo] = 0) endif ~apply any appropriate increase or decrease for the linked trait ~Note: This pick is a child of the gizmo and our parent pick is the actual "Advance" ~ pick that contains the appopriate "Advance" tag, so be sure to check there. ~Note: Since the advancement is displaced to the hero, it's "parent" is *not* the ~ gizmo, so we must explicitly reference through the "origin" container. if (origin.parent.tagis[Advance.Increase] > 0) then linkage[basis].field[trtBonus].value += 1 origin.parent.field[advTrtBns].value = linkage[basis].field[trtBonus].value elseif (origin.parent.tagis[Advance.Decrease] > 0) then linkage[basis].field[trtBonus].value -= 1 endif ]]></eval> Code:
<!-- Total value of the linked attribute --> <field id="ATTRoll" name="ATT Skill Roll" type="derived"> <calculate phase="Traits" priority="4000" name="Calc ATTRoll"> <![CDATA[ ~only access the linkage if the skill is directly on the hero; if not, it is ~likely within an advancement gizmo and no linkage will exist there if (container.ishero <> 0) then @value = linkage[attribute].field[trtFinal].value + linkage[attribute].field[trtRacial].value + field[trtUser].value - field[trtUser].delta debug "ATTRoll: " & @value & " " & linkage[attribute].field[trtAbbrev].text & " " & field[trtAbbrev].text endif ]]></calculate> </field> Code:
<!-- Net final roll that includes the value of the linked attribute --> <field id="sklRoll" name="Net Skill Roll" type="derived"> <calculate phase="Traits" priority="5000" name="Calc sklRoll"> <after name="Calc trtFinal"/><![CDATA[ ~only access the linkage if the skill is directly on the hero; if not, it is ~likely within an advancement gizmo and no linkage will exist there if (compare(field[trtAbbrev].text,"Barg")=0) then debug "Calculate in sklRoll field " & field[trtAbbrev].text & @value endif if (container.ishero <> 0) then @value = field[trtFinal].value + linkage[attribute].field[trtFinal].value + linkage[attribute].field[trtRacial].value + field[trtRacial].value else debug "NOT IN HERO - sklRoll" if (tagis[Advance.Gizmo] <> 0) then origin.parent.field[advCost].value = linkage[basis].field[ATTRoll].value + origin.parent.field[advTrtBns].value-1 origin.parent.field[advCost].value = round(origin.parent.field[advCost].value/3,0,-1) if (tagis[Skill.Spec] <> 0) then origin.parent.field[advCost].value = round(origin.parent.field[advCost].value/2,0,1) endif endif endif if (compare(field[trtAbbrev].text,"Barg")=0) then debug "Calculate2 in sklRoll field " & field[trtAbbrev].text & @value endif ]]></calculate> </field> Code:
<thing id="advBSkill" name="Increase Base Skill" compset="Advance" description="Select an base skill to increase by one."> <fieldval field="advAction" value="Increase Base Skill"/> <fieldval field="advDynamic" value="Skill.Base & !Helper.Maximum & !Hide.Attribute"/> <tag group="Advance" tag="Increase"/> <!-- Each advancement consumes its cost in accrued advances --> <eval index="1" phase="Traits" priority="6000"><![CDATA[ perform gizmo.findchild[none,"Advance.Gizmo"].setfocus doneif (state.isfocus = 0) #resspent[resAdvance] += field[advCost].value ]]></eval> <!-- Attach the child entity for tracking the advance --> <child entity="Advance"> <tag group="Advance" tag="MustChoose"/> </child> </thing> I think you are correct that I will need to pull together a bunch of those pieces and put them in "CanAdvance". I'll have to spend some time looking at the Savage Worlds example and comparing to the base code and what I've got. |
#94 |
Member
Join Date: Oct 2013
Posts: 30
|
Is the code for Shadowrun available anywhere to look at? Other than the snippets in the other thread?
|
#95 |
Senior Member
|
How is the progress on this going?
Working on - SW RPG d6 or add this source Update Souce and SW RPG FFG and More FFG SW not working yet Author of Realms Works Guides Blog writer at thedarkelf007.home.blog/ |
#96 |
Member
Join Date: Oct 2013
Posts: 30
|
Slow I had some vacation time and thought I might get some work done on it then but ended up spending most of my down time playing "Sins of a Solar Empire" which I purchased ages ago but had never gotten around to playing. I'm back home now and still have a couple vacation days left so I might take another crack at it, although I've got a few projects around the house to work on too. My fear is that I may have to rework a lot of what I've already done in order to get the Attribute advances working properly
|
#97 |
Senior Member
|
I can host the updated files if you want to make them available to others to test
I might also be able to spend some time on it as well, though I have two jobs and 60+ hrs a week, so I might not be able to contribute much. Working on - SW RPG d6 or add this source Update Souce and SW RPG FFG and More FFG SW not working yet Author of Realms Works Guides Blog writer at thedarkelf007.home.blog/ |
#98 |
Member
Join Date: Oct 2013
Posts: 30
|
That sounds good, I'll try and post them tomorrow.
|
#99 |
Member
Join Date: Oct 2013
Posts: 30
|
Ok, much later than promised, but here you go.
|
#100 |
|
|