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)
-   -   Minions Help? (http://forums.wolflair.com/showthread.php?t=66214)

TCArknight August 13th, 2021 09:19 AM

Minions Help?
 
Hi all.

After a time away from HL and related coding I'm diving back into it.

The dataset I'm attempting involves Vehicles as Minions (seems to be the default for the Sample Dataset)

I have the following:
components
Code:

  <!-- Vehicle component
        All vehicles use this to display for purchase/selection
  -->
  <component
    id="Vehicle"
    name="Vehicle Helper"
    autocompset="no">

    </component>
       
  <!-- VehicleBase component
        All vehicles use this for the vehicle details/attributes
  --> 
  <component
    id="VehicleBase"
    name="Vehicle Base"
        autocompset="no">       

    <field
      id="vebReliability"
      name="Reliability"
      minvalue="0"
      maxvalue="6"
      type="derived">
      </field>
         
    <field
      id="vebCombatSpeedOn"
      name="Combat Speed (On Road)"
      minvalue="0"
      defvalue="0"
      type="derived">
          </field>
       
    <field
      id="vebCombatSpeedOff"
      name="Combat Speed (Off Road)"
      minvalue="0"
      defvalue="0"
      type="derived">
          </field>
         
    </component>

Compset:
Code:

  <!-- Vehicle -->
  <compset
    id="Vehicle"
    stackable="no">
    <compref component="Vehicle"/>
    <compref component="VehicleBase"/>
    <compref component="Equipment"/>
    <compref component="Gear"/>
    <compref component="Minion"/>
    </compset>
  <!-- VehicleBase -->
  <compset
    id="VehicleBase"
    stackable="no">
    <compref component="VehicleBase"/>
    <compref component="Minion"/>
    </compset>

Thing:
Code:

  <thing id="vehM1114HMMWV" name="M1114 HMMWV" compset="Vehicle" stacking="never">
    <fieldval field="grCost" value="12000"/>
    <minion id="Vehicle" ownmode="no" livefield="minEnabled" coupledfield="minCoupled">
      <tag group="MinionSet" tag="Vehicle" name="Vehicle" abbrev="Vehicle"/>
      <bootstrap thing="vebM1114HMMWV"></bootstrap>
      </minion>
    </thing>
       
  <thing id="vebM1114HMMWV" name="M1114 HMMWV" description="Testing" compset="VehicleBase" uniqueness="unique">
    <tag group="VehicleCat" tag="USMil"/>
    <tag group="VehicleType" tag="4WDCar"/>
    <fieldval group="vebReliability" value="5"/>
    <fieldval field="vebCombatSpeedOn" value="5"/>
    <fieldval field="vebCombatSpeedOff" value="4"/>
    </thing>

(continued next post)

TCArknight August 13th, 2021 09:35 AM

As expected, when I add the vehicle from the Gear tab for the hero, a secondary minion character is created.

When the minion is selected, I am trying to do is to display the appropriate fields on a new tab -

VehicleBasics tab:
Code:

  <template
    id="vbaDetails"
    name="Personal"
    compset="Personal">

    <portal
      id="title"
      style="lblTitle">
      <label
        istitle="yes"
        text="Details">
        </label>
      </portal>

    <portal
      id="lblVehCat"
      style="lblLeft">
      <label>
        <labeltext><![CDATA[
                  debug "Category: " & minion.child[actor].field[name].text
                  @text = "test:"
                  ]]></labeltext>
        </label>
      </portal>

    <portal
      id="lblVehType"
      style="lblLeft">
      <label>
        <labeltext><![CDATA[
          @text = "Type: " & hero.findchild[VehicleBase].idstring
          ]]></labeltext>
        </label>
      </portal>
         
    <portal
      id="lblVehRel"
      style="lblLeft">
      <label
          text="Reliability: ">
        </label>
      </portal>

    <portal
      id="VehReli"
      style="lblLeft">
      <label
          field="vebReliability">
        </label>
      </portal>
               
    <position><![CDATA[

      ~freeze our value in advancement mode or if an advancement has modified us
      ~Note: All freezing must be done *before* any positioning is performed.
      ~if (state.iscreate = 0) then
      ~  portal[value].freeze = 1
      ~elseif (autonomous = 0) then
      ~  portal[value].freeze = 1
      ~  endif

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

      ~center the other portals vertically
      portal[lblVehCat].left = 0
          portal[lblVehCat].width = width
          portal[lblVehCat].height = 30
      portal[lblVehCat].top = portal[title].bottom + 5
          portal[lblVehCat].visible = 1
         
         
          portal[lblVehType].top = portal[lblVehCat].bottom + 5
          portal[lblVehType].left = portal[lblVehCat].left
          portal[lblVehType].width = width

      height = portal[lblVehType].bottom + 10
         
      ]]></position>

    </template>         

  <layout
    id="vehbasics">
    <templateref template="vbaDetails" />

    <!-- This script sizes and positions the layout and its child visual elements. -->
    <position><![CDATA[
          perform template[vbaDetails].autoplace[10]

      ~perform template[vbaDetails].render
         
      ~figure out the total height we need for the tab
          height = template[vbaDetails].bottom
         
      ]]></position>

    </layout>

  <panel
    id="vehbasics"
    name="Vehicle Basics"
    marginhorz="5"
    marginvert="5"
    order="110">
    <live>CharType.Vehicle</live>
    <layoutref layout="vehbasics"/>
    <position><![CDATA[
      ~get the height used by the layout and use it, as that means we scroll
      ~if necessary
      perform layout[vehbasics].render
      height = layout[vehbasics].height
      ]]></position>
    </panel>

However, I get this error:
Quote:

Hero Lab was forced to stop compilation after the following errors were detected:

Template 'vbaDetails' - Reference to portal 'VehReli' using a field for a different component set
Layout 'vehbasics' - Template in reference 'vbaDetails' uses fields and must specify a thing/pick
What am I missing to get the tab to be able to access the information on the VehicleBase component?

Mathias August 13th, 2021 09:54 AM

Templates displayed directly on a layout need to reference which pick they're displaying the information from:

<templateref template="vbaDetails" thing="some id" ispick="yes"/>


In the template, it says the compset is Personal:
<template id="vbaDetails" name="Personal" compset="Personal">

And then later you're displaying a portal that is field-based:
<portal id="VehReli" style="lblLeft"> <label field="vebReliability"> </label> </portal>

But according to your first post, the vehReliability field is in the VehicleBase component, which is in the Vehicle compset - you don't show the Personal compset, so unless that compset also has VehicleBase as one of its components, then the template's compset doesn't match the field used in it.

TCArknight August 13th, 2021 11:53 AM

Thank you Mathias!

That's what I get for cutting and pasting..... :(

Ok, I changed it to compset="Vehicle" and am getting this:
Quote:

Hero Lab was forced to stop compilation after the following errors were detected:

Layout 'vehbasics' - Template in reference 'vbaDetails' uses fields and must specify a thing/pick
When I add thing="actor" to the templateref in the layout, I get this:
Quote:

Layout 'vehbasics' - Reference 'vbaDetails' specifies thing with incompatible component membership
thing="minion" gives:
Quote:

Layout 'vehbasics' - Reference 'vbaDetails' specifies a non-existent thing
Is there something else I need to adjust?

Mathias August 13th, 2021 12:16 PM

Oh, OK, the picks with the "Vehicle" compset are effectively the race. That means you can't use a template that requires a specific pick. You have to have this template be within a table that displays picks from the Vehicle compset, or you need to redesign your template if you want it to be based on a more generic piece of the hero, like "personal". In that case, you need to use labeltext to reference the values, like this:
<label>
<labeltext><![CDATA[
perform hero.findchild[Vehicle].setfocus
doneif (state.isfocus = 0)
@text = focus.field[vebReliability].text
]]></labeltext>
</label>


Based on the information it looks like you're trying to display, I'd just make the table where the user chooses a vehicle type be a tall table, so that you've got room to display lots of info about the vehicle race that was added.

TCArknight August 13th, 2021 12:35 PM

1 Attachment(s)
Ah. Ok, I see why in SR5 the Vehicle details are part of the RaceVeh component. If I understand correctly:

1) There are (at least) two sets of attributes in SR5, Character (Body, etc) and "Vehicle" (Handling, Speed, etc.).
2) Where normal attributes are bootstrapped to Character heros, the Vehicle ones are bootstrapped to the RaceVeh (VehicleBase in my case).
3) The display of the Basics tab in SR5 changes depending on which set of attributes is being used.

Everything else is functioning like a normal hero, where weapons, etc are picks on the Vehicle race, correct?

Mathias August 13th, 2021 01:00 PM

Quote:

Originally Posted by TCArknight (Post 296206)
Ah. Ok, I see why in SR5 the Vehicle details are part of the RaceVeh component. If I understand correctly:

1) There are (at least) two sets of attributes in SR5, Character (Body, etc) and "Vehicle" (Handling, Speed, etc.).
2) Where normal attributes are bootstrapped to Character heros, the Vehicle ones are bootstrapped to the RaceVeh (VehicleBase in my case).
3) The display of the Basics tab in SR5 changes depending on which set of attributes is being used.

Everything else is functioning like a normal hero, where weapons, etc are picks on the Vehicle race, correct?


1) There's some overlap on the attributes - Body, for example, appears in both, but Charisma is only used for characters, and Handling is only used for vehicles. But they're all in the attribute compset, and where they're used is just a matter of tags.
2) yes
3) it's based on a tag on the hero that tells me the character type
Yeah, vehicles are just another character type in SR5.

TCArknight August 13th, 2021 01:08 PM

1 Attachment(s)
Quote:

Originally Posted by Mathias (Post 296208)
1) There's some overlap on the attributes - Body, for example, appears in both, but Charisma is only used for characters, and Handling is only used for vehicles. But they're all in the attribute compset, and where they're used is just a matter of tags.
2) yes
3) it's based on a tag on the hero that tells me the character type
Yeah, vehicles are just another character type in SR5.

I'll give it a try that way, thanks. :)

Another thing I notice though, is that no field other than a simple label with text is showing (per attached screenshot). Am I missing something?
Code:

<position><![CDATA[

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

      ~center the other portals vertically
      portal[lblVehCat].left = 0
          portal[lblVehCat].width = width
          portal[lblVehCat].height = 30
      portal[lblVehCat].top = portal[title].bottom + 5
         
          portal[lblVehType].top = portal[lblVehCat].bottom + 5
          portal[lblVehType].left = portal[lblVehCat].left
          portal[lblVehType].width = width

          portal[lblVehRel].top = portal[title].bottom + 5
          portal[lblVehRel].left = 0
          portal[lblVehRel].width = width
         
          portal[VehReli].top = portal[lblVehRel].bottom + 5
          portal[VehReli].left = 0
          portal[VehReli].width = width
         
      height = portal[VehReli].bottom + 10
         
      ]]></position>


Mathias August 13th, 2021 01:24 PM

Two portals are placed at the same vertical position, so the second one is hiding the first

portal[lblVehCat].top = portal[title].bottom + 5

portal[lblVehRel].top = portal[title].bottom + 5

There's not enough info for me to diagnose why VehReli isn't showing - or at least I don't see the problem in just the position code.

TCArknight August 18th, 2021 03:10 PM

Ok, things seem to be working fine as long as there is only one Minion/Vehicle.

If the main hero purchases a second vehicle, then tries to shift to it the Minion doesn't seem to get the correct Type, or display the correct tabs. Is there a secret to having multiple Minions on a character?


All times are GMT -8. The time now is 09:37 PM.

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