Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Army Builder Forums > Army Builder
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Warmonger
Member
Volunteer Data File Author
 
Join Date: Apr 2005
Location: North Western Arizona
Posts: 97

Old June 16th, 2005, 07:43 AM
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!
Warmonger is offline   #1 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old July 4th, 2005, 05:00 PM
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
rob is offline   #2 Reply With Quote
Warmonger
Member
Volunteer Data File Author
 
Join Date: Apr 2005
Location: North Western Arizona
Posts: 97

Old July 5th, 2005, 07:15 AM
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:
Originally Posted by rob
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
Warmonger is offline   #3 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old July 5th, 2005, 11:15 PM
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:
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.

rob wrote:

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
---------------------------------------------------------------------------
Rob Bowes (rob@wolflair.com)******************************** (408) 927-9880
Lone Wolf Development************************************* www.wolflair.com
rob is offline   #4 Reply With Quote
Warmonger
Member
Volunteer Data File Author
 
Join Date: Apr 2005
Location: North Western Arizona
Posts: 97

Old July 8th, 2005, 09:07 AM
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.
Warmonger is offline   #5 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old July 8th, 2005, 10:49 PM
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
rob is offline   #6 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 04:19 PM.


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