View Single Post
ploturo
Member
 
Join Date: May 2021
Posts: 84

Old April 24th, 2022, 02:02 AM
The reason the ability scores default to 10 is most likely because that is what the default value for the aUser field is set to be in the definition of the BaseAttr component (which is something we have no way to change).

You can set up a script which sets all of the attributes to 8, and keeps track of itself so it only does it once.

(You can do the following more cleanly by creating your own custom Component that has a single field to keep track of whether the script has run, instead of creating and bootstrapping a new tracker Thing. With your own single-field Component and Thing you won't have the extra overhead of the Tracker component code running each evaluation cycle, but the advantage of just using the existing tracker Component is that it can be done with the editor instead of editing XML files.)
  • Create a new Tracker in the editor and give it a unique id.
  • Set the "Base Charges" field to 1.
  • Click the button to add a new tag, and add the Hide.Tracker tag.
  • Add the following script, with the phase set to Pre-Attributes (the priority doesn't matter and can stay at 100):
    Code:
    doneif (field[trkUser].value = 1)
    
    
    ~ don't change anything if any ability score isn't the default of 10
    ~ or if a race or any class levels have been added, so that hopefully
    ~ we don't accidentally override scores on existing characters which
    ~ were created without this source active
    
    foreach pick in hero where "component.BaseAttr"
       if (eachpick.field[aUser].value <> 10) then
          goto finished
       endif
    nexteach
    if (#totallevelcount[] > 0) then
       goto finished
    endif
    if (hero.tagcount[Race.?] > 0) then
       goto finished
    endif
    
    
    ~ set all ability scores to the new default of 8
    
    trustme
    foreach pick in hero where "component.BaseAttr"
       eachpick.field[aUser].value = 8
    nexteach
    
    
    ~ don't run this script again
    finished:
    field[trkUser].value = 1
  • Go to your Mechanic that overrides AttrCost, and add a bootstrap. Enter the uniqueid of the tracker Thing you just created (you don't need to set up anything else on the bootstrap).

It should work, but you will probably need to do a Quick Reload and not just a Test.
ploturo is offline   #9 Reply With Quote