Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old October 6th, 2012, 07:12 AM
Code:
if (hero.intersect[Profession,Profession] <> 0) then

In definition.def, scroll to the bottom of the file. There, you'll find where the phases are set up. I'd recommend reading the description for each phase.


Oh, and the other timing requirements that are imposed on that resource = (INT-1)*5:
In traits.str, find "Calc trtFinal" - this needs to be after that.
In miscellaneous.str, find "Calc resLeft" - this needs to be before that.

I'd use Traits/20000 to set the herofield, then Traits/25000 to look it up - well after Calc trtFinal, and well before Calc resLeft - lots of time to change both. Or, just set the resMax field on the resource directly by looking up the intelligence and delete that herofield.

Also, use @value += and/or field[resMax].value += in your scripts, rather than a simpe =. That way, you're adding the values to whatever's there, instead of overwriting them, meaning you don't need to be as careful about the phase & priority when race X adds +5 to that field - you don't care whether that script comes before or after your += (with an =, you'd have to make sure your race applied its effects AFTER the main calculation, or your main calculation would overwrite the change the race had made).
Mathias is offline   #11 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old October 6th, 2012, 07:39 AM
These articles may help:

http://forums.wolflair.com/showthread.php?t=21688

(there are some Pathfinder-specific things, but the general principles apply to everything in Hero Lab).
Mathias is offline   #12 Reply With Quote
evildmguy
Senior Member
 
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349

Old October 6th, 2012, 07:58 AM
Thanks for the quick response! I will be checking them out as soon as I get back home!

edg
evildmguy is offline   #13 Reply With Quote
evildmguy
Senior Member
 
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349

Old October 8th, 2012, 04:43 AM
Thanks for the help! Those are working great for me and the articles are good as well!

Another question. I have my skill tab and within the skill tab, I have the table_dynamic and have set the showsortset as I need it. However, I also would like the popup dialog to sort based on the showsortset as well. Basically, to keep skill grouped in a meaningful way for my system. Is there any way to do that?

Thanks!

edg
evildmguy is offline   #14 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old October 8th, 2012, 08:16 AM
choosesortset=""
Mathias is offline   #15 Reply With Quote
evildmguy
Senior Member
 
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349

Old October 8th, 2012, 09:47 AM
Quote:
Originally Posted by Mathias View Post
choosesortset=""
Wow. Obviously, I should read more.

Sorry.

edg
evildmguy is offline   #16 Reply With Quote
evildmguy
Senior Member
 
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349

Old October 10th, 2012, 06:31 AM
I have things that I want to autoadd. But I want to add them via a race pick, which could change based on user input. I also see that I have to have autoadd in structural files.

So, how do I change the autoadded items from the old ones to the new ones when a new race is selected?

Also, is there a way to override the cost of an item when it's autoadded so it's free instead?

Thanks!

edg
evildmguy is offline   #17 Reply With Quote
evildmguy
Senior Member
 
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349

Old October 10th, 2012, 07:09 AM
Okay, I'm getting the "duplicate record encountered" and after reading on it, I'm not sure why.

I have skills in my system as a component. I then copied that within the traits.str file and created a Psionics component in my system. But it doesn't like the linkage line with attribute in it. I don't know why I couldn't link multiple components to attributes.

I have read up on linkage and several other things on components but am not sure what is happening.

Thoughts?

Thanks!

edg

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>

    <!-- 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="Setup" 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
      doneif (origin.ishero = 0)

      ~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
			listcostmo = field[baseCost].value-1
			hero.child[resSkill].field[resSpent].value += maximum(field[trtUser].value * listcostmo + field[trtUser].value,0)
		else
			hero.child[resSkill].field[resSpent].value += maximum(field[trtUser].value * field[baseCost].value + field[trtUser].value,0)
			debug "values : " & field[trtUser].value & "  basecost : " & field[baseCost].value 
			var testnum as number
			testnum = field[trtUser].value * field[baseCost].value + field[trtUser].value
			debug "calc: " & field[trtUser].value & " * " & field[baseCost].value & " + " &  field[trtUser].value & " = " & testnum
		endif
	  endif
      ]]></eval>
	  
	<eval index="3" phase="Setup" priority="5000"><![CDATA[
	  ~pull the identity tag of the linked attribute into the skill
	  perform linkage[attribute].pullidentity[Attribute]
	  ]]>
	</eval>
	
    </component>

  <!-- Psionic component
	Each psionic skill derives from this component
  -->
  <component
    id="Psionics"
    name="Psionics"
    autocompset="no"
	panellink="Psionics">

    <!-- Net final roll that includes the value of the linked attribute -->
    <field
      id="sklPsiRoll"
      name="Net psionic Roll"
      type="derived">
      <calculate phase="Final" priority="5000">
        <after name="Calc trtFinal"/><![CDATA[
        ~only access the linkage if the psinoc 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>

    <!-- Each psionic is associated with a specific attribute that must be identified -->
    <linkage linkage="attribute" optional="no"/>         *****THIS IS THE LINE CAUSING THE PROBLEM*****
	<linkage linkage="psionic" optional="yes"/>

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

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

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

    <!-- Each psionic 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
      doneif (origin.ishero = 0)

      ~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
			listcostmo = field[baseCost].value-1
			hero.child[resSkill].field[resSpent].value += maximum(field[trtUser].value * listcostmo + field[trtUser].value,0)
		else
			hero.child[resSkill].field[resSpent].value += maximum(field[trtUser].value * field[baseCost].value + field[trtUser].value,0)
			debug "values : " & field[trtUser].value & "  basecost : " & field[baseCost].value 
			var testnum as number
			testnum = field[trtUser].value * field[baseCost].value + field[trtUser].value
			debug "calc: " & field[trtUser].value & " * " & field[baseCost].value & " + " &  field[trtUser].value & " = " & testnum
		endif
	  endif
      ]]></eval>
	  
	<eval index="3" phase="Setup" priority="5000"><![CDATA[
	  ~pull the identity tag of the linked attribute into the psionic
	  perform linkage[attribute].pullidentity[Attribute]
	  ]]>
	</eval>
	
    </component>
evildmguy is offline   #18 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old October 10th, 2012, 08:36 AM
All autoadds are performed as soon as you create a new character, so that a logical set of defaults is in place. There's no way for them to look at the character and decide whether they should be used or not.

You'll want to look in .dat files, rather than .str files for what's causing your duplicate record error. Did you copy some of the skills themselves in order to make your psionics, and forget to change their ids?
Mathias is offline   #19 Reply With Quote
evildmguy
Senior Member
 
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349

Old October 10th, 2012, 10:12 AM
Okay, I partially got it.

I don't know if this can work but here is what I did. Because Psionics closely resemble skills, I had copied the skills component over and renamed it, and the other needed items in the component definition, to psionic. But then I was getting the duplicate record error and had it narrowed down to the line of code I referenced in my above post. I figured that the psionic component was too close to the skill component and that's why it treated the it as a duplicate? (I have not reversed the order of them in my file to see if it is the skill that gets the error when it's listed second.)

But then I realized that what I could do was merely define psionics as a different compset that is based on skills. So, that's what I did and it works again for the most part.

Now I'm seeing another error. I have a tab_psionics and tab_skills and within each, I have declared portals and layouts using either psionic or skill. (I have a tag to differentiate the Psionic skills from regular skills.) I can get the popup choose table not to show Psionic skills in regular skills and vice versa. But now what I'm seeing is that a pick from tab_skills shows up in the tab_psionics show table? And vice versa? I can only remove them from the table to which I added them but I don't understand with different names and layouts why they are showing the other picked skills, psionic or not, in the other tab's show table area?

Should I go back to making Psionic its own component? Any thoughts what I'm doing wrong?

Thanks for the answers!

edg
evildmguy is offline   #20 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 08:22 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.