• 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

Question in regards to Derived traits

On the other side I am using EditPad Lite now, it has better abilities but I miss the the color from XML maker.
 
okay I think I have it I removed the , skil it entirely
if (origin.ishero=0) then
so now looks like this and works w/out error

<!-- Each skill point that is allocated by the user costs the next rank in CP-->

<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)
var traitlevel as number
var traitcost as number
var finalvalue as number

traitlevel = field[trtUser].value
traitcost = 1

finalvalue = traitcost / 2 * (traitlevel * traitlevel + traitlevel)

hero.child[resCP].field[resSpent].value += finalvalue
]]></eval>
 
I am not sure that I follow, here is the entire trait.str for skills I have the panellink="skills"> blocked because I am still getting an error with it that keeps me from starting the rule set. I noticed that in the section above the calcuations is also mentions something about advancement so could I be doubling up info?

<!-- 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"/>

<!-- 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 the next rank in CP-->

<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)
var traitlevel as number
var traitcost as number
var finalvalue as number

traitlevel = field[trtUser].value
traitcost = 1

finalvalue = traitcost / 2 * (traitlevel * traitlevel + traitlevel)

hero.child[resCP].field[resSpent].value += finalvalue
]]></eval>
</component>
 
Instead of this:
Code:
<eval index="2" phase="Traits" priority="10000">
<before name="Calc resLeft"/>
<after name="Bound trtUser"/><![CDATA[
[B][U]~if this skill is not added directly to the hero (i.e. an advance), skip it entirely[/U][/B]
[B][U]if (origin.ishero = 0) then[/U][/B]
var traitlevel as number
var traitcost as number
var finalvalue as number
 
traitlevel = field[trtUser].value
traitcost = 1
 
finalvalue = traitcost / 2 * (traitlevel * traitlevel + traitlevel)
 
hero.child[resCP].field[resSpent].value += finalvalue 
 
]]></eval>

You need this:

Code:
<eval index="2" phase="Traits" priority="10000">
<before name="Calc resLeft"/>
<after name="Bound trtUser"/><![CDATA[
[B][U]~if this skill is not added directly to the hero (i.e. an advance), skip it entirely[/U][/B]
[B][U]if (origin.ishero = 0) then[/U][/B]
[B][U]done[/U][/B]
[B][U]endif[/U][/B]
 
var traitlevel as number
var traitcost as number
var finalvalue as number
 
traitlevel = field[trtUser].value
traitcost = 1
 
finalvalue = traitcost / 2 * (traitlevel * traitlevel + traitlevel)
 
hero.child[resCP].field[resSpent].value += finalvalue 
 
]]></eval>

The underlines and bold of course don't go into the final code, they're just highlighting what should be changed.

See what that section is doing?
the first line is a comment, describing what will happen.
the second line, the if statement, asks whether the skill it's adding originated on the hero (which is the case for anything the user added).

Now if it did not originate on the hero (=0), the next line executes:
Code:
done

Which says to leave the script.

and because you have an if statement, you need to match that with an
Code:
endif
 
Ok that makes more sense for the if then statement, thank you.

I have this question for this code area
I have an error when I add this into the code
panellink="skills">

The data files could not be loaded due to the following errors:

File: traits.str (line 157) - Encountered PCDATA for element 'component' proscribed against PCDATA
One or more timing errors were identified. Please review the timing report and correct the errors. You can access the report under the 'Develop' menu or by clicking this link.

It keeps the file from loading so I am not sure what is wrong with this line, it is used the same way in the following with out any adverse effects?

<!-- Ability component
Each special ability derives from this component
-->
<component
id="Ability"
name="Ability"
autocompset="no"
panellink="abilities">
 
when you add
panellink="skills">

is your previous line still:
autocompset="no">

or any other line ending in a closed angle bracket: >?

If so, delete the > from the previous line.
 
Again you rock my world!
I did not see that little > just hanging there :)

you are very correct it is now working okay

I still get this after the data set loads

Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_'
- - -
Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_'
- - -
Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_'
- - -
Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_'
- - -
Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_'
- - -
Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_'
- - -
Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_'
- - -
Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_'
- - -
Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_'
- - -
Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_'
 
I still get this after the data set loads

Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_'

I have some theories about this, but I honestly can't be sure without seeing your data files. This means you're doing something you're not supposed to, and the compiler probably should be yelling at you about it - but isn't.

Could you please send me your complete set of data files? Then I can reproduce the problem on this end and add appropriate checks to the compiler. Send them to me at helpdesk at wolflair.com.

To package up your data files for sending to me, please use the HLExport tool that is installed with HL. You'll find it under the Start menu, next to HL. This will put the data files into a single, compressed file that I can simply drop into place on my end.
 
I have some theories about this, but I honestly can't be sure without seeing your data files. This means you're doing something you're not supposed to, and the compiler probably should be yelling at you about it - but isn't.

:) it sends me headacks ! in the mega ton range of pain does that count :)

But in my other post area you have answer what I was doing wrong I left out a set from the thing_miscellaneous.dat

<thing
id="resSkill"
name="Skill Slots"
compset="Resource">
<fieldval field="resObject" value="Skill"/>
<!-- Automatically add the resource to every actor -->
<tag group="Helper" tag="Bootstrap"/>

<!-- Use the starting ability slots as our initial maximum -->
<eval index="1" phase="Setup" priority="1000"><![CDATA[
field[resMax].value = herofield[acStartAbi].value
]]></eval>
</thing>

once I found that (I looked through the wiki under resources and were it states that Savage worlds uses fixed attirbutes and skill points) I looked at how it have handled resAbility and adapted that into this script

<thing
id="resSkill"
name="Skill Slots"
compset="Resource">
<fieldval field="resObject" value="Skill"/>
<!-- Automatically add the resource to every actor -->
<tag group="Helper" tag="Bootstrap"/>

<!-- Use the starting ability slots as our initial maximum -->
<eval index="1" phase="Setup" priority="1000"><![CDATA[
field[resMax].value = herofield[acStartAbi].value
]]></eval>
</thing>
I had to polish up the tab_skill.dat files (I had endif statements that did not need to be in there) and loaded my data set everything is working (for the base part :)

If you would like I can still send the data set to you, I would be happy to let you see how I have been butchering your program ... er I mean working it over :) LOL

You know I am an Art Teacher by trade and I like the aesthetics of character sheet layouts ect so this is a jump into the ocean for me with heavy weights on!

Thank you all for your time and tolerance with me.
 
Back
Top