• 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

Setting "No Power Points"

Gumbytie

Well-known member
I have never though about Power Point Cost, with or without "No Power Points."

Lankhmar setting uses No Power Points.

There is an edge Strong Caster:
The character is adept at channeling raw magical essence. A character with this Edge reduces the initial Casting Modifier of all spells by 1, to a minimum of zero. For instance, a spell with a Casting Modifier of -2 only inflicts a -1 penalty to this mage.

I thought, easy enough. So I tried two versions of code and each gave the same error.

Code:
herofield[powPrtPts].value -= 1

Error: Attempt to access text-based field 'powPrtPts' as value.

Code:
herofield[powPoints].value -= 1

Error: Attempt to access text-based field 'powPoints' as value.

Hmm, so the Power Point Cost we assign to spells in the editor is text? Is it possible to modify the cost to make the above edge work within HeroLab?
 
Try this:
herofield[powPoints].text -= 1
It's just stored in a text field rather than a number field is all. You can still do math with it. You just have to be a little more careful. And since you're deep into this, here's the code to determine casting mods so you can see why:


Code:
    var castingmod as string
    var castingno1 as number
    var castingno2 as number
    var length1 as number
    var lengthall as number
    var start2 as number
    var length2 as number
    var rawnumber1 as number
    var rawnumber2 as number
    var iteminfo as string
    var divisor as number
    iteminfo = ""
    divisor = herofield[acCastDiv].value

if (hero.tagis[Hero.NoPowerPts] <> 0) then
      ~ #-#
      if (pos(field[powPoints].text,"-") > 0) then
        length1 = pos(field[powPoints].text,"-")
        start2 = pos(field[powPoints].text,"-") + 1
        lengthall = length(field[powPoints].text)
        length2 = lengthall - start2
        rawnumber1 = left(field[powPoints].text,length1)
        castingno1 = round(rawnumber1/herofield[acCastDiv].value,0,-1)
        rawnumber2 = right(field[powPoints].text,length2)
        castingno2 = round(rawnumber2/herofield[acCastDiv].value,0,-1)
        castingmod = "-" & castingno1 & " to -" & castingno2
      ~ #/section
      elseif (pos(lowercase(field[powPoints].text),"/section") > 0) then
        length1 = pos(lowercase(field[powPoints].text),"/section")
        rawnumber1 = left(field[powPoints].text,length1)
        castingno1 = rawnumber1
        castingmod = "-" & castingno1 & " per 2 sections"
      ~ Special
      elseif (pos(lowercase(field[powPoints].text),"special") > 0) then
        castingmod = "Special"
      ~ #/#
      elseif (pos(field[powPoints].text,"/") > 0) then
        length1 = pos(field[powPoints].text,"/")
        start2 = pos(field[powPoints].text,"/") + 1
        lengthall = length(field[powPoints].text)
        length2 = lengthall - start2
        rawnumber1 = left(field[powPoints].text,length1)
        castingno1 = round(rawnumber1/herofield[acCastDiv].value,0,-1)
        rawnumber2 = right(field[powPoints].text,length2)
        castingno2 = round(rawnumber2/herofield[acCastDiv].value,0,-1)
        castingmod = "-" & castingno1 & "/-" & castingno2
      ~ #+
      elseif (pos(field[powPoints].text,"+") > 0) then
        length1 = pos(field[powPoints].text,"+")
        rawnumber1 = left(field[powPoints].text,length1)
        castingno1 = round(rawnumber1/herofield[acCastDiv].value,0,-1)
        castingmod = "-" & castingno1 & "+"
      ~ #/Corpse
      elseif (pos(lowercase(field[powPoints].text),"/corpse") > 0) then
        length1 = pos(lowercase(field[powPoints].text),"/corpse")
        rawnumber1 = left(field[powPoints].text,length1)
        castingno1 = round(rawnumber1/herofield[acCastDiv].value,0,-1)
        castingmod = "-" & castingno1 & "/corpse"
      ~ #
      else
        castingno1 = round(field[powPoints].text/herofield[acCastDiv].value,0,-1)
        castingmod = "-" & castingno1
        endif
     iteminfo &= "Casting Modifier: " & castingmod & "{br}"
    else
      iteminfo &= "Power Points: " & field[powPoints].text & "{br}"
      endif
 
Egads, that makes my eyes bleed :)

Okay so I tried out your suggestion:

Setup/10000
Code:
herofield[powPoints].text -= 1

I get a syntax error: Only derived fields can generally be modified via scripts (field 'powPoints')

So should I be wrapping something further around that text?
 
I don't think herofield is right in this context. It should just be field, and you should be operating at the individual Power level.
 
It doesn't like

Code:
field[powPoints].text -= 1

Same error code.

By individual power level, this gets applied to every power by hand? I got lost on that part.

This is an Edge that applies the -1 (-2 for Improved version) to all spells known by the hero.

Do I have to do some sort of loop through every spell a hero has that acquires this edge? Not sure how to do that off the top of my head. I couldn't find good examples in the forums for affects applied to spells.
 
So I decided to revisit a bunch of my files and update them from Deluxe to SWADE. I went with Lankhmar. Which means I am back to this old problem.

Is it possible somehow to have an Edge modify the Casting Modifier of spells the character has. There are at least three Edges (I think) that adjust the Casting Modifier in some shape or form.

Take this Edge: Strong Caster
The character is adept at channeling raw magical essence.

A character with this Edge reduces the initial Casting Modifier of all spells by 1, to a minimum of zero. For instance, a spell with a Casting Modifier of -2 only inflicts a -1 penalty to this mage.


So in the perfect world, this would just work:
Setup/10000
Code:
field[powPoints].text -= 1
or
Code:
field[powPoints].value -= 1

Both of these will throw an error.

So has anyone been able to make this work somehow? Adjust the powPoints in some way?

Theoretically, an Edge like this could apply to setting that uses Power Points as well. Say an Edge that shaves off 1 or 2 Power Points cost from every spell a character knows. So solving this could prove helpful I think.

Right now, a player would just have to remember all his Edges that effect the Power Point Cost and do that math on his character sheet. Certainly doable but would be nice to have HeroLab do the math first before character sheet printed out.

Haven't seen a lot of activity on her besides myself and Caped Crusader. Hoping one of the other hard core guys still using HeroLab and might have some thoughts.
 
OK, without knowing what the error is, I can only guess.

I think the issue you're running into is that field[powPoints] is a text value, not a numeric one. Those should be throwing two different errors?

To give you an idea, here's the code to figure out that Casting Modifier:

Code:
          ~RDS SWD this was modified to display Casting Modifiers and altered Durations for No Power Points
          var castingmod as string
          var castingno1 as number
          var castingno2 as number
          var length1 as number
          var lengthall as number
          var start2 as number
          var length2 as number
          var rawnumber1 as number
          var rawnumber2 as number
          var iteminfo as string
          iteminfo = ""
        
          ~report the power point cost or casting modifier
          if (hero.tagis[Hero.NoPowerPts] <> 0) then
            ~ #-#
            if (pos(field[powPoints].text,"-") > 0) then
              length1 = pos(field[powPoints].text,"-")
              start2 = pos(field[powPoints].text,"-") + 1
              lengthall = length(field[powPoints].text)
              length2 = lengthall - start2
              rawnumber1 = left(field[powPoints].text,length1)
              castingno1 = round(rawnumber1/herofield[acCastDiv].value,0,-1)
              rawnumber2 = right(field[powPoints].text,length2)
              castingno2 = round(rawnumber2/herofield[acCastDiv].value,0,-1)
              castingmod = "-" & castingno1 & " to -" & castingno2
            ~ #/section
            elseif (pos(lowercase(field[powPoints].text),"/section") > 0) then
              length1 = pos(lowercase(field[powPoints].text),"/section")
              rawnumber1 = left(field[powPoints].text,length1)
              castingno1 = rawnumber1
              castingmod = "-" & castingno1 & " per 2 sections"
            ~ Special
            elseif (pos(lowercase(field[powPoints].text),"special") > 0) then
              castingmod = "Special"
            ~ #/#
            elseif (pos(field[powPoints].text,"/") > 0) then
              length1 = pos(field[powPoints].text,"/")
              start2 = pos(field[powPoints].text,"/") + 1
              lengthall = length(field[powPoints].text)
              length2 = lengthall - start2
              rawnumber1 = left(field[powPoints].text,length1)
              castingno1 = round(rawnumber1/herofield[acCastDiv].value,0,-1)
              rawnumber2 = right(field[powPoints].text,length2)
              castingno2 = round(rawnumber2/herofield[acCastDiv].value,0,-1)
              castingmod = "-" & castingno1 & "/-" & castingno2
            ~ #+
            elseif (pos(field[powPoints].text,"+") > 0) then
              length1 = pos(field[powPoints].text,"+")
              rawnumber1 = left(field[powPoints].text,length1)
              castingno1 = round(rawnumber1/herofield[acCastDiv].value,0,-1)
              castingmod = "-" & castingno1 & "+"
            ~ #/Corpse
            elseif (pos(lowercase(field[powPoints].text),"/corpse") > 0) then
              length1 = pos(lowercase(field[powPoints].text),"/corpse")
              rawnumber1 = left(field[powPoints].text,length1)
              castingno1 = round(rawnumber1/herofield[acCastDiv].value,0,-1)
              castingmod = "-" & castingno1 & "/corpse"
            ~ #
            else
              castingno1 = round(field[powPoints].text/herofield[acCastDiv].value,0,-1)
              castingmod = "-" & castingno1
              endif
            @text = "Casting Modifier: " & castingmod
          else
            @text = "{/b}Points:{b} " & field[powPoints].text
            endif
          ~@text = "{/b}Points:{b} " & field[powPoints].text
          @text &= "{horz 20}{/b}Range:{b} " & field[powRange].text

So in effect you have to pull out the number you want to play with, treat it like a number for your math, then put it back together. I'm not sure what the timing would be, this code gets called when needed.
 
Code:
field[powPoints].text -= 1

Error: Syntax error in 'eval' script for Thing 'edgStrongCa1' (Eval Script '#1') on line 1 -> Only derived fields can generally be modified via scripts (field 'powPoints)

Code:
field[powPrtPts].value -= 1

Error: Syntax error in 'eval' script for Thing 'edgStrongCa1' (Eval Script '#1') on line 1 -> Attempt to access text-based field 'powPoints' as value

I am not sure this will actually be possible. Will probably just have to continue with players tracking all this by hand. Each Edge taken reduces that Casting Modifier for every spell a character knows. It shaves that number right off the Power Points, thus the Casting Modifier.

If a spell costs 4 Power Points to cast, -4 on a Casting Modifier, the Strong Caster Edge reduces that by 1. So the spell now costs 3 Power Points, -3 on a Casting Modifier. Other Edges subtract more, in some cases reducing the Power Point cost and Casting Modifier to essentially '0.'

I see what that code you supplied is doing. But just don't see how I can affect it with the Edge Code I supplied, since they both error out.
 
Wow, once again CapedCrusader has crushed me with a new term I have never heard of! :)

Never seen it before or how to use it. Would it look something like this?

Code:
field[powPoints].text -= 1 trustme

I don't want to really try that without feedback, I have broken HeroLab enough times randomly trying out code combinations :D
 
Oh, forgive me, I thought you knew that one. It goes on the line preceding... although - it's text, so you may have to pull it into a number field to do the math then put it back... and try it without the trustme first. I modify that in Setup/1100 in the Arcane Powers object for the new Limitations and it doesn't need one. Oh, one other thing - most of the time it'll need a minimum value, hence the maximum function so if it's zero or below it'll stop at one.

Code:
var newpoints as number
newpoints = field[powPoints].text
newpoints -= 1
trustme
field[powPoints].text = maximum(newpoints, 1)
 
Last edited:
The gods of Lankhmar appear to be against me (:

I tried your code, Caped, with and without the trustme.

Code:
var newpoints as number
newpoints = field[powPoints].text
newpoints -= 1
trustme (tried it with and without)
field[powPoints].text = maximum(newpoints, 1)

Without trustme I get this error:

Error: Syntax error in 'eval' script for Thing 'edgStrongCa1' (Eval Script '#1') on line 4 -> Only derived fields can generally be modified via scripts (field 'powPoints)

With trustme I get this error:

Error: Syntax error in 'eval' script for Thing 'edgStrongCa1' (Eval Script '#1') on line 5 -> Only derived fields can generally be modified via scripts (field 'powPoints)

Thanks for all the help so far. I feel guilty when you answer, don't want to take away your time with all of the stuff you working on with Pathfinder, Companions, etc.

I will still experiment with this but players will keep tracking by hand for now.
 
OK, my mistake.
The reason it works for me is because I've changed that to a derived field in this latest version. I thought trustme would get around that for now.
 
OK, my mistake.
The reason it works for me is because I've changed that to a derived field in this latest version. I thought trustme would get around that for now.
 
Back
Top