Senior Member
Join Date: Jan 2009
Location: Austin, TX
Posts: 140
|
OK, after spending most of the weekend trying to get something going for a game system not already in HL, I'm exhaused from the learning curve.
I have a very light programming background (bash scripts a plenty, and a book on Java and Python under my belt, but no seasoned programmer to be sure). Anyway, I've been reading the wiki until my brain feels like... I don't know. But now I've had a beer and a half, and though I'm feeling better, I'm still struggling to understand some of the skeleton code (the beer will help, right?): So I'm going to attempt to enhance my learning by deciphering the following code bit by bit. For the love of the gods, if anyone can help that would be appreciated. Code:
<procedure id="DshRolls" scripttype="mouseinfo"><![CDATA[ var final as string var roll as string foreach pick in hero where "DashTacCon.Rolls" if (eachpick.tagis[component.Skill] <> 0) then roll = eachpick.field[sklRoll].text & "{text clrsecond} (" & eachpick.field[trtFinal].text & " + " & eachpick.linkage[attribute].field[name].text & " " & eachpick.linkage[attribute].field[trtFinal].text & "){text clrreset}" else roll = "????" endif final &= eachpick.field[name].text & " {b}" & roll & "{/b}{br}" nexteach @text = "{align left}" & final ]]></procedure> |
#1 |
Senior Member
Join Date: Jan 2009
Location: Austin, TX
Posts: 140
|
proceedure id = DshRolls : OK a unique ID for this proceedure. Got it.
scripttype="mouseinfo" : I have no idea what this means. <![CDATA[ : This is an XML construct to deal with conflicting reserved characters. We pretend it isn't there. var final as string var roll as string : We are defining variables here, "final" and "roll" they will contain string data. foreach pick in hero where "DashTacCon.Rolls" : OK here is where I start to have trouble. hero is the character "container" we are creating, pick is... I dunno. everything with the element/thing/don'tknowtheproperterm DashTacCon.Rolls... ??? Last edited by Mettius; February 19th, 2017 at 03:47 PM. |
#2 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,207
|
scripttype determines what types of scripts are allowed to call this procedure, because some scripts have special behaviors or options that can only be done on those types of scripts. So scripttype tells the procedure what type of script it will be used in. Here's the wiki page about procedures, which is where it lists all the scripttype options that are available.
http://hlkitwiki.wolflair.com/index.php5?title=Procedure_Element_(Data) Here's a youtube recording of a seminar I gave at Gen Con, covering how to set up searches (like the foreach operation) in Hero Lab: https://www.youtube.com/watch?v=9UPWoih8-q8&t=161s Post #7 in this thread is also about foreaches: http://forums.wolflair.com/showthread.php?t=21663 |
#3 |
Senior Member
Join Date: Jan 2009
Location: Austin, TX
Posts: 140
|
Another bit confusing me:
Code:
<inputthing name="Linked Attribute for Skill" helptext="Select the attribute used to calculate the dice pool for this skill."> <it_linkage compset="Attribute" linkage="attribute"/> </inputthing> Compset Attribute contains three components... Code:
<compset id="Attribute" forceunique="yes"> <compref component="Attribute"/> <compref component="Trait"/> <compref component="CanAdvance"/> </compset> Code:
<linkage linkage="attribute" optional="no"/> |
#4 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,207
|
An <inputthing> element defines a line on an editor entry. In that case, this is a place in the editor where the user is selecting which attribute to assign to the "attribute" linkage on that skill.
Try opening the editor, and create a new file. Then, go to the skills tab, and try creating a new skill. You'll see an entry with that name - "Linked Attribute for Skill", and when you try the drop-down, you'll see a list of every item from the Attribute compset. If you look at the XML generated by the editor, you'll see that what you get is: Code:
<link linkage="attribute" thing="attrSam"/> So that will generate the sort of records you're seeing in the thing_skills.dat file. |
#5 |
Thread Tools | |
Display Modes | |
|
|