Senior Member
Volunteer Data File Author
Join Date: Oct 2011
Posts: 121
|
Here's the situation:
-I have a set of items that are options for a unit. -Said options are collected into a set using the candidate tag expression. -I have a separate option, that if selected makes all of the previously mentioned options cheaper by a set amount (but no cheaper than a cost of 0). What I want: -To have the updated costs shown in the unit options pane. -To have the updated costs shown in the output. -To have the updated costs show in the selection window. I have managed to get the first two by using a pre-link on the special option to assign a tag to the parent that is then checked for in the pre-link script of all the options that can have their cost reduced. Unfortunately, when the cost is reduced to 0, it doesn't show 0, it has no cost displayed. Also the selection screen shows the original costs. I have a feeling that nothing short of overrides will adjust what is displayed in the selection screen (and overrides will not work here since I need entity level tags, not global tags), but maybe someone can point out a way. Ideally, I wanted to put this in once (as opposed to doing it for all affected items), but the cost script for the option that gathers up the items into a set didn't work out for me. I can live with the solution I have if I could get it to actually display the cost of 0 in the unit options on the side (non-zero values display properly) since other than this one quibble it reflects correctly in the output and unit options (I can live without it showing the new cost in the selection pane if that can't be done). Thanks, ~Antares My code doesn't have bugs; it has undocumented features! |
#1 |
Senior Member
Lone Wolf Staff
Join Date: Dec 2008
Posts: 4,690
|
I think you can do what you want by defining a childcost script on the items that are affected ("Chldcst" button at the top-right-ish of the item tab)? You should be able to test tags on the parent from there, and adjust the cost appropriately, *plus* the text displayed for that cost.
|
#2 |
Senior Member
Volunteer Data File Author
Join Date: Oct 2011
Posts: 121
|
Thanks, I'll give it a shot tonight. I didn't see that particular script discussed in the documentation. I'll give an update on whether or not it worked.
My code doesn't have bugs; it has undocumented features! |
#3 |
Senior Member
Volunteer Data File Author
Join Date: Oct 2011
Posts: 121
|
So, update time:
Setting a Chldcst script for each affected item did work overall: -The updated cost is shown in the selection screen. -The updated cost is shown in the roster view/output. -The updated cost shows correctly in the unit options if the cost is non-zero. It looks like no matter which way you adjust the cost of an item (and I tried several), if the item's cost is adjusted to 0, it will show with a blank cost (instead of a 0). This is inconsistent with the functionality elsewhere so I would call it a (minor) bug. Do you think that this will be fixed in the future? Obviously for now this is workable, but it does stand out among a list of items that are showing their cost. Colen, if you need concrete data to reproduce, PM me and I'll send/show you how to cause this behavior. ~Antares My code doesn't have bugs; it has undocumented features! |
#4 |
Senior Member
Volunteer Data File Author
Join Date: Oct 2011
Posts: 121
|
Hmm, I went back and looked at some of my pre-existing options since I had 1 or 2 that had a cost of 0. Looks like a natural cost of 0 causes a blank cost as well. Never noticed that before until this particular event made them stand out.
My code doesn't have bugs; it has undocumented features! |
#5 |
Thread Tools | |
Display Modes | |
|
|