• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Authoring Example help

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?
 
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

I also had to move that script to the traits phase, inbetween "Bound trtUser" and "Calc trtFinal #1"

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
 
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>

The xp cost is set properly. I have given a character 60 xp. If I select this (as a mindwalker, since costs are different), the Advances line is updated and says "12 of 60" but the rest of it is wrong. Instead of "(48 left)" it says "(60 left)". Basically, the resSummary is wrong but the spent is okay. This happens on any similar abilities that I have created. I'm not sure why.

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
 
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
 
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
 
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?
 
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

Do you need more code than that?

Thanks!

edg
 
Last edited:
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.
 
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>

But I'm confused. What do those have to do with figuring out a tagcount dynamically? Or knowing those, are you going to suggest some other course of action? Are you thinking they overwrite each other and step on each other, such that I wouldn't need to do the tagcount?

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
 
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.
 
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.

Okay, I will re-look at it.

Sorry. I have had a bad week for sleep and comprehension.

edg
 
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>
But every time this runs, trtBonus gets reset to 0, so my skill never increases.

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>
Increase Skill:
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>
 
linkage[basis].field[trtBonus].value
linkage[basis].tagis[component.Skill]
linkage[basis].tagis[Skills.Specialty]
 
Okay, I see that it's the context.

But if I change the line:
Code:
field[trtBonus].value += 1
to:
Code:
linkage[basis].field[trtBonus].value += 1

then I get the error
Code:
Linkage pick 'basis' not located for current context
Location: 'eval' script for Component 'CanAdvance' (Eval Script '#4') near line 22

Thoughts on that?

Thanks!

edg
 
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.
 
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]
 
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
 
This is from tab_gear.dat in the skeleton files.
Code:
<table_dynamic
  component="Gear"
  showtemplate="grGrPick"
  choosetemplate="grGrThing"
  buytemplate="BuyCash"
  selltemplate="SellCash">

It's the buytemplate and selltemplate options that tell Hero Lab that this item is purchased as gear.

This is from the Gear component in equipment.str
Code:
<component
  id="Gear"
  name="Gear"
  isgear="yes"
  autocompset="no"
  ispublic="no">

Make sure that your cybertech either includes the gear component in its compset, or that it has a component with isgear="yes" in its compset.
 
Back
Top