Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Authoring Kit (http://forums.wolflair.com/forumdisplay.php?f=58)
-   -   Setting up a table of editable items (http://forums.wolflair.com/showthread.php?t=59844)

Duggan December 30th, 2017 02:58 PM

Setting up a table of editable items
 
This is probably one of those "duh" moments, but I'm trying to set up a table with Edit fields (for names of the things) and I can't seem to get the changes made to stick. Here is the portal (other extraneous details edited out for simplicity):

Code:

<portal
  id="ftMembers"
  style="tblNormal">
    <table_fixed component="FTMember" showtemplate="FTMPick">
      <headertitle>
        @text="Fireteam Members"
      </headertitle>
    </table_fixed>
  </portal>
 
<template
  id="FTMPick"
  name="Fireteam Member Pick"
  compset="FTMember"
  marginhorz="5"
  marginvert="10">
 
  <portal
    id="name"
    style="editNormal">
    <edit
      field="ftName">
      </edit>
    </portal>
 
  <position><![CDATA[
    ~set up our height based on our tallest portal
    height = portal[name].height
    portal[name].width = 100
   
    ~if this is a "sizing" calculation, we're done
    if (issizing <> 0) then
      done
      endif

    ~position our tallest portal at the top
    portal[name].top = 0

    ~position the name on the left
    portal[name].left = 0
    ]]></position>
  </template>

The component and compset:
Code:

<component
  id="FTMember"
  name="Fireteam Member"
  autocompset="no"
  panellink="ftPanel">
 
  <field
    id="ftName"
    name="Fireteam member name"
    type="user">
    </field>
  </component>

<!-- Fireteam -->
<compset
  id="FTMember">
  <compref component="FTMember"/>
  </compset>

The Thing entry:
Code:

<thing
  id="Fireteam"
  name="Fireteam member"
  compset="FTMember"
  isunique="no"
  description="This is a fireteam entry.">
</thing>

And where I bootstrap three of them onto the player (here, trying to set values so that I can see a difference from the outset):
Code:

<bootstrap index="30" thing="Fireteam">
  <assignval field="ftName" value="Bob"/>
</bootstrap>
<bootstrap index="31" thing="Fireteam">
  <assignval field="ftName" value="Tom"/>
</bootstrap>
<bootstrap index="32" thing="Fireteam">
  <assignval field="ftName" value="Harry"/>
</bootstrap>

The values I set don't get shown (instead, I get "0" in the field) and when I edit a field and exit the tab, it's back to "0" when I come back. And, when I look at the entry in the Debug window for Fields for the selected object, indeed, there's nothing in it.

I set this up using the template of skills having domains, which seemed parallel, and they don't seem to do anything special. What am I missing?

Mathias December 30th, 2017 07:03 PM

The ftName field definition does not specify a maxlength="". Therefore, that's a numerical field, and so unless the user types in a number as part of their text, that'll = 0.

Duggan December 30th, 2017 07:47 PM

Thank you. That was very useful.


All times are GMT -8. The time now is 02:17 AM.

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