• 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

Deathwatch

Not sure if this will help, but here is the source code I am using.

Code:
<!-- Ammunition portal -->
<portal
  id="grWeapAmmo"
  style="tblNormal">
  <table_dynamic
    component="Gear"
    showtemplate="SimpleItem"
    choosetemplate="SimpleItem"
    alwaysupdate="yes"
    scrollable="yes"
    addpick="WeapHelper"
    headerpick="WeapHelper"
    candidatepick="WeapHelper"
    candidatefield="AmmoAllow">
    <list>component.Ammunition</list>
    <titlebar><![CDATA[
      @text = "Add Ammunition"
      ]]></titlebar>
    <headertitle><![CDATA[
      @text = "Ammunition"
      ]]></headertitle>
    <additem><![CDATA[
      @text = "Add Ammunition"
      ]]></additem>
    </table_dynamic>
  </portal>

<!-- Modifications portal -->
<portal
  id="grMods"
  style="tblNormal">
  <table_dynamic
    component="Gear"
    showtemplate="SimpleItem"
    choosetemplate="SimpleItem"
    alwaysupdate="yes"
    scrollable="yes"
    addpick="ModHelper"
    headerpick="ModHelper"
    candidatepick="ModHelper"
    candidatefield="AllowMods">
    <list>component.Mods</list>
    <titlebar><![CDATA[
      @text = "Add Modifications"
      ]]></titlebar>
    <headertitle><![CDATA[
      @text = "Modifications"
      ]]></headertitle>
    <additem><![CDATA[
      @text = "Add New Modifications"
      ]]></additem>
    </table_dynamic>
  </portal>
 
Mathias,

When I set up a resource on the gizmo to handle power armour history, does the helper component need a field for it? I am not quite sure how to do this with a gizmo.
 
Mathias I am trying to set up this resource in the data, I thought I did it right but hero lab is giving me an error:

Syntax error in 'titlebar' script for Portal 'grArmHist' on line 2
'script reference is invalid under the circumstances'

Code:
<!-- Power Armour History portal -->
<portal
  id="grArmHist"
  style="tblNormal">
  <table_dynamic
    component="PowArHist"
    showtemplate="SimpleItem"
    choosetemplate="SimpleItem"
    alwaysupdate="yes"
    scrollable="yes"
    addpick="ArmHelper"
    headerpick="ArmHelper">
    <titlebar><![CDATA[
      @text = "Add Power Armour History - " & gizmo.child[resArmHist].field[resSummary].text
      ]]></titlebar>
    <headertitle><![CDATA[
      @text = "Add Power Armour History: " & gizmo.child[resArmHist].field[resSummary].text
      ]]></headertitle>
    <additem><![CDATA[
      ~set the color based on whether the proper number of slots are allocated
        if (gizmo.child[resArmHist].field[resLeft].value = 0) then
          @text = "{text clrgrey}"
        elseif (gizmo.child[resArmHist].field[resLeft].value < 0) then
          @text = "{text clrwarning}"
          endif
        @text &= "Add Power Armour History"
      ]]></additem>
    </table_dynamic>
  </portal>

Here is the script for the resource:
Code:
 <!-- Power Armour History resource -->
  <thing
    id="resArmHist"
    name="Power Armour History Slots"
    compset="Resource">
    <fieldval field="resObject" value="ArmorHist"/>

    <eval index="1" phase="Setup" priority="1000"><![CDATA[
      foreach pick in hero from Armor
        if (eachpick.field[arPwrArHst].value <> 0) then
          field[resMax].value = eachpick.field[arPwrArHst].value
          endif
        nexteach
      ]]></eval>
    </thing>
 
Mathias,

I was looking over what you did in Shadowrun on the Modifications. The way you set up the capacity for mods should be similar to what I am trying to setup for Power Armour History. Think you could maybe explain that to me? Or give me some hints on it?
 
Mathias I am trying to set up this resource in the data, I thought I did it right but hero lab is giving me an error:

Syntax error in 'titlebar' script for Portal 'grArmHist' on line 2
'script reference is invalid under the circumstances'

Please re-read the article on gizmos. You're not using the correct transitions from one thing in the gizmo to another thing in the gizmo - you're using the transition that's correct for the parent to gizmo.
 
Mathias,

I was looking over what you did in Shadowrun on the Modifications. The way you set up the capacity for mods should be similar to what I am trying to setup for Power Armour History. Think you could maybe explain that to me? Or give me some hints on it?

Please study the fields by debugging them, figure out everything you can that way, and then ask for clarification.
 
Mathias,

When I set up a resource on the gizmo to handle power armour history, does the helper component need a field for it? I am not quite sure how to do this with a gizmo.

A resource creates a new pick. How would that require you to create a new field somewhere?
 
Here is the script for the resource:
Code:
 <!-- Power Armour History resource -->
  <thing
    id="resArmHist"
    name="Power Armour History Slots"
    compset="Resource">
    <fieldval field="resObject" value="ArmorHist"/>
 
    <eval index="1" phase="Setup" priority="1000"><![CDATA[
      foreach pick in hero from Armor
        if (eachpick.field[arPwrArHst].value <> 0) then
          field[resMax].value = eachpick.field[arPwrArHst].value
          endif
        nexteach
      ]]></eval>
    </thing>

Isn't the resource inside each gizmo? Can't it just visit its own parent, instead of searching for every armor?
 
Isn't the resource inside each gizmo? Can't it just visit its own parent, instead of searching for every armor?

so what you are saying is I need to revise the code something like this:

foreach pick in container
if (eachpick.field[arPwrArHst].value <> 0) then
container.field[resMax].value = eachpick.field[arPwrArHst].value
endif
nexteach
 
Please re-read the article on gizmos. You're not using the correct transitions from one thing in the gizmo to another thing in the gizmo - you're using the transition that's correct for the parent to gizmo.

I did, and I figured out that I needed container.child instead.
 
Alright, so now I have this working partially. For some reason when I add a power armour history to the armour the slot is not being used at all. If I add one it still says (0 of 1 (1 left).

Is my code correct for the incrementation of slots?

Code:
    <!-- Each ability that is added by the user costs 1 slot -->
    <eval index="2" phase="Setup" priority="5000"><![CDATA[
      ~we must ignore bootstrapped abilities from races and abilities added via advances
      if (isuser + origin.ishero >= 2) then
        container.child[resArmHist].field[resSpent].value += 1
        endif
      ]]></eval>
 
so what you are saying is I need to revise the code something like this:

foreach pick in container
if (eachpick.field[arPwrArHst].value <> 0) then
container.field[resMax].value = eachpick.field[arPwrArHst].value
endif
nexteach

Code:
field[resMax].value = parent.field[arPwrArHist].value
 
origin.ishero is specific to abilities that can be added by advances. Don't use it for things you're purchasing, especially not when you're inside a gizmo, where origin.ishero always = 0
 
Code:
field[resMax].value = parent.field[arPwrArHist].value

This gives me an error:
Attempt to access non-existant parent pick for top-level container from script.

Code:
  <!-- Power Armour History resource -->
  <thing
    id="resArmHist"
    name="Power Armour History Slots"
    compset="Resource">
    <fieldval field="resObject" value="ArmorHist"/>
    <tag group="Helper" tag="Bootstrap"/>

    <eval index="1" phase="Setup" priority="1000"><![CDATA[
          field[resMax].value = parent.field[arPwrArHst].value
      ]]></eval>
    </thing>
 
Isn't resArmHist a bootstrap in the entity that armor uses? If so, why does it have the Helper.Bootstrap tag, which makes it appear on the hero, too?

You want one copy of resArmHist per armor, right - not one overall copy.
 
Isn't resArmHist a bootstrap in the entity that armor uses? If so, why does it have the Helper.Bootstrap tag, which makes it appear on the hero, too?

You want one copy of resArmHist per armor, right - not one overall copy.

Yes it is bootstrapped via the entity, I deleted the Helper.Bootstrap tag.
 
so after the fixes I've worked out so far, the tracker is working for the headertitle but not the titlebar.

Code:
<portal
  id="grArmHist"
  style="tblNormal">
  <table_dynamic
    component="PowArHist"
    showtemplate="SimpleItem"
    choosetemplate="SimpleItem"
    alwaysupdate="yes"
    scrollable="yes"
    addpick="ArmHelper"
    headerpick="ArmHelper">
    <titlebar><![CDATA[
      @text = "Add Power Armour History - " & container.child[resArmHist].field[resSummary].text
      ]]></titlebar>
    <headertitle><![CDATA[
      @text = "Add Power Armour History: " & container.child[resArmHist].field[resSummary].text
      ]]></headertitle>
    <additem><![CDATA[
      ~set the color based on whether the proper number of slots are allocated
        if (container.child[resArmHist].field[resLeft].value = 0) then
          @text = "{text clrgrey}"
        elseif (container.child[resArmHist].field[resLeft].value < 0) then
          @text = "{text clrwarning}"
          endif
        @text &= "Add Power Armour History"
      ]]></additem>
    </table_dynamic>
  </portal>
 
Known bug. There's no titlepick="", the way there's a headerpick="" for the header script, so you'll have to use fixed text for the titlebar script.
 
Known bug. There's no titlepick="", the way there's a headerpick="" for the header script, so you'll have to use fixed text for the titlebar script.

Ok so its not something I did wrong then. Ok good. I'll do what I can for it then. Thanks Mathias. I think the armour history part is done now.
 
I haven't posted any progress pics for a while, here is a look at the new Conditions tab. I figured out how the one for pathfinder was made and created one for Deathwatch to handle the various combat conditions that users face in the grim darkness of the 41st millennium.
 

Attachments

  • Condition Tab.JPG
    Condition Tab.JPG
    207.8 KB · Views: 5
Back
Top