Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Army Builder Forums > Army Builder

Notices

Reply
 
Thread Tools Display Modes
Bluefool
Member
 
Join Date: Jan 2006
Location: Iowa City, IA
Posts: 78

Old January 27th, 2006, 09:59 AM
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 .
Bluefool is offline   #1 Reply With Quote
harkan
Senior Member
Volunteer Data File Author
 
Join Date: Mar 2005
Posts: 345

Old January 27th, 2006, 11:22 AM
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
harkan is offline   #2 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old January 27th, 2006, 12:18 PM
At 10:59 AM 1/27/2006, you wrote:

Quote:
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.
Harkan's proposed solution works fine, but it can also be a bit complex to setup, since you have to worry about Live expressions, link priorities, and the evaluation sequence. There is a second, easier way to solve this that it sounds like you already began to try. I'll outline it in more detail, since it turns out there isn't a topic on this within the docs (so you didn't miss it!).

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
rob is offline   #3 Reply With Quote
Bluefool
Member
 
Join Date: Jan 2006
Location: Iowa City, IA
Posts: 78

Old January 27th, 2006, 01:13 PM
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!
Bluefool is offline   #4 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 03:43 AM.


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