Lone Wolf Development Forums  

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

Notices

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

Old June 2nd, 2015, 07:14 AM
I just came up with an even more efficient code for enforcing Novice and character creation and for enforcing the Rank while choosing Advances.

It can also be used with an alternate XP table. All that you have to do (as far as Rank is concerned) is change the value of xpPerRank in this code and you are done. You would possibly have to alter the number of Advances in a different Eval script.

I spread out the code a bit so that it is easier for us to read.

Phase: Final
Priority: 5010

Code:
    var endRank as number
    var xpPerRank as number
    var advPerRank as number
    var advCount as number
    var xp as number
    var xpRank as number
    var rankCount as number
    var endRank as number

    xpPerRank = 20
    advPerRank = xpPerRank / 5
    advCount = 0
    xp = hero.child[resXP].field[resMax].value
    xpRank = xpPerRank
    rankCount = 0
    endRank = 0

   ~ Check for spent Advances
   foreach pick in hero from Advance sortas _CompSeq_
      advCount += eachpick.field[advCost].value
   nexteach

   ~ Determine Rank based on current Advance
   ~ Seasoned
   rankCount = advPerRank -1
   if (advCount >= rankCount) then
      if (xp >= xpRank) then
          endRank = 1
      endif
   endif

   ~ Veteran
   rankCount = rankCount + advPerRank
   xpRank = xpRank + xpPerRank
   if (advCount >= rankCount) then
      if (xp >= xpRank) then
          endRank = 2
      endif
   endif

   ~ Heroic
   rankCount = rankCount + advPerRank
   xpRank = xpRank + xpPerRank
   if (advCount >= rankCount) then
      if (xp >= xpRank) then
          endRank = 3
      endif
   endif

   ~ Legendary
   rankCount = rankCount + advPerRank
   xpRank = xpRank + xpPerRank
   if (advCount >= rankCount) then
      if (xp >= xpRank) then
          endRank = 4
      endif
   endif

   ~ Apply the Rank
   herofield[acRank].value = endRank

Evil wins because good rolls poorly .... or the players are not paying enough attention to the game.
SeeleyOne is offline   #11 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 12:36 PM.


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