Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit

Notices

Reply
 
Thread Tools Display Modes
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,283

Old August 13th, 2021, 09:19 AM
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)

Working on -
  • (SWADE) WIP Savage Rifts
  • Savage Rifts (Deluxe): Update link in This post
  • Star Trek Adventures: Update link in This post
TCArknight is offline   #1 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,283

Old 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?

Working on -
  • (SWADE) WIP Savage Rifts
  • Savage Rifts (Deluxe): Update link in This post
  • Star Trek Adventures: Update link in This post
TCArknight is offline   #2 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,019

Old 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.
Mathias is offline   #3 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,283

Old 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?

Working on -
  • (SWADE) WIP Savage Rifts
  • Savage Rifts (Deluxe): Update link in This post
  • Star Trek Adventures: Update link in This post
TCArknight is offline   #4 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,019

Old 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.
Mathias is offline   #5 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,283

Old August 13th, 2021, 12:35 PM
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?
Attached Images
File Type: gif Screenshot 2021-08-13 160328.gif (42.4 KB, 0 views)

Working on -
  • (SWADE) WIP Savage Rifts
  • Savage Rifts (Deluxe): Update link in This post
  • Star Trek Adventures: Update link in This post

Last edited by TCArknight; August 13th, 2021 at 01:06 PM.
TCArknight is offline   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,019

Old August 13th, 2021, 01:00 PM
Quote:
Originally Posted by TCArknight View Post
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.
Mathias is offline   #7 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,283

Old August 13th, 2021, 01:08 PM
Quote:
Originally Posted by Mathias View Post
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>
Attached Images
File Type: gif Screenshot 2021-08-13 160328.gif (42.4 KB, 1 views)

Working on -
  • (SWADE) WIP Savage Rifts
  • Savage Rifts (Deluxe): Update link in This post
  • Star Trek Adventures: Update link in This post
TCArknight is offline   #8 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,019

Old 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.
Mathias is offline   #9 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,283

Old 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?

Working on -
  • (SWADE) WIP Savage Rifts
  • Savage Rifts (Deluxe): Update link in This post
  • Star Trek Adventures: Update link in This post
TCArknight is offline   #10 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 04:12 PM.


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