• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Question regarding the following for the 40K files

shaggai

Well-known member
Using exclusions and the following scripts allows for a parent unit to take an option and a child to take an option, but both can only take the option x number of times.

script for parent post-link:
~ Removes option for singular items from child unit
if (usage[smHeavy01] = 1) then
child[unit:daSargeDWT].option[smAssaultC].enablement = 0
child[unit:daSargeDWT].option[smHeavyFla].enablement = 0
endif

script for child post-link:
~ Removes option for singular items from parent unit
if (usage[smHeavy01] = 1) then
parent.option[smAssaultC].enablement = 0
parent.option[smHeavyFla].enablement = 0
endif

So that if the parent takes either [smAssaultC] or [smHeavyFla] the children cannot. Note that the options for the above choices have the [smHeavy01] exclusion (and it has a min of 0 and a max of 1).

Now what I would like to know is that if something can work like this, but only between multiple children of a parent unit, especially where the parent unit does not have the option available - only the children do?

That is, if a parent can choose multiple childen, and each of those children has an option that can only be taken two times between them how would I word the scripts so that either of the children can take the option up to a maximum of 2 time or once each?
 
is it worth running it of tags??

The option tags the parent and a rule checks at unit level to see if there are more than two tags set, if more than two are found then flag up an error??
 
I might have to go the tags/rule route. I thought the above worked correctly - but started to reach a point where I found it was not working as I had originally expected.
 
At 02:23 PM 3/15/2007, you wrote:
That is, if a parent can choose multiple childen, and each of those children has an option that can only be taken two times between them how would I word the scripts so that either of the children can take the option up to a maximum of 2 time or once each?
There is NO way to enforce relationships between two child entities. Due to AB's evaluation sequence, child1 is processed and then child2 is processed. There is NO way for child2 to have any influence on child1, so selecting an option on child1 could block it on child2, but selecting an option on child2 could NOT block it on child1. The only way to resolve and interdependency like this is via the use of rules.

-Rob
 
At 11:47 AM 3/16/2007, you wrote:
The option tags the parent and a rule checks at unit level to see if there are more than two tags set, if more than two are found then flag up an error??
The evaluation sequence applies to everything. This includes the assignment sequence of tabs. So the parent could NOT enforce something on child1 based on actions within child2.

-Rob
 
Back
Top