• 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

& means "and"
| means "or"

Parentheses are also available.

So, it sounds like you want:
component.Skill & Profession.CombatSpec

Everything that has the Skill component and the Profession.CombatSpec tag.
 
Note that in a fieldval, you may need to enter "&" as "&"

So:

component.Skill & Profession.CombatSpec
 
Okay, confusing issue.

I have attribute points and skill points defined as resources in thing_miscellaneous.

Attribute points work great. I can assign points, resLeft goes down, resSpent goes up and when it reaches 0, it properly changes color to show that.

Skill points don't work. resMax is set. resSpent gets set. resLeft, though, is always equal to resSpent and so is always negative.

I'm guessing at what to show you for the code.

Code:
	<thing id="resAtt" 
	  name="Attribute Points" 
	  compset="Resource">
		<fieldval field="resObject" value="Attribute"/>
		<fieldval field="resMax" value="60"/>
		<tag group="Helper" tag="Bootstrap"/>
		<eval index="1" phase="Final" priority="1000"><![CDATA[
			field[resMax].value = herofield[acStartAP].value 
			debug "acStartAP : " & herofield[acStartAP].value 
			debug "attribute points : " & field[resMax].value
		]]></eval>
	</thing>
	
	<thing id="resSkill"
	  name="Skill Points"
	  compset="Resource">
	  <fieldval field="resObject" value="Skill"/>
	  <tag group="Helper" tag="Bootstrap"/>
	  <eval index="1" phase="Final" priority="1000"><![CDATA[
        field[resMax].value = herofield[acSklPnts].value 
		debug "acSkilPnts : " & herofield[acSklPnts].value 
		debug "skill points : " & field[resMax].value
      ]]></eval>
	</thing>

Timing doesn't seem to be an issue as attributes and skills events (evals) are happening at the same timing points but attributes work.

What other code can I show you that would help you look at this? Thanks!

On another note, how do I ignore costs for bootstrapped items? I know I saw that in the documentation but I can't find it again.

Thanks!

edg
 
What phase & priority do the skills modify hero.child[resSkill].field[resSpent].value at?

What phase & priority is the Calc resLeft script?
 
What phase & priority do the skills modify hero.child[resSkill].field[resSpent].value at?

What phase & priority is the Calc resLeft script?

Both modify it at Traits 10000.

Code:
<!-- Each attribute point above one that is allocated by the user costs 1 attribute point -->
    <eval index="2" phase="Traits" priority="10000">
      <before name="Calc resLeft"/>
      <after name="Bound trtUser"/><![CDATA[
	  hero.child[resAtt].field[resSpent].value += (field[trtUser].value) * 1
      ]]></eval>

This is the attribute code. The skill code is longer due to needing a more complex formula to figure cost. But it starts with

Code:
<eval index="2" phase="Traits" priority="10000">
      <before name="Calc resLeft"/>
      <after name="Bound trtUser"/><![CDATA[

This is why I'm confused.

Thanks!

edg
 
I still think the problem is in the code on skills that adds to resSpent, although it doesn't look like it's a simple timing issue.
 
Fair enough. Probably is!

Code:
<!-- Skill component
        Each skill derives from this component
  -->
  <component
    id="Skill"
    name="Skill"
    autocompset="no"
	panellink="skills">

    <!-- Net final roll that includes the value of the linked attribute -->
    <field
      id="sklRoll"
      name="Net Skill Roll"
      type="derived">
      <calculate phase="Final" priority="5000">
        <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 (container.ishero <> 0) then
          @value = field[trtFinal].value + linkage[attribute].field[trtFinal].value
          endif
        ]]></calculate>
      </field>
	  
	<field
      id="sklRollO"
      name="Net Skill Roll"
      type="derived">
      <calculate phase="Final" priority="5000">
        <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 (container.ishero <> 0) then
          @value = field[trtFinal].value + linkage[attribute].field[trtFinal].value
          endif
        ]]></calculate>
      </field>  
	  
	<field
      id="sklRollG"
      name="Net Skill Roll"
      type="derived">
      <calculate phase="Final" priority="5000">
        <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 (container.ishero <> 0) then
          @value = round(field[trtFinal].value / 2 + linkage[attribute].field[trtFinal].value / 2,0,-1)
          endif
        ]]></calculate>
      </field> 

	<field
      id="sklRollA"
      name="Net Skill Roll"
      type="derived">
      <calculate phase="Final" priority="5000">
        <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 (container.ishero <> 0) then
          @value = round(field[trtFinal].value / 4 + linkage[attribute].field[trtFinal].value / 4,0,-1)
          endif
        ]]></calculate>
      </field>  
	
    <!-- Each skill is associated with a specific attribute that must be identified -->
    <linkage linkage="attribute" optional="no"/>
	<linkage linkage="skill" optional="yes"/>

    <!-- Each skill needs its own identity tag so existing skills can be identified during advancement -->
    <identity group="Skill"/>

    <!-- Every skill is shown on the "Rolls" mouse-over on the Dashboard/TacCon -->
    <tag group="DashTacCon" tag="Rolls"/>

    <!-- Track the skill on the actor -->
    <eval index="1" phase="Traits" priority="5000"><![CDATA[
      perform forward[Skill.?]
      ]]></eval>

    <!-- Each skill point that is allocated by the user costs base cost * rank in skill points -->
    <eval index="2" phase="Traits" priority="10000">
      <before name="Calc resLeft"/>
      <after name="Bound trtUser"/><![CDATA[
      ~if this skill is not added directly to the hero (i.e. an advance), skip it entirely
      if (origin.ishero = 0) then
		done
	  endif
	  
	  if (isuser = 0) then
		done
	  endif

      ~adjust the resource appropriately
	  if (tagis[Skills.Broad] = 1) then
		if (hero.intersect[Profession,Profession] <> 0) then
			hero.child[resSkill].field[resSpent].value += maximum(field[baseCost].value-1,0)
		else
			hero.child[resSkill].field[resSpent].value += maximum(field[baseCost].value,0)
		endif
	  else
	    if (hero.intersect[Profession,Profession] <> 0) then
			var listcostmo as number
			var hold as number
			hold = (field[trtUser].value * listcostmo + field[trtUser].value)
			var hold1 as number
			hold1 = (power(field[trtUser].value, 2) + field[trtUser].value) / 2
			listcostmo = field[baseCost].value-1
			~hero.child[resSkill].field[resSpent].value += maximum(field[trtUser].value * listcostmo + field[trtUser].value,0)
			hero.child[resSkill].field[resSpent].value += maximum(hold1,0)
		else
			var listcostmo as number
			listcostmo = field[baseCost].value
			hero.child[resSkill].field[resSpent].value += maximum(field[trtUser].value * listcostmo + field[trtUser].value,0)
		endif
	  endif
	  ~field[sklRollG].value = round(field[trtFinal].value + linkage[attribute].field[trtFinal].value / 2,0,-1)
      ]]></eval>
	  
	<eval index="3" phase="Traits" priority="5000"><![CDATA[
	  ~pull the identity tag of the linked attribute into the skill
	  perform linkage[attribute].pullidentity[Attribute]
	  ]]>
	</eval>
	  
    </component>

Thanks!

edg
 
What sets field[baseCost].value?

What phase & priority is that at?

Also, you may want to look at cleaning up your code - you set the hold variable, and then never use it, and when you set hold, you use listcostmo as one of its components. However, since listcostmo isn't set until a few lines later, its value is always 0, and therefore hold is always 0.

When you calculate hold1, you don't include listcostmo as something that goes into that calculation, so listcostmo doesn't alter the resSpent, but in the other part of that if...else, listcostmo is included in the final cost calculation that gets added to resSpent.
 
:o Yeah, I know I have to clean up the code. I haven't gotten to that yet.

As for the costs, those are under the thing definitions. It's a fieldval in there. So, I'm not sure as things don't have timings that I can see but I'm sure I'm wrong on that.

Thanks!

edg
 
Do all skills have the same baseCost?

If not, do they follow a pattern? If tag X, cost Y, else cost Z?

If so, I'd calculate those in a script. That way, you don't risk forgetting to include a cost on a skill or two.
 
I put a field on my traits that is base cost. I'm trying to do a skill based system, so even though there is a limit on starting Perks and Flaws, for example, they also cost or give skill points.

Then, all skills, perks, flaws, etc. have that defined on the thing.

Code:
<fieldval field="baseCost" value="3"/>

Or the like is on every skill/perk/flaw thing.

I'm trying to convert Alternity, if I didn't say, and all of the skills (perks, flaws) have a cost. So, yes, as I defined them as things, I had to give them a base cost.

If there is a formula that I could apply to them, I haven't found it.

Thanks!

edg
 
If every skill has the same baseCost, set it in a script on the skill component, so that you don't risk accidently leaving it off a skill.

Code:
<eval index="1" phase="Initialize" priority="10000"><![CDATA[
  field[baseCost].value = 3
  ]]></eval>

(I know of the Alternity system, but don't own any of the books).
 
Let's go back to the beginning of this problem then, since it doesn't appear that the problem lies in the skill's cost script, and I was getting off track trying to make the cost portion more efficient (a script means you don't need to type a skill cost for every skill you create).

I think I see something I hadn't seen earlier. In the skeleton files, the script named "Calc resLeft" (in the Resource component in miscellaneous.dat) is at Final/1000.

The scripts on your resources are also at Final/1000.

If two scripts are at the same phase & priority, Hero Lab will pick which comes first - it's out of your control (it tends to be consistant within each saved character, though). So, it's entirely possible that the order Hero Lab picked is:

script on the attribute resource
Calc resLeft on both attributes and skills
script on the skills resource
 
I'm looking at advancements and I have a few questions and clarifications.

So, advancements are gizmos on a character, correct?

The default way to advance is to use xp? In Alternity, technically everything is skill points, regardless of whether it's used for a perk, skill or FX (magic) skill. However, I'm thinking that to differentiate them, it might be best for me to keep using xp instead. But to do that, then in my skill component area, where I have this code that skipped it if it was an advance

Code:
~if this skill is not added directly to the hero (i.e. an advance), skip it entirely
      if (origin.ishero = 0) then
		done
	  endif

I put the xp cost there? That way I can still use my cost formulas? Do I add it to trtBonus? Or trtUser as I am with starting skill points? What would you suggest?

My skill tab has the skill ranks, from 0 - 12. I can increase them there in advancement mode. If they were added via advancement, they don't look at cost. If they weren't, then they suddenly go against skill points. So, how do I tell if I'm in advancement mode?

Further, should I have them add a rank to a skill via the advancement tab? Oops. When I do that, the linkage is missing. Does that go back to gizmos not having the link? How do I add the link? (I think in the Savage Worlds example, it states skills don't need that link and so doesn't figure it out but maybe I do? Otherwise, in picking a skill to increase, I get this error: Linkage pick 'attribute' not located for current context
Location: 'eval' script for Component 'Skill' (Eval Script '#3') near line 3 )

I'm sure there will be more but this will get me started. And let me know what I can show to make things more clear. (Screen shots, code, etc.)

Again, my thanks for all your help on this!

edg
 
Last edited:
Tell me more about how advancement works, and how if differs from character creation (it sounds like advancement and character creation may even be very similar in this game).

It doesn't sound like the default advancement mechanisms are the right thing to use, so let's figure out what the proper setup is.
 
Back
Top