• 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

Need help with new component

Phrll

Well-known member
I'm working with the new system skeleton files and having a problem with a new component. I'm not getting any compile errors and everything loads but nothing is being displayed in the portal on the Basics tab. I can replace the compset in the portal and template with one of the "built-in" ones (Attribute, Skill, etc.) and everything works so I'm 99% sure the problem is with the component, I just don't know what I'm doing wrong. I tried autocompset="yes" initially but tried a separate <compset> section as well, with the same results. I'm pretty new to this so it's probably something dumb.

Here are the component and compset definitions, they're in traits.str.

Code:
 <component
    id="Condition"
    name="Condition"
    autocompset="no">
    <!-- Activation state of ability - we're not activated by default -->
    <field
      id="condActive"
      name="Is Activated?"
      type="user"
      minvalue="0"
      maxvalue="1">
      </field>
    </component>

  <compset
     id="Condition">
     <compref component="Condition"/>
     </compset>

The thing_conditions.dat file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<document signature="Hero Lab Data">
  <thing id="condUpset"
    name="Upset"
    compset="Condition"
    description="Description goes here"
    isunique="yes">
    <fieldval field="condActive" value="0"/>
    <tag group="explicit" tag="1"/>
    </thing>
</document>

The Portal. This and the template code are in tab_basics.dat.
Code:
  <portal
    id="baCondition"
    style="tblInvis">
    <table_fixed
      component="Condition"
      showtemplate="baCondPick"
      showsortset="explicit"
      scrollable="no">
      <headertitle><![CDATA[
        @text = "Condition"
        ]]></headertitle>
      </table_fixed>
    </portal>

And the Template.
Code:
<template
    id="baCondPick"
    name="Condition Pick"
    compset="Condition"
    marginhorz="16"
    marginvert="3">

    <portal
      id="name"
      style="lblLeft"
      showinvalid="yes">
      <label
         field="name">
         </label>
      </portal>
      
    <portal
      id="info"
      style="actInfo">
      <action
        action="info">
        </action>
      </portal>

    <position><![CDATA[
      height = portal[info].height

      ~if this is a "sizing" calculation, we're done
      doneif (issizing <> 0)

      portal[info].top = 0

      perform portal[name].centervert
      perform portal[info].alignedge[right,0]

      portal[name].left = 0
      portal[name].width = 135
      debug "top = " & portal[name].top & " height = " & portal[name].height

      ]]></position>

    </template>
 
What adds this pick to the hero? For attributes and skills, those are added to the hero by <enmasse> entries in definition.def.


Either that, or change the portal from table_fixed to table_dynamic, so that the user adds the conditions they want, and doesn't have to see the rest.
 
*sigh* I knew it was something simple I was forgetting. It's all slowly sinking in. That fixed it, thanks much, Mathias!!
 
Back
Top