Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
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> 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> 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> Working on - |
#1 |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
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> Quote:
Working on - |
|
#2 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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. |
#3 |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
Thank you Mathias!
That's what I get for cutting and pasting..... Ok, I changed it to compset="Vehicle" and am getting this: Quote:
Quote:
Quote:
Working on - |
|||
#4 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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. |
#5 |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
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? Working on -
Last edited by TCArknight; August 13th, 2021 at 01:06 PM. |
#6 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Quote:
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. |
|
#7 |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
Quote:
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> Working on - |
|
#8 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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. |
#9 |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
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 - |
#10 |
Thread Tools | |
Display Modes | |
|
|