|
|
Thread Tools | Display Modes |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,502
|
I'm still wrapping my head around a lot of things. In Planet Mercenary, each player has three fireteam members, basically a squad that follows him and takes orders. Each fireteam member has a role, something like "Specialist" or "Officer-in-Training" and five skills, Combat, Physical, Mental, Social, and Damage. The role is partly cosmetic and partly determines which skills can be chosen for that fireteam member (for example, a Specialist gets +1 Mental and +1 to another skill that isn't Damage). The skills chose can be doubled up, so a Specialist might have +2 Mental, or an Officer-in-Training might have +2 Social.
Currently, each fireteam member has fields that contain the values for those five skills, and a field for their name. I would like to be able to edit those Fireteam members to set a role, and then the two skills that they can pick based on that role (although I'm currently ignoring the role and working toward letting the user select two skills. I figure I can then refine it to the role setup), and then be able to edit additional details for players who want more info on their Fireteam members (race, biography, etc). First off, I'm finding myself going back and forth on how to handle the skill bonuses. Since they're user-selected, I'm considering setting each member up with a Gizmo, creating a component/compset for the skills, and then "things" for each of the five skills, and letting a Chooser Table add them to the Fireteam member, either on the Fireteam Tab (which would show the aggregate value of adding up the skill values for each of the team members, then have individual entries below) or using a separate Form (so that the user would use the name and skill values in a table, then could click on a Configure button to actually set details). Right now, my approach is to set up an FTSkill component/autocompset, and then have "thing" entries for the five skills which have an "eval" to increment the relevant fields on their parent, if present. I'm still trying to set that up, so I don't have code. But that seems kind of ugly and hacky for something working on a set list of skills, which also exist as fields on another thing. I also find myself trying to think through how to set things up so that a particular role has two sets of choices that can be set up. *wry grin* And, I guess, after that, the user interface for it? Long story short, my brain is just not twisting the direction I need on this. Does it make sense to just add instances onto that Fireteam member representing the Skill Bonus and then total them up instead of storing a Field? Or should the field do that count maybe? Under assumptions that I feel are safe:
Anyhow, I'm going to keep plugging away, and I'll provide what code I have as I refine my idea, but I want to put it out here. Code:
<component id="FTMember" name="Fireteam Member" autocompset="no" panellink="ftPanel"> <!-- In-play bonuses applied to the trait --> <field id="ftName" name="Fireteam member name" type="user" maxlength="200"> </field> <field id="ftPhysical" name="Fireteam physical skill" type="derived"> </field> <field id="ftMental" name="Fireteam mental skill" type="derived"> </field> <field id="ftSocial" name="Fireteam social skill" type="derived"> </field> <field id="ftCombat" name="Fireteam combat skill" type="derived"> </field> <field id="ftDamage" name="Fireteam damage" type="derived" defvalue="1"> </field> <field id="ftComDam" name="Combat and Damage" type="static" maxfinal="10"> <finalize><![CDATA[ ~Displays name @text = field[ftCombat].value & " (" & field[ftDamage].value & "d6)" ]]></finalize> </field> <field id="ftNotes" name="Fireteam notes" type="user"> </field> </component> Code:
<!-- Fireteam --> <compset id="FTMember"> <compref component="FTMember"/> </compset> Code:
<!-- Fireteam Thing --> <thing id="Fireteam" name="Fireteam member" compset="FTMember" isunique="no" description="This is a fireteam entry."> <child entity="ftDetails"/> </thing> |
#1 |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,502
|
OK... I think I understand this a little better. I made my Fireteam thing a UserSelect to get the two menus (I'll figure out the Role later) and added some FTSkill things to pull the list from.
Code:
<thing id="Fireteam" name="Fireteam member" compset="FTMember" isunique="no" description="This is a fireteam entry."> <fieldval field="usrCandid1" value=" "/> <fieldval field="usrCandid2" value=" "/> <eval index="1" phase="PreTraits" priority="4900"> <before name="Calc trtFinal"/><![CDATA[ debug field[usrChosen1].chosen.field[name].text & ", " & field[usrChosen2].chosen.field[name].text ]]> </eval> <child entity="ftDetails"/> </thing> <thing id="ftPhysical" name="Physical" compset="FTSkill"/> <thing id="ftMental" name="Mental" compset="FTSkill"/> <thing id="ftSocial" name="Social" compset="FTSkill"/> <thing id="ftCombat" name="Combat" compset="FTSkill"/> <thing id="ftDamage" name="Damage" compset="FTSkill"/> Code:
if (field[usrChosen1].chosen.field[name].text = "Physical") then debug "It's physical" endif Last edited by Duggan; February 3rd, 2018 at 12:00 PM. |
#2 |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,502
|
I'm actually wondering if it would make more sense to be using tags here instead of field values... if I can get the menus to set the relevant tags, then I could assign them to the fireteam members, propagate them to the hero, and then do the counts on each.
|
#3 |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,502
|
Right. And it's the "compare" function to compare strings. Setting up the if/elseif.
|
#4 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Comparing strings is really dangerous in any language but especially for HL because is CPU intensive. I mean you sure the name is never ever going to change in any way including capitalization? Can't you add a Tag to look at instead?
Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
#5 |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,502
|
What's the best way to set the tag from the menu_thing?
|
#6 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
If I am following you wouldn't set it on the menu_thing you would set it on the Pick that "field[usrChosen1].chosen." is pointing too.
For example if field[usrChosen1].chosen. was a list of attributes and you had tags of Attr.Physical or Attr.Mental you could have then: Code:
if (field[usrChosen1].chosen.tagis[Attr.Physical] = 1) then debug "It's physical" endif Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
#7 |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,502
|
You're absolutely right. I was overthinking it. Thank you.
|
#8 |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,502
|
I'm learning more and more about how to make this all work... among other things, I finally understand how to roll my own menuthings instead of hamfisting UserSelect into everything.
I'm trying to get the Fireteam roles working for proscribing what skills can be picked. It seemed like the easiest way to do that would be to set tags on them for what skills can be picked, and it seems to be working. The part which I'm still a bit hazy on is how to make it so that changing the Role also changes the chosen skills in the menus. Ideally, I'd like to make it so that, if there's just one choice, it sets it. If there are more, it keeps the current value if it's valid, and sets it to either the first valid choice or not defined if the new role doesn't support that skill. Code:
<thing id="ftrDiplo" name="Diplomat" compset="FTRole"> <tag group="FTSkChc1" tag="ftSocial"/> <tag group="FTSkChc2" tag="ftPhysical"/> <tag group="FTSkChc2" tag="ftMental"/> <tag group="FTSkChc2" tag="ftSocial"/> <tag group="FTSkChc2" tag="ftCombat"/> </thing> Code:
<eval index="1" phase="PreTraits" priority="4500"> <before name="Calc trtFinal"/><![CDATA[ var skChoices1 as string var skChoices2 as string skChoices1 = field[FTRole].chosen.tagids[FTSkChc1.?, " | "] skChoices2 = field[FTRole].chosen.tagids[FTSkChc2.?, " | "] field[availSk1].text = skChoices1 field[availSk2].text = skChoices2 ]]> </eval> |
#9 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
Some examples. Assume these scripts are running on a thing called 'Shadow1'. In addition Shadow1 has been set with a tag of Helper.Food. Code:
~ Copy tag UseAttr.aDEX from aDEX Pick to ourself perform hero.child[aDEX].pulltags[UseAttr.aDEX] Code:
~ Copy any Helper tags from our self to the Hero container perform hero.pushtags[Helper.?] Hope that helps. Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
|
#10 |
|
|