Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System

Notices

Reply
 
Thread Tools Display Modes
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old March 25th, 2014, 11:33 AM
Hey all. I am trying to add the Silvered item material from Ravenloft. The description is as follows:

Quote:
Any metal weapon can be silvered for five times its listed cost. Apply this modifier before adding masterwork costs, if applicable.
I can modify the gCost field of the item, but it doesn't increase the cost of the item when you are purchasing it. The field gSizeCost appears to be the original cost of the item, and is set at Pre-levels/5000. gCost is the actual cost of the item, after material changes and other factors. Since I have to provide a cost of material based on the original cost, I have to run the script after gSizeCost is set. Running it before or after gCost is set doesn't seem to alter the cost of purchase, though. So, while the field does change, the cost doesn't. Just to be clear on what I am talking about, I've included a screenshot.

I've tried a few different things. The current script (for reference) is:

Pre-Levels/7500
Code:
var cost as number

cost = container.parent.field[gSizeCost].value*5

container.parent.field[gCost].value += cost
I've also tried "field[eMatCost].value = cost" at the bottom. Neither work. I think it's a timing issue, but I can't run it any earlier as far as I can tell.

Anyone know a way to do this? None of the other materials work this way.
Attached Images
File Type: png item_cost.png (240.1 KB, 4 views)

Last edited by Sendric; March 25th, 2014 at 11:59 AM.
Sendric is offline   #1 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old March 25th, 2014, 01:42 PM
I think you might need to mess around with the gCustMagic helper inside the gizmo to get this working. For example:

container.child[gCustMagic].field[gCustCost].value += 100
Aaron is offline   #2 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old March 26th, 2014, 07:27 AM
Thanks, Aaron! That worked perfectly. For the record, here is the code (run at Pre-levels/7500)

Code:
var cost as number

cost = container.parent.field[gSizeCost].value*5

container.child[gCustMagic].field[gCustCost].value = cost
Sendric is offline   #3 Reply With Quote
Reply

Thread Tools
Display Modes

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 01:06 PM.


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