View Single Post
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,621

Old June 19th, 2022, 05:00 PM
I am trying to make a script that adds one to the count for an advance only if the advance has a cost of 4 xp. I'd like for the iteration to ignore advances in the count if it has a cost other than 4xp. Ultimately, once the code is counting correctly I will divide it by 4 and round up so the advance applies to the level it was attained at.

Here is the code I came up with.
For some reason it's still counting the advances that cost less than 4 xp and I want it to not do that. How could I fix the code? Ideas?

      doneif (field[advCost].value <> 4)

      if (tagis[AdvanceCat.Advancement] <> 0) then

          var advcount as number
          var advcur as number
          var i as number

          advcur = field[advOrder].value
          for i = 1 to advcur
            if (field[advCost].value = 4) then
              advcount += 1 

            field[advCount].value = advcount 
            advcount /= 4
            advcount = round(advcount,0,1)


RavenX Pronouns: She/Her

Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you.

I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all.
RavenX is offline   #1 Reply With Quote