• 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

New Derived trait

allpowerfulbob

New member
Hello everyone,

I've been reading through the other threads and have not found any scripts that quite fit what I am trying to do with this new derived trait.

The trait would be Cyber Psychosis, when a character has too much cyberware and begins to lose their connection to humanity.

Basically it would be equal to half the max strain trait, rounded up. But no matter how I change my script this number stays at 2. I'm not sure if it's the timing I have set up on it or not. Any help you guys could offer would be much appreciated. I'll drop my script in down below.

Thanks!

var bonus as number
var bonusadd as number
bonus = round(#trait[trSFStrnMx] / 2,0,1)
perform field[trtBonus].modify[+,bonus,"Half Max Strain"]
 
I take it this is in the "Derived Traits" tab as an Eval Script? If so you might try a timing of Traits/4000 instead. I'm pretty sure Derived Traits have to happen after all of the other trait calculations are made. At least that's what I have happening on my ETU data file for Academics, along with After Scripts: Calc trtFinal, Before Scripts: Derived trtFinal and Script Name: Calc Derived Bonus. (Not sure if the last is needed or what, but it's what I have in there that seems to work if that helps any.) Timing is definitely a tricky thing to work with.
 
You need one in Pre-Traits 4000 to establish the initial value. Then you can change it later. Whenever I make one I copy one and make changes to its copy.
 
Thanks for the suggestions guys, it still seems like it's not working. I'm not sure if it's my script (though that's a direct copy from toughness), or the timing still.

I'm also now getting an error message, "Specified thing is actively in use. All references must be deleted before changes can be applied."

So I tried deleting the old derived trait, but copied my script and all to notepad, and tried creating a new blank trait. It still wasn't working, but now I'm noticing that even though I've deleted the traits, they're still showing up on my source thing list and cluttering up my character sheets with extra derived traits.

Is there some way to delete source things so they stop appearing?

Thanks for all the help, I'm almost afraid I've junked up my whole user file and just need to start over again.
 
Fist, you should almost always set a source on anything you set up in the editor. That can help keep things tidy and not have something you set up show up absolutely everywhere when you don't want it to.

I am wondering if you maybe made some copies of your data file in the same location, though? That could cause problems as well.

I could try and take a look at what the issue is if you want to email a copy of the file to zarlor at acm dot org.
 
Thanks for sending the file. A couple of things off the bat, under Derived Traits: trSRCybPs3 (Cyber Psycho) and trSRMxStrn (Max Strain), did not have their sources set, so that is likely the issue you were seeing with them showing up all over the place.

Also some Equipment and other things in your file are set to include things like "Modern" or "Futuristic" for a source, which is fine but just be aware that it means that equipment will be available and show up an ANY character where they select Modern or Futuristic as a source, with all the same costs and so on. So all of the characters you make, if they have any of those sources set, will show Shadowrun stuff even if you might not want that to be the case. Personally if I want something to be available globally for my players I'll create a HouseRules file to put that stuff in.

Now to the nitty gritty. It looks like you tried to reuse the script on "Max Strain" and "Cyber Psyco"and BOTH define the variables for "bonus" and "bonusadd". In the scripts where it sets:
Code:
var bonus as number
var bonusadd as number
What you are doing is creating a new variable called "bonus" and "bonusadd" and defining those variable to be of the type "number" so it knows they are supposed to represent numbers, but you already defined those things in another script so one of them will always keep overwriting the values from the other one. Try setting them to something more Unique so on "Max Strain" maybe use something like:

Code:
var msbonus as number
var msbonusadd as number

And on Cyber Psycho maybe:

Code:
var cpbonus as number
var cpbonusadd as number

Of course also replace all references to the "bonus" and "bonusadd" variables in the rest of the scripts with the appropriate names you defined as well. See if that makes any difference, and don't forget to set the "Source" on them.
 
Last edited:
Back
Top