Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
ShadowWalker
Senior Member
 
Join Date: Jun 2014
Posts: 243

Old February 22nd, 2017, 04:33 AM
Using the Add New Ability I was able to easily get Add New Skill to work.
I tried using the same formula for Add New Spell but it's not adding the new thing as a pick. It's properly displaying the the advancement with the name of the spell, but it's not adding it as a pick.

At a loss for what to do next.

component for adding a new spell
Code:
  <thing
    id="advNewSpel"
    name="Gain a New Spell"
    compset="Advance"
    description="Select a new Spell of your choice.">
    <fieldval field="advAction" value="New Spell"/>
    <fieldval field="advDynamic" value="component.Spell"/>
    <tag group="Advance" tag="AddNew"/>
    <!-- Modify tagexpr to deny Skills that have already been added to the character -->
    <eval index="1" phase="Render" priority="1000">
      <before name="Assign Dynamic Tagexpr"/><![CDATA[
      ~get the list of all Skills on the hero and assemble it as a list of precluded tags
      var tagexpr as string
      tagexpr = hero.tagids[Spell.?," & !"]

      ~if there are any tags to exclude, append them to the tagexpr appropriately
      field[advDynamic].text = splice(field[advDynamic].text,tagexpr," & !")
      ]]></eval>

    <!-- Attach the child entity for tracking the advance -->
    <child entity="Advance">
      <tag group="Advance" tag="MustChoose"/>
      </child>
    </thing>
component for spells
Code:
	<component
	    id="Spell"
		name="Spell"
		autocompset="no"
		panellink="magic">

		<field
			id="spComplexL"
			name="Complexity Level"
			type="static">
		</field>

		<field
			id="spTime"
			name="Casting Time"
			type="static"
			maxlength="60">
		</field>
		
		<field
			id="spRange"
			name="Range"
			type="static"
			maxlength="60">
		</field>

		<field
			id="spDuration"
			name="Duration"
			type="static"
			maxlength="60">
		</field>

		<field
			id="spEML"
			name="Spell EML"
			type="derived">
		</field>

		<linkage linkage="Skill1"/>

		<identity group="Spell"/>

		<eval index="1" phase="Final" priority="10000">
			<after name="Calc sklMLFinal"/><![CDATA[
			if (islinkage[Skill1] <> 0) then
				field[spEML].value = linkage[Skill1].field[sklML].value - (field[spComplexL].value * 5)
			endif
		]]></eval>

		<!-- Each spell costs 1 or 2 Spell Option Points -->
		<eval index="2" phase="Traits" priority="10000">
			<before name="Calc resLeft"/>
			<after name="Bound trtUser"/><![CDATA[
			~if this Spell is not added directly to the hero (i.e. an advance), skip it entirely
			doneif (origin.ishero = 0)

			
			~adjust the resource appropriately
			if (tagis[Helper.StartSpell] <> 0) then
			    if (islinkage[Skill1] <> 0) then
					if (linkage[Skill1].tagis[Skill.skNeutral] <> 0) then
						hero.child[resSpell].field[resSpent].value += field[spComplexL].value * 2
					else
						hero.child[resSpell].field[resSpent].value += field[spComplexL].value * 1
					endif
				endif
			endif
		]]></eval>

		<evalrule index="1" phase="Validate" priority="10000" message="?" issilent="yes"><![CDATA[
			var expr as string
			foreach pick in hero where "User.Convocatio"
				if (empty(expr) <> 0) then
					expr = eachpick.tagids[Skill.?,""]
				else
					expr &= " | " & eachpick.tagids[Skill.?,""]
				endif
			nexteach
			
			validif (tagcountstr[expr] > 0)
			~mark the tab as invalid
			linkvalid = 0
		]]></evalrule>

		<prereq message="Convocation not avaiable!" issilent="yes">
			<validate><![CDATA[
				var expr as string
				foreach pick in hero where "User.Convocatio"
					if (empty(expr) <> 0) then
						expr = eachpick.tagids[Skill.?,""]
					else
						expr &= " | " & eachpick.tagids[Skill.?,""]
					endif
				nexteach
				if (@ispick = 0) then
					@valid = altthing.tagcountstr[expr]
				else
					@valid = altpick.tagcountstr[expr]
				endif
			]]></validate>
		</prereq>
		</component>
ShadowWalker is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old February 22nd, 2017, 07:47 AM
You've checked the pick list (Develop...Floating Info Windows...Show Selection List), and you're certain it's not present?

If it is present there, are there any autotags normally added to spells from the table that they're normally added from, that would need to be added to the advancement, too?


Also, I don't see anywhere in the scripts for that component that assigns the Spell identity tag to the hero, but you've got the script on your advancement looking for those tags, in order to make sure the spells don't end up duplicated.
Mathias is offline   #2 Reply With Quote
ShadowWalker
Senior Member
 
Join Date: Jun 2014
Posts: 243

Old February 22nd, 2017, 09:04 AM
I checked the Show Selection List and the spell is not listed, but the advancement is.

You are correct I forgot to forward the spell tag. Fixed that thanks.
ShadowWalker is offline   #3 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old February 22nd, 2017, 09:09 AM
Does the compset for spells include CanAdvance?
Mathias is offline   #4 Reply With Quote
ShadowWalker
Senior Member
 
Join Date: Jun 2014
Posts: 243

Old February 22nd, 2017, 09:24 AM
That was the problem. I thought it was meant to be used for Increases only, not both adds and increases.
ShadowWalker is offline   #5 Reply With Quote
Reply


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 10:29 PM.


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