• 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

Proper syntax for Abilities regarding Races/Creatures

Gumbytie

Well-known member
I am a bit confused and need some clarification, please.

So I have a creature with Weakness (Music) (example), what I coded and it works:
Example 1
Code:
  <thing
    id="abRKWeak2"
    name="Weakness (Music)"
    compset="RaceAbil"
    summary="Susceptible to certain types of music"
    description="An Aunt Jenny must undergo a test of will (resist with Smarts) against specialized music."
    uniqueness="unique">
    <fieldval field="shortname" value="Weakness (Music)"/>
    <usesource source="Ragnarok"/>
    <tag group="User" tag="Creature"/>
    </thing>

Now if you dig about in thing_abilities.dat you see this example for Weakness:
Example 2
Code:
  <thing
    id="abWeakness"
    name="Weakness"
    compset="RaceAbil"
    summary="Special susceptibility for the creature"
    description="cut out for space.">
    <tag group="User" tag="Creature"/>
    <tag group="User" tag="NeedText"/>
    <!-- Append the weakness to the name -->
    <eval index="1" phase="Traits" priority="10000"><![CDATA[
      field[livename].text = field[thingname].text & ": " & field[abilText].text
      ]]></eval>
    </thing>

So if I tried that, for mine it would look like:
Example 3
Code:
  <thing
    id="abRKWeak2"
    name="Weakness"
    compset="RaceAbil"
    summary="Susceptible to certain types of music"
    description="An Aunt Jenny must undergo a test of will (resist with Smarts) against specialized music."
    uniqueness="unique">
    <fieldval field="shortname" value="Weakness"/>
    <usesource source="Ragnarok"/>
    <tag group="User" tag="Creature"/>
    <tag group="User" tag="NeedText"/>
    <!-- Append the weakness to the name -->
    <eval index="1" phase="Traits" priority="10000"><![CDATA[
      field[livename].text = field[thingname].text & ": " & field[abilText].text
      ]]></eval>
    </thing>

But in the Editor, I no longer see Weakness (Music), instead Music:

So I need to assign a 'text' tag with definition 'music' I surmise but what exactly is the syntax and where does it fit timing wise in my example? Looking through other creature/race code examples it seems people forgo the example in thing_abilities.dat and just code like my example 1.
 
A lot of the versions of weaknesses need an explanation of the weakness so that's why I think I've mostly foregone using the base weakness ability and just created individual ones instead. But if you wanted to use it like that then all you would need to do is set it with a livename field (or actually in this case it looks like the code will derive a livename if you set an abilText field instead). Examples of that which I can think of off the top of my head include looking at creatures that use the abWeapon ability. You'll see on those that you can set a a livename field on the abWeapon bootstrap that would be the displayed text for the weapon on the portfolio and printouts, like "Claws/Bite" or "Tentacles" or whatever.
 
Yeah, a lot of this makes more sense after a good nights sleep :)

I agree, so many other books require a specific definition for an Edge, Hindrance or Ability I end up making it from scratch. I think it is a limitation of how the core is built but it is shame we do so much 'duplication' and cannot re-use.

If coded differently at the core, we should be able to just reference the 'original' instance of Edge/Hindrance/Ability and just in a new source file 'rename/replace' whatever appropriate for the new setting.

Ah well. I am learning quite a bit, however.

Someone from another thread asked why I didn't just use the Editor to create all my data files and splatbooks. I still do regarding Pathfinder. But one of my projects is trying to write up a game system from scratch (Ubiquity) games so in that case, there is no editor until I create it. So I have been trying to learn as much as possible by coding via a simple xml editor.

Cheers.
 
The problem I am still having though, is with this portion:
Code:
    <!-- Append the weakness to the name -->
    <eval index="1" phase="Traits" priority="10000"><![CDATA[
      field[livename].text = field[thingname].text & ": " & field[abilText].text
      ]]></eval>

I don't want the 'user' to define the name, I want to define it in the context of the above script, if possible. Exactly how do I define: field[abilText].text ?

Looking at examples for Claw, Bite etc. isn't quite what I want. In those cases, they don't append the name of something, they replace it.

So with Bite/Claw we get something like this:

Unarmed (livename) -> Claws (livename)

What I want to do:

Weakness (livename) -> Weakness (livename) : Coding (added on)

I am simply using Weakness as an example, I have some other uses in mind if I can figure this out :)
 
So here is an example using abWeapon:

Code:
    <bootstrap thing="abWeapon">
      <autotag group="WeaponDie" tag="2"/>
      <assignval field="livename" value="Claw/Bite"/>
      </bootstrap>

The WeaponDie part isn't relevant to our purpose here so you can ignore that line.

So I think all you need in this case would be something like:
Code:
    <bootstrap thing="abWeakness">
      <assignval field="abilText" value="Music"/>
      </bootstrap>
 
The reason for some of the duplication is usually because of some difference in the description or the way it works. We can't use the items from the Companion materials either, because not everyone has those, so that causes some duplication.

Also, don't use Replace. Always use Preclude. Replace is Source-independent, and Setting files shouldn't affect core materials when they aren't active, so Replace isn't appropriate.
 
Back
Top