Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Shadowrun
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
jbearwillis
Senior Member
 
Join Date: Dec 2009
Location: Independence, Mo
Posts: 797

Old August 18th, 2011, 05:31 PM
I am trying to input a new armor into the shadowrun data files.
It is the Form-Fitting Body Armor:
When worn in combination with other pieces of armor, the
form-fit armor rating is added to the other armor’s rating (ignore
the rule that only the highest value applies in the case of form-fitting
armor). When determining encumbrance, however, add only
half the rating (round down) of form-fitting body armor to the
ratings of other armor when comparing them to the wearer’s Body
x 2.
I have it put in and it works except that it isn't halving the encumbrance and I was wondering if anyone had an idea to get it to work.
Thanks for any help.
jbearwillis is offline   #1 Reply With Quote
jbearwillis
Senior Member
 
Join Date: Dec 2009
Location: Independence, Mo
Posts: 797

Old August 18th, 2011, 05:41 PM
I added Form-Fitting Body Armor and I got it to work except for halving the encumbrance.
This is what text says: When determining encumbrance, however, add only
half the rating (round down) of form-fi tting body armor to the
ratings of other armor when comparing them to the wearer’s Body
x 2.
Any ideas, thanks for any help
jbearwillis is offline   #2 Reply With Quote
jbearwillis
Senior Member
 
Join Date: Dec 2009
Location: Independence, Mo
Posts: 797

Old August 20th, 2011, 01:17 PM
No one has any idea. Any suggestion would help with this - it's driving me crazy. I suck at this. the scripting to do this eludes me. Has anyone attempted to do this or is it possible at this time with the Shadowrun data files.
Thanks for any help.
jbearwillis is offline   #3 Reply With Quote
jbearwillis
Senior Member
 
Join Date: Dec 2009
Location: Independence, Mo
Posts: 797

Old August 23rd, 2011, 01:42 PM
WoW, THe pathfinder herolab form gets help all the time - I guess this form is the red headed step child. LOL . No reply in 5 days.
jbearwillis is offline   #4 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old August 23rd, 2011, 01:55 PM
Whether a question is answered quickly or waits until I have a larger block of free time depends on the amount of time I'll need to study the problem before I can answer it, not which forum it's in, and I've had things really piling up the last week, so I'm sorry about that.
Mathias is online now   #5 Reply With Quote
jbearwillis
Senior Member
 
Join Date: Dec 2009
Location: Independence, Mo
Posts: 797

Old August 23rd, 2011, 03:22 PM
Sorry Mathias, was Just kidding, that's why I put the LOL in there, My bad. I know you are very busy. I will stand in the corner now and wait patiently for an answer to my question for my punishment.
thanks for the reply, JBear
jbearwillis is offline   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old August 31st, 2011, 04:32 PM
I'm very sorry about taking so long to get back to you on this - things have been pretty hectic for me recently.

At the top of the Hero Lab window, go to the Develop menu, and make sure "Enable Data File Debugging" is checked. Now, at the bottom of that menu, select "Floating Info Windows", then "Show Hero Fields".

Now, you have a list of all the fields that are storing data for the hero as a whole. Add your form-fitting armor item, and watch for things that change when you equip and un-equip that piece of armor. You'll see that acEncumBal and acEncumImp are changing (and that acEncumCur is equal to the greater of acEncumBal and acEncumImp).

So, what you need to do is to calculate what half the values are, and subtract them from those fields.

First, figuring out how to look up the ballistic and impact ratings of the armor - right-click on your piece of armor, and choose "Show Debug Fields for XXXXX" - look through that for the fields that store the ballistic and impact ratings for that armor - defBall and defImpac.

Now, let's create a script that calculates what half of each of those is (press the Eval Scripts button on this item in the editor, and add a new script):

Code:
 
var halfball as number
var halfimpact as number
 
~divide ballistic in half
halfball = field[defBall].value / 2
~round that up (since only half, rounded down should be applied to the total ballistic protection on the hero, and currently all of the rating is being applied, we need to subtract half, rounded up from the total on the hero)
halfball = round(halfball,0,1)
 
~divide impact in half
halfimpact = round(field[defImpac].value/2,0,1)
Next, we need to subtract those values from the appropriate fields on the hero:

Code:
 
herofield[acEncumBal].value -= halfball
herofield[acEncumImp].value -= halfimpact
Now, for timing - that's a little harder, and I don't have a good way to explain to you how to figure out what to use in a case like this where there aren't any examples of other things attempting something similar, so you'd normally test many different phases & priorities until you find one that works.

For this, you can use Phase: Pre-Traits and Priority: 10000 (those are entered at the top of the Eval Scripts window).
Mathias is online now   #7 Reply With Quote
jbearwillis
Senior Member
 
Join Date: Dec 2009
Location: Independence, Mo
Posts: 797

Old August 31st, 2011, 06:33 PM
Thanks Mathias I will try it out and no problem on when you got back to me - I understand all the things you have on your plate.No worries and thanks again.
jbearwillis is offline   #8 Reply With Quote
MicrowaveSafe
Junior Member
 
Join Date: Nov 2011
Posts: 4

Old November 21st, 2011, 09:28 PM
Sorry to resurrect an old thread but I was working on this same issue and had a couple minor issues with the end result. I changed it so it only applied if the armor was equipped, also it wasn't changing the acEncumCur so it was still flagging encumbrance improperly.

The below seems to work for me fully and my limited testing didn't encounter any issues (if you ended with more impact than ballistic etc).

Code:
~only proceed if we're equipped
doneif (field[grIsEquip].value = 0)

var halfball as number
var halfimpact as number
 
~divide ballistic in half
halfball = round(field[defBall].value/2,0,1)
 
~divide impact in half
halfimpact = round(field[defImpac].value/2,0,1)

~change hero encumbrance to match new values
herofield[acEncumBal].value -= halfball
herofield[acEncumImp].value -= halfimpact

~determine what current max encumbrance is (impact or ballistic) and subract the appropriate value
if (herofield[acEncumBal].value >= herofield[acEncumImp].value) then
   herofield[acEncumCur].value -= halfball
else
   herofield[acEncumCur].value -= halfimpact
endif
MicrowaveSafe is offline   #9 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 07:45 PM.


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