Loading ...
Sorry, an error occurred while loading the content.

KNOWN spells (using variables)

Expand Messages
  • Chris McLaughlin
    Is it possible to use a defined variable to determine the number of spells known? Normal use: KNOWN:6,4,3 The class knows 6 0th level spells, 4 1st level
    Message 1 of 15 , Feb 27, 2005
    • 0 Attachment
      Is it possible to use a defined variable to determine the number of spells
      known?

      Normal use:

      KNOWN:6,4,3

      The class knows 6 0th level spells, 4 1st level spells and 3 2nd level
      spells



      Desired use:

      KNOWN:NumSpells,(NumSpells - 1),(NumSpells + 1)

      The class knows 'NumSpells' 0th level spells, ('NumSpells' - 1) 1st level
      spells and ('NumSpells' + 1) 2nd level spells



      Thanks,

      Chris





      [Non-text portions of this message have been removed]
    • Byngl
      Add HASSPELLFORMULA to the class definition (just HASSPELLFORMULA, no colon) Byngl ... spells ... level ... level
      Message 2 of 15 , Feb 27, 2005
      • 0 Attachment
        Add HASSPELLFORMULA to the class definition (just HASSPELLFORMULA, no
        colon)

        Byngl

        --- In pcgen@yahoogroups.com, "Chris McLaughlin" <kilthar@x> wrote:
        > Is it possible to use a defined variable to determine the number of
        spells
        > known?
        >
        > Normal use:
        >
        > KNOWN:6,4,3
        >
        > The class knows 6 0th level spells, 4 1st level spells and 3 2nd
        level
        > spells
        >
        > Desired use:
        >
        > KNOWN:NumSpells,(NumSpells - 1),(NumSpells + 1)
        >
        > The class knows 'NumSpells' 0th level spells, ('NumSpells' - 1) 1st
        level
        > spells and ('NumSpells' + 1) 2nd level spells
        >
        > Thanks,
        >
        > Chris
      • Chris McLaughlin
        That worked thanks. Is there a way to limit the total number of spells chosen regardless of the spells levels. I require this because the spells I am using do
        Message 3 of 15 , Feb 28, 2005
        • 0 Attachment
          That worked thanks.

          Is there a way to limit the total number of spells chosen regardless of the
          spells levels.

          I require this because the spells I am using do not actually have levels but
          uses levels to calculate the correct amount of power points used.

          The PC has a maximum number of spells they can know and is not in this case
          limited by level (as spell levels don't 'really' exist).



          Chris


          Add HASSPELLFORMULA to the class definition (just HASSPELLFORMULA, no
          colon)

          Byngl

          --- In pcgen@yahoogroups.com, "Chris McLaughlin" <kilthar@x> wrote:
          > Is it possible to use a defined variable to determine the number of
          spells
          > known?
          >
          > Normal use:
          >
          > KNOWN:6,4,3
          >
          > The class knows 6 0th level spells, 4 1st level spells and 3 2nd
          level
          > spells
          >
          > Desired use:
          >
          > KNOWN:NumSpells,(NumSpells - 1),(NumSpells + 1)
          >
          > The class knows 'NumSpells' 0th level spells, ('NumSpells' - 1) 1st
          level
          > spells and ('NumSpells' + 1) 2nd level spells
          >
          > Thanks,
          >
          > Chris






          [Non-text portions of this message have been removed]
        • Tir Gwaith
          ... Ok, that is a NOT fun tag. How long has it been around? Tir Gwaith LST Chimp
          Message 4 of 15 , Feb 28, 2005
          • 0 Attachment
            > Add HASSPELLFORMULA to the class definition (just HASSPELLFORMULA, no
            > colon)
            >
            > Byngl
            >

            Ok, that is a NOT fun tag. How long has it been around?

            Tir Gwaith
            LST Chimp
          • Kevin Brown
            ... Sounds like you are using a point system for Magic similar to what is under Psionics. The XPH does something similar. You have a maximum # of powers
            Message 5 of 15 , Feb 28, 2005
            • 0 Attachment
              > Is there a way to limit the total number of spells chosen regardless of the
              > spells levels.
              >
              > I require this because the spells I am using do not actually have levels but
              > uses levels to calculate the correct amount of power points used.
              >
              > The PC has a maximum number of spells they can know and is not in this case
              > limited by level (as spell levels don't 'really' exist).

              Sounds like you are using a point system for Magic similar to what is under
              Psionics. The XPH does something similar. You have a maximum # of powers
              known, but your level is the only thing that really restricts what level those
              powers can be. Well, that and you have to pick them at the level you get them
              or lose those slots :)

              So, take a look at the RSRD part of the Psionics to see how Psions and Psychic
              Warriors were coded up.
            • taluroniscandar
              ... regardless of the ... levels but ... this case ... is under ... powers ... level those ... you get them ... and Psychic ... Sounds more like Sovreign Stone
              Message 6 of 15 , Feb 28, 2005
              • 0 Attachment
                --- In pcgen@yahoogroups.com, "Kevin Brown" <kevin_brown@q...> wrote:
                > > Is there a way to limit the total number of spells chosen
                regardless of the
                > > spells levels.
                > >
                > > I require this because the spells I am using do not actually have
                levels but
                > > uses levels to calculate the correct amount of power points used.
                > >
                > > The PC has a maximum number of spells they can know and is not in
                this case
                > > limited by level (as spell levels don't 'really' exist).
                >
                > Sounds like you are using a point system for Magic similar to what
                is under
                > Psionics. The XPH does something similar. You have a maximum # of
                powers
                > known, but your level is the only thing that really restricts what
                level those
                > powers can be. Well, that and you have to pick them at the level
                you get them
                > or lose those slots :)
                >
                > So, take a look at the RSRD part of the Psionics to see how Psions
                and Psychic
                > Warriors were coded up.

                Sounds more like Sovreign Stone to me but that said just giving a
                KNOWN tag without a CAST tag (like in psionics) might work.

                If you want to be able to use already coded spells (such as from the
                rsrd) then set the KNOWN numbers all into 9th level. Since you can
                learn lower spells in higher slots this could give you the effect you
                seem to be looking for.
              • Paul W. King
                ... Almost 2 months. Why is it not fun? You can put a formula in once and be done with it. Paul W. King TM SB, OGL/PL Chimp, Data Gibbon, BoD
                Message 7 of 15 , Feb 28, 2005
                • 0 Attachment
                  > Ok, that is a NOT fun tag. How long has it been around?

                  Almost 2 months. Why is it not fun? You can put a formula in once and
                  be done with it.

                  Paul W. King
                  TM SB, OGL/PL Chimp, Data Gibbon, BoD
                • Tir Gwaith
                  ... That one wasn t run by the Data team that s for sure. No parameter on the tag. We avoid those like the plague. Tir Gwaith LST Chimp
                  Message 8 of 15 , Feb 28, 2005
                  • 0 Attachment
                    > > Ok, that is a NOT fun tag. How long has it been around?
                    >
                    > Almost 2 months. Why is it not fun? You can put a formula in once and
                    > be done with it.

                    That one wasn't run by the Data team that's for sure. No parameter on the
                    tag. We avoid those like the plague.

                    Tir Gwaith
                    LST Chimp
                  • Byngl
                    It is no more oddball than HASSUBCLASS, which is valid with or without a parameter... Byngl ... and ... on the
                    Message 9 of 15 , Feb 28, 2005
                    • 0 Attachment
                      It is no more oddball than HASSUBCLASS, which is valid with or
                      without a parameter...

                      Byngl

                      --- In pcgen@yahoogroups.com, "Tir Gwaith" <thoron-tir-gwaith@l...>
                      wrote:
                      > > > Ok, that is a NOT fun tag. How long has it been around?
                      > >
                      > > Almost 2 months. Why is it not fun? You can put a formula in once
                      and
                      > > be done with it.
                      >
                      > That one wasn't run by the Data team that's for sure. No parameter
                      on the
                      > tag. We avoid those like the plague.
                      >
                      > Tir Gwaith
                      > LST Chimp
                    • Eddy Anthony
                      ... Is this tag necessary? What are the implications if this were simply made the default behavior of KNOWN. -- ~ Eddy Anthony (MoSaT) ~ PCGen Content
                      Message 10 of 15 , Feb 28, 2005
                      • 0 Attachment
                        Byngl scribed:

                        > Add HASSPELLFORMULA to the class definition (just HASSPELLFORMULA, no
                        > colon)
                        >
                        > Byngl

                        Is this tag necessary?
                        What are the implications if this were simply made the default behavior of
                        KNOWN.
                        --
                        ~ Eddy Anthony (MoSaT)
                        ~ PCGen Content Silverback
                      • Byngl
                        The tag was added so the arithmetic parser (JEP or otherwise) need not be called unnecessarily, which could possibly slow PCGen down more... Byngl ...
                        Message 11 of 15 , Feb 28, 2005
                        • 0 Attachment
                          The tag was added so the arithmetic parser (JEP or otherwise) need
                          not be called unnecessarily, which could possibly slow PCGen down
                          more...

                          Byngl

                          --- In pcgen@yahoogroups.com, Eddy Anthony <eddyba@m...> wrote:
                          > Byngl scribed:
                          >
                          > > Add HASSPELLFORMULA to the class definition (just
                          HASSPELLFORMULA, no
                          > > colon)
                          > >
                          > > Byngl
                          >
                          > Is this tag necessary?
                          > What are the implications if this were simply made the default
                          behavior of
                          > KNOWN.
                          > --
                          > ~ Eddy Anthony (MoSaT)
                          > ~ PCGen Content Silverback
                        • Eddy Anthony
                          ... Ah, then yes, yes it is necessary :) -- ~ Eddy Anthony (MoSaT) ~ PCGen Content Silverback
                          Message 12 of 15 , Feb 28, 2005
                          • 0 Attachment
                            Byngl scribed:

                            > The tag was added so the arithmetic parser (JEP or otherwise) need
                            > not be called unnecessarily, which could possibly slow PCGen down
                            > more...

                            Ah, then yes, yes it is necessary :)
                            --
                            ~ Eddy Anthony (MoSaT)
                            ~ PCGen Content Silverback
                          • Byngl
                            I suppose that when loading the class, if the CAST or KNOWN tags had non-integer values (other than the comma separators), it could be turned on
                            Message 13 of 15 , Feb 28, 2005
                            • 0 Attachment
                              I suppose that when loading the class, if the CAST or KNOWN tags had
                              non-integer values (other than the comma separators), it could be
                              turned on automagically...

                              Byngl

                              --- In pcgen@yahoogroups.com, Eddy Anthony <eddyba@m...> wrote:
                              > Byngl scribed:
                              >
                              > > The tag was added so the arithmetic parser (JEP or otherwise) need
                              > > not be called unnecessarily, which could possibly slow PCGen down
                              > > more...
                              >
                              > Ah, then yes, yes it is necessary :)
                              > --
                              > ~ Eddy Anthony (MoSaT)
                              > ~ PCGen Content Silverback
                            • Frugal
                              ... The first thing that the parser does is check to see if the argument is a number or not. If it is a number it just returns the numeric value of the
                              Message 14 of 15 , Mar 1, 2005
                              • 0 Attachment
                                Byngl wrote:

                                >The tag was added so the arithmetic parser (JEP or otherwise) need
                                >not be called unnecessarily, which could possibly slow PCGen down
                                >more...
                                >
                                >

                                The first thing that the parser does is check to see if the argument is
                                a number or not. If it is a number it just returns the numeric value of
                                the argument. So there is no speed penalty to having a tag always taking
                                a formula. In fact it will be quicker than having to check this new tag
                                to see if it a formula and then having the parser perform pretty much
                                the same check again...

                                regards,
                                Frugal
                              • Byngl
                                I just wrote a quick test to test this. I made a for loop that called 100000 iterations for 3 different cases as follows: common: int loopCount; long t_start;
                                Message 15 of 15 , Mar 1, 2005
                                • 0 Attachment
                                  I just wrote a quick test to test this. I made a for loop that called
                                  100000 iterations for 3 different cases as follows:

                                  common:
                                  int loopCount;
                                  long t_start;
                                  long t_stop;
                                  int t;
                                  String formula = "1";

                                  1)
                                  t_start = System.currentTimeMillis();
                                  for(loopCount = 100000; loopCount > 0; --loopCount)
                                  {
                                  t = aPC.getVariableValue(formula, "").intValue();
                                  }
                                  t_stop = System.currentTimeMillis();
                                  System.err.println(Long.toString(t_stop - t_start));

                                  average time in ms for 20 attempts: 36.65


                                  2)
                                  hasSpellFormulas = false;

                                  t_start = System.currentTimeMillis();
                                  for(loopCount = 100000; loopCount > 0; --loopCount)
                                  {
                                  if (hasSpellFormula())
                                  {
                                  t = aPC.getVariableValue(formula, "").intValue();
                                  }
                                  else
                                  {
                                  t = Integer.parseInt(formula);
                                  }
                                  }
                                  t_stop = System.currentTimeMillis();
                                  System.err.println(Long.toString(t_stop - t_start));

                                  average time in ms for 20 attempts: 15.75


                                  3)
                                  hasSpellFormulas = true;

                                  t_start = System.currentTimeMillis();
                                  for(loopCount = 100000; loopCount > 0; --loopCount)
                                  {
                                  if (hasSpellFormula())
                                  {
                                  t = aPC.getVariableValue(formula, "").intValue();
                                  }
                                  else
                                  {
                                  t = Integer.parseInt(formula);
                                  }
                                  }
                                  t_stop = System.currentTimeMillis();
                                  System.err.println(Long.toString(t_stop - t_start));

                                  average time in ms for 20 attempts: 34.4


                                  Byngl

                                  --- In pcgen@yahoogroups.com, Frugal <frugal@p...> wrote:
                                  > The first thing that the parser does is check to see if the
                                  argument is
                                  > a number or not. If it is a number it just returns the numeric
                                  value of
                                  > the argument. So there is no speed penalty to having a tag always
                                  taking
                                  > a formula. In fact it will be quicker than having to check this new
                                  tag
                                  > to see if it a formula and then having the parser perform pretty
                                  much
                                  > the same check again...
                                  >
                                Your message has been successfully submitted and would be delivered to recipients shortly.