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
Gumbytie
Senior Member
 
Join Date: Jun 2010
Location: Florida
Posts: 235

Old August 3rd, 2023, 03:28 AM
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:
Quote:
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?
Gumbytie is offline   #1 Reply With Quote
CapedCrusader
Senior Member
Volunteer Data File Contributor
 
Join Date: Aug 2009
Posts: 1,550

Old August 3rd, 2023, 07:33 AM
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

_
Currently In Development: Savage Pathfinder, SWADE Fantasy Companion
Future Development: SWADE Super Powers Companion, SWADE Sci-Fi Companion
_
Currently Running: Savage Unity Inc. (homebrew multiverse theme)
Setting Files Supported: Deadlands: Reloaded, Flash Gordon, Gaslight, Hellfrost, Interface Zero 2.0, Seven Worlds, Slipstream, Solomon Kane
Future Setting Files: Savage Judge Dredd
CapedCrusader is online now   #2 Reply With Quote
CapedCrusader
Senior Member
Volunteer Data File Contributor
 
Join Date: Aug 2009
Posts: 1,550

Old August 3rd, 2023, 07:33 AM
Dang zombies anyway LOL

_
Currently In Development: Savage Pathfinder, SWADE Fantasy Companion
Future Development: SWADE Super Powers Companion, SWADE Sci-Fi Companion
_
Currently Running: Savage Unity Inc. (homebrew multiverse theme)
Setting Files Supported: Deadlands: Reloaded, Flash Gordon, Gaslight, Hellfrost, Interface Zero 2.0, Seven Worlds, Slipstream, Solomon Kane
Future Setting Files: Savage Judge Dredd
CapedCrusader is online now   #3 Reply With Quote
Gumbytie
Senior Member
 
Join Date: Jun 2010
Location: Florida
Posts: 235

Old August 3rd, 2023, 09:12 AM
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?
Gumbytie is offline   #4 Reply With Quote
CapedCrusader
Senior Member
Volunteer Data File Contributor
 
Join Date: Aug 2009
Posts: 1,550

Old August 3rd, 2023, 09:44 AM
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.

_
Currently In Development: Savage Pathfinder, SWADE Fantasy Companion
Future Development: SWADE Super Powers Companion, SWADE Sci-Fi Companion
_
Currently Running: Savage Unity Inc. (homebrew multiverse theme)
Setting Files Supported: Deadlands: Reloaded, Flash Gordon, Gaslight, Hellfrost, Interface Zero 2.0, Seven Worlds, Slipstream, Solomon Kane
Future Setting Files: Savage Judge Dredd
CapedCrusader is online now   #5 Reply With Quote
Gumbytie
Senior Member
 
Join Date: Jun 2010
Location: Florida
Posts: 235

Old August 3rd, 2023, 10:20 AM
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.
Gumbytie is offline   #6 Reply With Quote
CapedCrusader
Senior Member
Volunteer Data File Contributor
 
Join Date: Aug 2009
Posts: 1,550

Old August 4th, 2023, 08:21 AM
Odd. The field "powPoints" *is* a derived field.

_
Currently In Development: Savage Pathfinder, SWADE Fantasy Companion
Future Development: SWADE Super Powers Companion, SWADE Sci-Fi Companion
_
Currently Running: Savage Unity Inc. (homebrew multiverse theme)
Setting Files Supported: Deadlands: Reloaded, Flash Gordon, Gaslight, Hellfrost, Interface Zero 2.0, Seven Worlds, Slipstream, Solomon Kane
Future Setting Files: Savage Judge Dredd
CapedCrusader is online now   #7 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 11:57 AM.


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