Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Savage Worlds

Notices

Reply
 
Thread Tools Display Modes
SeeleyOne
Senior Member
 
Join Date: Nov 2009
Posts: 891

Old September 20th, 2015, 06:27 PM
In my house rules, I use a somewhat different version of several of the Arcane Backgrounds. I have there be a single Arcane Background edge, and what it does is it opens up the Faction Menu, calling it "Arcane Background". There are two main reasons that I do this:

1) I can have multiple versions of the same Arcane Background without having to rewrite all of the Edges that reference them with each new one. They look for a wildcard version instead. For example, for the Magic, which includes a slight variation called "Sorcerer" (the only difference being that it has Spellcasting use Spirit instead of Smarts), and these can all be referenced by a reference to "hero.tagis[Faction.facARCM?]". I have all of the magic ids start with facARCM, being differentiated by what follows that. This is the same concept used for Knowledge skills.

2) I can have two versions of the same Arcane Background so that an individual campaign can have an option as to whether or not to give a character with the Arcane Background its Arcane skill at d4 for free. I do this by having one version have the skill bootstrapped, accompanied by an eval script to cover the skill point cost, and the other does not have that. This can also be done with a mechanic but having two versions seems to work better.

The above is just some background as to why I will reference a Psionic arcane background in the code below. I allow Psionics to be able to learn any Power, regardless of Rank. However, they have a -1 penalty per rank difference.

Additionally, I have created an edge called Power Focus that has you select a power from the list of known powers. This mechanic that I am going to show will look for the Power Focus for a given power and add the total modifier to the power. So if you have Power Focus for Bolt twice it will add a +4 to the side of the "Bolt" listing. I might change it from being +2 per edge, but for now that is what we are keeping it. If it proves to be too powerful we will change it.

Here is the mechanic that references the Power Focus choice and compares it to the known power.

Phase: Final
Priority: 5011 (I had it this due to some other mods, but you should be able to get away with a different number).

Code:
var psionic as number
psionic = 0

if (hero.tagis[Faction.facARCP?] = 1) then
   psionic = 1
endif

if (psionic = 1) then
   var crank as number
   var prank as number
   var powerFocus as number
   var powerName as string
   var modifier as number
   var modDisplay as string
   crank = herofield[acRank].value

   ~ Iterate through the known Powers.
   foreach pick in hero from Power
      prank = 0
      modifier = 0
      modDisplay = ""

      ~ Determine the modifier
      prank = eachpick.tagvalue[MinRank.?]
      powerName = eachpick.field[name].text
      powerFocus = 0
      modifier = crank - prank

      ~ Loop through the Power Focus edges and count those that apply.
      foreach pick in hero from Edge
         if (eachpick.tagis[Edge.edgPowFoci] <> 0) then
            if (compare(powerName, eachpick.field[usrChosen1].chosen.field[name].text) = 0) then
               powerFocus += 2
            endif
         endif
      nexteach

      modifier = modifier + powerFocus

      ~ Create the modifier display
      if (modifier < 0) then
         modDisplay = " (" & modifier & ")"
      endif

      if (modifier > 0) then
         modDisplay = " (+" & modifier & ")"
      endif

      ~ Display the modifier.
      eachpick.field[livename].text = eachpick.field[name].text & modDisplay
   nexteach
endif

if (psionic = 0) then
   var powerFocus as number
   var powerName as string
   var modifier as number
   var modDisplay as string

   ~ Iterate through the known Powers.
   foreach pick in hero from Power
      modifier = 0
      modDisplay = ""

      ~ Determine the modifier
      powerName = eachpick.field[name].text
      powerFocus = 0

      ~ Loop through the Power Focus edges and count those that apply.
      foreach pick in hero from Edge
         if (eachpick.tagis[Edge.edgPowFoci] <> 0) then
            if (compare(powerName, eachpick.field[usrChosen1].chosen.field[name].text) = 0) then
               powerFocus += 2
            endif
         endif
      nexteach

      modifier = modifier + powerFocus

      ~ Create the modifier display
      if (modifier > 0) then
         modDisplay = " (+" & modifier & ")"
      endif

      ~ Display the modifier.
      eachpick.field[livename].text = eachpick.field[name].text & modDisplay
   nexteach
endif
Even if you don't care for the mod, it does show a way to compare a user choice within a given foreach loop -- two of them in fact. Figuring out the syntax for that combination was tricky. I had stumbled across the compare function which was the key to making it work.

Evil wins because good rolls poorly .... or the players are not paying enough attention to the game.
SeeleyOne is offline   #1 Reply With Quote
SeeleyOne
Senior Member
 
Join Date: Nov 2009
Posts: 891

Old September 22nd, 2015, 04:17 PM
I have made a few changes to the above code. I decided to also have the mechanic look for the Conviction and Healer Edges. Healer gives a +2 to cast all healing powers, so it might as well show up on the sheet. Conviction is from Deadlands I think, but I stole it as a general Edge, but I reduced its bonus from +2 to +1 as I felt that was too powerful.

Code:
var psionic as number
psionic = 0

if (hero.tagis[Faction.facARCP?] = 1) then
   psionic = 1
endif

if (psionic = 1) then
   var crank as number
   var prank as number
   var powerFocus as number
   var powerName as string
   var modifier as number
   var modDisplay as string
   crank = herofield[acRank].value

   ~ Iterate through the known Powers.
   foreach pick in hero from Power
      prank = 0
      modifier = 0
      modDisplay = ""

      ~ Determine the modifier
      prank = eachpick.tagvalue[MinRank.?]
      powerName = eachpick.field[name].text
      powerFocus = 0
      modifier = crank - prank

      ~ Add +2 if has Healer Edge and is a healing power.
      if (hero.tagis[Edge.edgHealer] = 1) then
         if (eachpick.tagis[Power.powGrHeal] <> 0) then
            modifier += 2
         endif
         if (eachpick.tagis[Power.powHealing] <> 0) then
            modifier += 2
         endif
         if (eachpick.tagis[Power.powSuccor] <> 0) then
            modifier += 2
         endif
      endif

      ~ Loop through the Power Focus edges and count those that apply.
      foreach pick in hero from Edge
         if (eachpick.tagis[Edge.edgPowFoci] <> 0) then
            if (compare(powerName, eachpick.field[usrChosen1].chosen.field[name].text) = 0) then
               powerFocus += 2
            endif
         endif
      nexteach

      modifier = modifier + powerFocus

      ~ Create the modifier display
      if (modifier < 0) then
         modDisplay = " (" & modifier & ")"
      endif

      if (modifier > 0) then
         modDisplay = " (+" & modifier & ")"
      endif

      ~ Display the modifier.
      eachpick.field[livename].text = eachpick.field[name].text & modDisplay
   nexteach
endif

if (psionic = 0) then
   var powerFocus as number
   var powerName as string
   var modifier as number
   var modDisplay as string
   var baseMod as number

   baseMod = 0

   ~ Apply Conviction bonus of +1 to all Powers.
   if (hero.tagis[Edge.edgConvict] = 1) then
      baseMod += 1
   endif

   ~ Iterate through the known Powers.
   foreach pick in hero from Power
      modifier = baseMod
      modDisplay = ""

      ~ Determine the modifier
      powerName = eachpick.field[name].text
      powerFocus = 0

      ~ Add +2 if has Healer Edge and is a healing power.
      if (hero.tagis[Edge.edgHealer] = 1) then
         if (eachpick.tagis[Power.powGrHeal] <> 0) then
            modifier += 2
         endif
         if (eachpick.tagis[Power.powHealing] <> 0) then
            modifier += 2
         endif
         if (eachpick.tagis[Power.powSuccor] <> 0) then
            modifier += 2
         endif
      endif

      ~ Loop through the Power Focus edges and count those that apply.
      foreach pick in hero from Edge
         if (eachpick.tagis[Edge.edgPowFoci] <> 0) then
            if (compare(powerName, eachpick.field[usrChosen1].chosen.field[name].text) = 0) then
               powerFocus += 2
            endif
         endif
      nexteach

      modifier = modifier + powerFocus

      ~ Create the modifier display
      if (modifier > 0) then
         modDisplay = " (+" & modifier & ")"
      endif

      ~ Display the modifier.
      eachpick.field[livename].text = eachpick.field[name].text & modDisplay
   nexteach
endif

Evil wins because good rolls poorly .... or the players are not paying enough attention to the game.
SeeleyOne is offline   #2 Reply With Quote
Reply

Thread Tools
Display Modes

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 05:15 AM.


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