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
Save-vs-DM
Member
 
Join Date: Jan 2010
Posts: 47

Old March 28th, 2016, 12:29 AM
First of all, I've already checked the Common Code Examples. There's something sort of like this, but the writeup was confusing. And not what I needed.

What I want to do:
Let a player select 1 more Major Hindrance.
Grant the player 1 additional Edge.

I put this in an Eval Script:
Code:
~This will offset the cost:
#resmax[resHinder] += 2
But it doesn't seem to work. I still get errors.

Can someone please help!
Save-vs-DM is offline   #1 Reply With Quote
SeeleyOne
Senior Member
 
Join Date: Nov 2009
Posts: 891

Old March 28th, 2016, 09:04 AM
It is because there is another resource being tracked. You need to change the total number of Major Hindrances as well as the total number of Hindrances.

There is a Simple for Hindrances. I made mine replace ThingID valHinders, but you might be able to have the timing be 8005 or something and effectively override it. You can make a copy of valHinders and modify what you want.

I will show my code, which has two effects:
1) It grants a total of 4 Hindrance points, but does not care if you select 4 Minors, 2 Majors, 3 Minors, 1 Major or 2 Minors, or whatever.

2) It allows me to change the total number of possible Hindrance points based on an option as chosen in the Configure Hero, where I created a radio button between a range, 3, 4, 5, or 6.

3) It allows an exception that grants a higher amount, in this case a Racial Property called Variable Mutation (It is technically a Hindrance but has no cost as the Hindrances chosen because of it create the points themselves).

It sounds like you want to do something like this. How are you making it grant the free Edge for the Major Hindrance? Your chosen method will determine the "hows". My personal preference is to let the player spend the points, but maybe you do not want them to possibly get an attribute point. So if you want to go by your initial plan, my recommendation for this is to have a mechanic that watches for it. It would look for the total Hindrance points and then reduce the total rewards points by 2 while granting an edge point. Then inside the simple have it allow for a higher value of total hindrance points (my limitation value) and increase the major by 1. You would not need to play the balancing game that I am doing as it would not affect the total for Minor. Again, just use a copy of the original to steer your correctly.

Validation 8000
Code:
var major as number
var minor as number
var limitation as number
limitation = 4

~ Take into account the options in Configure Hero
if (hero.tagis[source.Hinder3] = 1) then
   limitation -= 1
endif

if (hero.tagis[source.Hinder5] = 1) then
   limitation += 1
endif

if (hero.tagis[source.Hinder6] = 1) then
   limitation += 2
endif

if (hero.tagis[source.Hinder8] = 1) then
   limitation += 4
endif

~ Variable Mutation
if (hero.tagis[RacialProp.rpVarMutnt] = 1) then
   limitation += 4
endif

      ~iterate through all hindrances and tally up the number of majors and minors
      ~Note: We must only tally hindrances that are user added and not an advance.
      foreach pick in hero from Hindrance
        if (eachpick.isuser + !eachpick.tagis[Advance.?] >= 2) then
          if (eachpick.field[hinMajor].value = 0) then
            minor += 1
          else
            major += 2
            endif
          endif
        nexteach

      ~determine our maximum number of major and minor hindrances
      var max_major as number
      var max_minor as number

      ~RDS SWD Max Major and Max Minor are now dynamic values
      max_major = minimum(major, limitation)
      max_minor = minimum(minor, limitation - max_major)

      ~if we have no more than our maximum major and minor hindrances, we're good
      if (major <= max_major) then
        validif (minor <= max_minor)
        endif

      ~synthesize our validation message appropriately
      @message="Maximum of " & max_major & " points worth of major and " & max_minor & " points worth of minor hindrances allowed"

      ~mark associated tabs as invalid
      container.panelvalid[edges] = 0

      ~assign a tag to the hero to indicate the invalid state
      ~Note: This is used to color highlight the title above hindrances on the tab.
      perform hero.assign[Hero.BadHinders]
There are two eval scripts in the simple. I left the second one alone.

Evil wins because good rolls poorly .... or the players are not paying enough attention to the game.
SeeleyOne is offline   #2 Reply With Quote
Save-vs-DM
Member
 
Join Date: Jan 2010
Posts: 47

Old March 28th, 2016, 05:50 PM
Okay, I tried your suggestion, but I keep getting this error:

Syntax error in 'evalrule' script for Thing 'valGenHind' (Eval Rule '#1') on line 7 -> Tag 'source.Hinder3' not defined.

What did I do wrong?

What I want to do:
Make it so a character can take 2 major and 2 minor hindrances. That's it. That's all I need.

But I've opened up the script valHinders and I can't really tell what I need to change.
Save-vs-DM is offline   #3 Reply With Quote
SeeleyOne
Senior Member
 
Join Date: Nov 2009
Posts: 891

Old March 28th, 2016, 07:40 PM
That uses a source from my 1st file. I had left it in as an example of how to mod some things. If you want to do the same, place this into a text file and change it from .txt to .1st and place it in your savage folder. C:\ProgramData\Hero Lab\data\savage

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- This file contains all the user source for Civilized Savagery. -->
<document signature="Hero Lab Structure">

    <source
        id="HinCat"
        name="Hindrance Points at Creation"
        selectable="no"
        parent="UserParent"
        maxchoices="1"
        minchoices="1"
        description="Choose how many Hindrance Points that a character may select.">
    </source>

    <source
        id="Hinder3"
        name="3 Points in Hindrances (default)"
        parent="HinCat"
        sortorder="0"
        reportable="yes"
        description="Characters may have up to 3 points in Hindrances.">
    </source>

    <source
        id="Hinder4"
        name="4 Points in Hindrances"
        parent="HinCat"
        sortorder="1"
        reportable="yes"
        description="Characters may have up to 4 points in Hindrances.">
    </source>

    <source
        id="Hinder5"
        name="5 Points in Hindrances"
        parent="HinCat"
        sortorder="2"
        reportable="yes"
        description="Characters may have up to 5 points in Hindrances.">
    </source>

    <source
        id="Hinder6"
        name="6 Points in Hindrances"
        parent="HinCat"
        sortorder="3"
        reportable="yes"
        description="Characters may have up to 6 points in Hindrances.">
    </source>

    <source
        id="Hinder8"
        name="8 Points in Hindrances"
        parent="HinCat"
        sortorder="4"
        reportable="yes"
        description="Characters may have up to 8 points in Hindrances.">
    </source>

</document>

Evil wins because good rolls poorly .... or the players are not paying enough attention to the game.
SeeleyOne is offline   #4 Reply With Quote
SeeleyOne
Senior Member
 
Join Date: Nov 2009
Posts: 891

Old March 28th, 2016, 07:46 PM
To do just the 2 minor and 2 major you will want to replace the first eval script that shows up with this one. It should work, but I did not test it so I might be wrong.

Code:
      var major as number
      var minor as number

     major += 1

      ~iterate through all hindrances and tally up the number of majors and minors
      ~Note: We must only tally hindrances that are user added and not an advance.
      foreach pick in hero from Hindrance
        if (eachpick.isuser + !eachpick.tagis[Advance.?] >= 2) then
          if (eachpick.field[hinMajor].value = 0) then
            minor += 1
          else
            major += 2
            endif
          endif
        nexteach

      ~determine our maximum number of major and minor hindrances
      var max_major as number
      var max_minor as number

      ~RDS SWD Max Major and Max Minor are now dynamic values
      max_major = herofield[acMaxMajor].value + (hero.tagcount[Hero.HindMajor]*2)
      max_minor = herofield[acMaxMinor].value + hero.tagcount[Hero.HindMinor]

      ~if we have no more than our maximum major and minor hindrances, we're good
      if (major <= max_major) then
        validif (minor <= max_minor)
        endif

      ~synthesize our validation message appropriately
      @message="Maximum of " & max_major & " points worth of major and " & max_minor & " points worth of minor hindrances allowed"

      ~mark associated tabs as invalid
      container.panelvalid[edges] = 0

      ~assign a tag to the hero to indicate the invalid state
      ~Note: This is used to color highlight the title above hindrances on the tab.
      perform hero.assign[Hero.BadHinders]

Evil wins because good rolls poorly .... or the players are not paying enough attention to the game.
SeeleyOne is offline   #5 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old March 28th, 2016, 08:07 PM
If you want to do this the quick-and-easy way, you don't need a script. Go to the "Personal" tab, and at the bottom, add whatever permanent adjustments you want for the selected character.
EightBitz is offline   #6 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:41 AM.


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