Member
Join Date: Jan 2006
Location: Iowa City, IA
Posts: 78
|
Ok, I'm trying to set up an option so that if you select one option, the daughter option appears and you can select if if you want.
I've tried setting child types, setting one option as a link to the other and its various settings, and I'm not getting it. The second option never appears. I also tried ripping of other data files (yes, its a habit now...), and still no luck. Can someone point me yet again to the appropriate doc section? And before I get flamed for it, yes I have read the documentation...all of it. However, I'm not a programmer and so most of it is out of context to me or just plain greek. Finding the answer in the docs means knowing exactly how to phrase the question, which I'm learnign but its still getting there. And, thanks again for all the info people have posted below; it got me a huge leap in understanding, and it is adding up...slowly perhaps in my case . |
#1 |
Senior Member
Volunteer Data File Author
Join Date: Mar 2005
Posts: 345
|
u can set the first option to attach a tag to the unit using unit.assign and then set the second option to have a live statement to check for this new tag. Ensure the second option has a lower priority that the first option though otherwise it won't work.
i.e u have a unit with an option that is add spears. When the unit has got spears and only when they can choose shields. Attached to the eval script for the option 'spears' is: var retval as number retval = unit.assign[defence.shield] and in the live statement for the option shield is: defence.shield In this example the spear option is at priority 10, the shield is at priority 20 |
#2 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232
|
At 10:59 AM 1/27/2006, you wrote:
Quote:
The technique is often referred to by Colen and myself as "chained options". Like the links in a chain, a sequence of options are connected in a cascading fashion. From the user's perspective, when Option1 is selected, Option2 appears and becomes selectable. When Option2 is selected, Option3 becomes available. If Option2 is deslected, Option3 disappears and it automatically deselected if needed. If Option1 is deselected, Option2 disappears and is automatically deselected (as if Option3, since it depends on the now-defunct Option2). It sounds like this is the exact type of behavior you want. To set this up, you need to do a few things. I'm going to outline the simple case of two chained options, but the technique can apply to any number of them. First, create Option1 and Option2 as two separate options. Once that is done, edit Option1 and create a link within Option1 that connects to Option2. Make sure the link nature of the link to Option2 is "cost", and make sure the link nature attaching Option1 to a unit is also "cost". This will then display Option1 on the unit. If Option1 is selected, Option2 will appear. That should be all there is to it. If this isn't working for you, start out with two brand new options that have no other settings and try it again. It's possible that other aspects of the options are gumming up the works. Hope this helps, Rob |
|
#3 |
Member
Join Date: Jan 2006
Location: Iowa City, IA
Posts: 78
|
Thanks again to both of you; the "chained option" is what I was trying for, and I could have sworn that was how I had tried it....but deleting it and following your step by step got it working.
Which means 2 races down, 4 to go! |
#4 |
Thread Tools | |
Display Modes | |
|
|