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)
-   -   tag vs autotag vs bootstrap (http://forums.wolflair.com/showthread.php?t=59045)

Duggan August 26th, 2017 08:00 AM

tag vs autotag vs bootstrap
 
So, in my data files for Planet Mercenary, I currently have two different ways to augment skills and specialties, as lifted from the 4E files, and one way to add a specialty, which I think I lifted from the Savage Worlds tutorial. They all seem to add the items differently, which seems to impact what tags are present. I was wondering if you could clarify that the differences are:

First, I was setting up the either-or choices for the various backgrounds, and I lifted a bootstrap / autotag combo from the 4E files as follows:

For example, this is the current Chaplain entry (which isn't quite right because I still need to figure out a way to allow for a choice from a skill type):

Quote:

<thing
id="cmdChapln"
name="Chaplain"
compset="CmdPckge"
isunique="yes"
description="The Chaplain provides both moral support and a moral compass. Morale and morality! Sometimes it falls to the Chaplain to point out what horrible people the other officers could become if they follow a given path. Other times the Chaplain must bring his carbine to his shoulder and clear a path with righteous indignation!">

<tag group="SkillBonus" tag="skDodge"/>
<tag group="SkillBonus" tag="skHistory"/>

<bootstrap thing="spHistRel"/>

<bootstrap thing="fRPlusSk">
<autotag group="SkillBonus" tag="skInspire"/>
<autotag group="SkillBonus" tag="skPerform"/>
<autotag group="explicit" tag="1"/>
</bootstrap>

<bootstrap thing="fRPlusSk">
<autotag group="SkillBonus" tag="skPistol"/>
<autotag group="SkillBonus" tag="skCarbine"/>
<autotag group="SkillBonus" tag="skDodge"/>
<!-- If I were to spell out the combat options, this would be longer, but I'd prefer to pull in all skills tagged with skCombat -->
<autotag group="explicit" tag="2"/>
</bootstrap>
</thing>
The intent is to have immediate +2 Skill Bonuses to Dodge and History, add a History (Religion) Specialty, and then allow the user to select between adding +2 to Inspire or Perform, and then +2 to any one Combat skill. The specialty is currently handled by directly adding the Thing via a bootstrap. The single skill bonuses are using Tag to add a tag and the choice between two skills is handled via bootstrapping a Thing which has a series of Autotags for the choices (which eventually add SkillBonuses). The relevant bits (I think):

Quote:

<thing
id="fRPlusSk"
name="+2 to Skill"
compset="SkillBonus"
description="Gives a +2 bonus to the selected skill.">
<fieldval field="usrCandid1" value="component.Skill"/>
<tag group="Hide" tag="Special"/>
<eval index="1" phase="PreTraits" priority="5000">
<before name="Calc trtFinal"/><![CDATA[
~build the candidate expression out of our SkillBonus tags
if (tagis[SkillBonus.?] <> 0) then
field[usrCandid1].text &= " & (" & tagids[SkillBonus.?, " | "] & ")"
endif

perform field[usrChosen1].chosen.field[trtBG].modify[+,2,"Background"]
]]></eval>
</thing>
Quote:

<!-- BGTrait - all background traits — backgrounds, command packages, and races —
derive from this to provide common properties -->
<component
id="BGTrait"
name="Background trait"
autocompset="no"
panellink="basics">
<eval index="1" phase="Setup" priority="3000" name="BG tag final">
<before name="Size final"/><![CDATA[
var expr as string
if (tagis[SkillBonus.?] <> 0) then
expr = tagids[SkillBonus.?, " | "]
foreach pick in hero from Skill where expr
perform eachpick.field[trtBG].modify[+,2,""]
nexteach
endif
]]></eval>
</component>
I know one way of looking at things is that "If it works, that's fine", but a) it bothers me having what seems to be three different ways of doing this (and might need a fourth) and b) Right now, my attempt to provide all of the Skill Bonuses from race, background, and command packages in a table is failing because only the +2 Choice ones are showing up despite what I think should be working by showing all SkillBonuses:

Quote:

<!-- Skill Bonus portal. Used to list skill bonuses from backgrounds, races, and
command packages, and to allow for choices. -->
<portal
id="skBonuses"
style="tblInvis"
width="240">
<table_fixed
component="UserSelect"
showtemplate="MenuSlPick"
showsortset="explicit"
alwaysupdate="yes">
<list><![CDATA[
(!User.NeedChosen | Helper.ChosenOpt)
]]></list>
<headertitle><![CDATA[
@text = "Skill Bonuses"
]]></headertitle>
</table_fixed>
</portal>
Quote:

<template
id="MenuSlPick"
name="Configurable Pick"
compset="UserSelect"
marginhorz="5"
marginvert="3">

<portal
id="name"
style="lblLeft"
showinvalid="yes">
<label
ismultiline="yes"
field="name">
</label>
</portal>

<portal
id="thinglist"
style="menuSmall">
<menu_things
field="usrChosen1"
component="none"
candidatefield="usrCandid1"
usepicksfield="usrSource1"
maxvisible="10"
sortset="explicit">
</menu_things>
</portal>

<position><![CDATA[
~set up our height; our width is pre-initialized for us
height = portal[thinglist].height

~if this is a "sizing" calculation, we're done
doneif (issizing <> 0)

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

~center the other portals on the tallest one
perform portal[name].centeron[vert,thinglist]

portal[name].left = 0
portal[name].width = 100

portal[thinglist].left = portal[name].right + 3
portal[thinglist].width = width - portal[name].width - 3
]]></position>

</template>
TL;DR: Is there a good standard way to handle all of these in a fairly common way? And how do I get these things to show up in the table of adjustments? Am I best off having multiple tables one after the other, for each of the items? This is one of those things where it seems to just work in 4E files, but that might be because the same name is often used for Tags, Things, Templates, etc, which makes it tricky to trace.

RavenX August 27th, 2017 05:31 PM

Code:

if (tagis[SkillBonus.?] <> 0) then
expr = tagids[SkillBonus.?, " | "]
foreach pick in hero from Skill where expr
perform eachpick.field[trtBG].modify[+,2,""]
nexteach
endif

The line of code I've outlined in red is why your only seeing a +2 bonus applied. You're telling the software that for any SkillBonus tag it should apply a +2 bonus via the modify part of this script. If you are using the SkillBonus tag group to determine the value of the bonus, you need to rig it up to apply the proper bonus.

Also, the foreach loop might not even be necessary, you could rig this in an eval script on the skills component and cut the foreach loop out of the equation completely.

For example, using if () then statements to cycle through your tags...

If (tagis[SkillBonus.1] <> 0) then
perform eachpick.field[trtBG].modify[+,1,""]
elseif (tagis[SkillBonus.2] <> 0) then
perform eachpick.field[trtBG].modify[+,2,""]
endif

You can cycle through all your Skill Bonus tags, telling hero lab to apply the bonus based on the presence of a specific tag within your foreach statement. This should fix the issue of only applying a +2 bonus.

Also, the foreach loop is possibly completely unnecessary. If you rig hero lab to forward SkillBonus tags to the skills themselves you can have an eval script on your skill component that does all the trait modifications without needing that foreach loop.

You can do this by rigging a skill linkage and having your background traits establish the linkage. Then in an eval script use linkage[basis].setfocus and perform focus.assign[SkillBonus.X] to the skill directly...

Duggan August 27th, 2017 06:03 PM

Ah. I was slightly unclear. The problem isn't that they're all +2, but that only the fRPlusSk items are showing up on the skBonuses table.

Ultimately, part of the problem, I think, is that I'm still not really clear on what's being added where to make this all work. ^_^ Like I think it's saying that there's a SkillBonus tag, but I never defined such a tag. Or is that what autotag does?

Mathias August 28th, 2017 07:24 AM

You're throwing large blocks of code out, but I can't see where you've described the game rules you're trying to implement.

Duggan August 28th, 2017 08:45 AM

What I'm trying to implement is in the first code block and the following text. The Chaplain package offers :
  • +2 Skill Bonuses to Dodge and History
  • a History (Religion) Specialty
  • +2 to either Inspire or Perform
  • +2 to any one Combat skill

Right now, the +2 Skill bonus to Dodge and History work (but don't show up in my list). The specialty works as-is, but I can't get it implemented in the Editor so far (most examples using Tags). The choice between Inspire and Perform works for the most part (there are some odd glitches when the change cross the min-max border as documented in one of my other posts) and show up. And I'm still puzzling out a good way to set up the +2 to a combat skill so that I don't have to spell out the choices.

I basically have two questions:
1) What is the difference between "tag" and "autotag"? Does autotag create the tag in question before adding it?
2) Why isn't the skBonuses table showing the Dodge and History items?

Mathias August 28th, 2017 08:59 AM

When assigning a tag to a thing, the element is called <tag>. When assigning a tag to a bootstrap, the element is called <autotag>. Behind the scenes, things are being handled in different ways, but to the user, there's not much difference - the tag gets assigned to that pick once the pick is added to the character.

Can I see the identity tags you've defined for your skills component?

Duggan August 28th, 2017 12:16 PM

Certainly.

Quote:

<group
id="Skill"
dynamic="yes">
<value id="skCarbine" name="Carbines"/>
<value id="skDodge" name="Dodge"/>
<value id="skExplsves" name="Explosives"/>
<value id="skHvyWeap" name="Heavy Weapons"/>
<value id="skLongGun" name="Long Gun"/>
<value id="skMelee" name="Melee"/>
<value id="skPistol" name="Pistols"/>
<value id="skScatter" name="Scatterguns"/>
<value id="skStaWeap" name="Stationed Weapons"/>
<value id="skThrown" name="Thrown Weapons"/>
<value id="skChem" name="Chemistry"/>
<value id="skCompute" name="Computers"/>
<value id="skEcon" name="Economics"/>
<value id="skEng" name="Engineering"/>
<value id="skExpSci" name="Experimental Sciences"/>
<value id="skHistory" name="History"/>
<value id="skInsight" name="Insight"/>
<value id="skMech" name="Mechanic"/>
<value id="skMedic" name="Medicine"/>
<value id="skRes" name="Research"/>
<value id="skXeno" name="Xenobiology"/>
<value id="skAirVeh" name="Air Vehicles"/>
<value id="skAthlete" name="Athletics"/>
<value id="skEndure" name="Endurance"/>
<value id="skGrndVeh" name="Ground Vehicles"/>
<value id="skLarceny" name="Larceny"/>
<value id="skPercept" name="Perception"/>
<value id="skSpcVeh" name="Space Vehicles"/>
<value id="skStealth" name="Stealth"/>
<value id="skWatVeh" name="Water Vehicles"/>
<value id="skContract" name="Contracts"/>
<value id="skDeceive" name="Deceive"/>
<value id="skEmpathy" name="Empathy"/>
<value id="skInspire" name="Inspire"/>
<value id="skIntim" name="Intimidate"/>
<value id="skNegot" name="Negotiate"/>
<value id="skPerform" name="Perform"/>
<value id="skWillpow" name="Willpower"/>
</group>
Unless you mean the identity elements in the Skill, in which case they are the following:
Quote:

<!-- Each skill needs its own identity tag so existing skills can be identified during advancement -->
<identity group="Skill"/>

<!-- Each skill can also be selected as a background/command package/race bonus.
This bonus does count against the maximum at character creation. -->
<identity group="SkillBonus"/>

Mathias August 28th, 2017 12:49 PM

I meant the second of those.

There should not be a group named Skill in tags.1st - you're defining all those tags as identity tags on the component, so having it in tags.1st, too is redundant.

If you've got an identity tag of SkillBonus on the skills component, I see no reason these scripts should be failing.

Time to start adding debug lines and figure out what's going on in your script.

Duggan August 28th, 2017 02:46 PM

Thank you. I hadn't found the page about debug statements before now.

Duggan August 28th, 2017 03:46 PM

And <identity> is a tag in and of itself... suddenly a bunch of things start to make more sense.


All times are GMT -8. The time now is 09:54 AM.

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