• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Add New Item in advancement

ShadowWalker

Well-known member
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>
 
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.
 
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.
 
Back
Top