Member
Volunteer Data File Author
Join Date: Apr 2005
Location: North Western Arizona
Posts: 97
|
Okay, I've encountered a new issue working on the 40k Tyranids.
For weapon options, I need to be able to have two costs that are dependent on another option. Using tags, I have it set up so that the costs are working like such: if (unit.tagis[tyTags.Gaunts] > 0) then if (unit.tagis[tyTags.Toxin] > 0) then @each = 4 else @each = 3 endif endif I have to do it this way, because there are like 5 units that all use the same weapon, but all have different costs. The problem is, is that the cost always displays as 0, until you actually buy the option. I don't see a way to set the 'text' or anything. Help! |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232
|
The value shown for a link is the value assigned to that link. If you are
using a script to calculate the value for a link, your script is being evaluated only after the link has been selected for the unit. That's why the value only appears correctly after the link is selected. Prior to that, the cost is whatever you have set it to, which is likely to be zero. The proper solution in the situation you describe is to utilize multiple links, each with a different "Live" tag expression and a different cost. The Live tagexpr will activate the correct link for the current circumstances, which will yield the behavior that you want. Hope this helps, Rob At 11:43 AM 6/16/2005 -0400, you wrote: >Okay, I've encountered a new issue working on the 40k Tyranids. > >For weapon options, I need to be able to have two costs that are dependent >on another option. Using tags, I have it set up so that the costs are >working like such: > >if (unit.tagis[tyTags.Gaunts] > 0) then >if (unit.tagis[tyTags.Toxin] > 0) then >@each = 4 >else >@each = 3 >endif >endif > >I have to do it this way, because there are like 5 units that all use the >same weapon, but all have different costs. > >The problem is, is that the cost always displays as 0, until you actually >buy the option. I don't see a way to set the 'text' or anything. Help! --------------------------------------------------------------------------- Rob Bowes (rob@wolflair.com) (408) 927-9880 Lone Wolf Development www.wolflair.com |
#2 |
Member
Volunteer Data File Author
Join Date: Apr 2005
Location: North Western Arizona
Posts: 97
|
Actually, what you suggest is preceisely what I'm doing now and I am trying to avoid. I've had many complaints from users about the way this works. The problem is, is say they buy their weapons first, and then go to add the option that increases the costs. It then highlights the weapon as invalid and forces them to unselect it and select the proper one.
Quote:
|
|
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232
|
Hmmm. I didn't realize that the options upon which the cost changes are based are frequently selected and deselected by the user. It seems kind of silly to me that a game would have equipment options that vary widely based on other options selected for that unit. Ah well. <shrug>
If the Live tagexpr technique isn't a viable approach, then you'll need to find a different way of conveying the price difference to the user. One method would be to use the "textcost" for the option. You can't change this valuee dynamically, but you could do something like have it show "3/5" for an option that costs either 3 points or 5 points (depending on the other factors). Another method would be specify "design" info for the option. Within the design info, you could specify the different costs and include the conditions as well. You could also combine this technique with the "textcost" method, or you could simply set the "textcost" to be the text "varies" (or something similar). Hope this helps, Rob At 11:15 AM 7/5/2005 -0400, you wrote: Quote:
Rob Bowes (rob@wolflair.com)******************************** (408) 927-9880 Lone Wolf Development************************************* www.wolflair.com |
|
#4 |
Member
Volunteer Data File Author
Join Date: Apr 2005
Location: North Western Arizona
Posts: 97
|
Is there a way to "externally" set the text cost of an option? Or perhaps even change it based on the unit it is showing up in via tags?
Problem is, is with the Tyranids for 40k, there are weapons that can be chosen by like up to 6 different squads, and just about each squad has a seperate cost, and about half of those have cost variations based on the presence of the toxin sacs tag. I'm trying to avoid having to use too many options, as that seems to be where we get the most bugs showing up during loading saved rosters and such. |
#5 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232
|
Wihtin V3.0, there is no way to change the "textcost" for an option
dynamically. In V3.1, you'll be able to override the "textcost" from within a link. However, there will be no way to change the "textcost" on the fly based on dynamic changes within the unit. Once a link is selected, the link is fully evaluated, so dynamic adjustments are easy. Prior to selection, the cost is a fixed value that is determined based on the link itself. Within V3.1, you ought to be able to have an assortment of links that override the "textcost" specific to the unit. Then you can use the approach I suggested previously. Use the link to have the "textcost" show the user the two separate prices for the option, one for with toxin sacs and one for without. These could be shown as "4/6" or something similar. This would give the user plenty of information prior to selecting the link, and it would still work within the current V3.1 framework. The only drawback with this is that you won't be able to leverage it officially until V3.1 is released. -Rob At 01:07 PM 7/8/2005 -0400, you wrote: >Is there a way to "externally" set the text cost of an option? Or perhaps >even change it based on the unit it is showing up in via tags? > >Problem is, is with the Tyranids for 40k, there are weapons that can be >chosen by like up to 6 different squads, and just about each squad has a >seperate cost, and about half of those have cost variations based on the >presence of the toxin sacs tag. I'm trying to avoid having to use too many >options, as that seems to be where we get the most bugs showing up during >loading saved rosters and such. --------------------------------------------------------------------------- Rob Bowes (rob@wolflair.com) (408) 927-9880 Lone Wolf Development www.wolflair.com |
#6 |
|
|