I have an issue with my data files, and I'm looking for some ideas as to how to implement something. First, the basics:
1. The game uses a platoon structure. You select this by choosing the type of platoon from Available Units. Platoons have a maximum cost of 200 points.
2. Each platoon has a mandatory HQ, and several "sections." Each section has about four squads you can choose from, and you may not pick more than one from each section, though the various squads are repeated in other sections. A selection from the first section is mandatory. I have implemented this by creating entities for each section, which are then linked to the original platoon choice. You select the platoon, and the platoon's options are the sections.
3. After adding a section to the roster, you can select it in the roster window, and its options are the various squads that can be chosen from. I had originally wanted to just have picking a selection bring up a list, but some id addition to squads, there are also some sections that have weapon teams and vehicles, of which you can choose more than one, but choosing the teams precludes choosing a vehicle or squad, and choosing a light vehicle precludes choosing any squads, teams, or heavy vehicles, et cetera. At any rate, it was much easier to create exclusions for all of these as options rather than as entities chosen by a list.
4. Each platoon may also select one Platoon upgrade each. At the moment, this is another entity chosen just as the sections are, and the upgrades entity's options are the various upgrades that can be chosen. The cost of the upgrade counts against the platoon's maximum points.
THE PROBLEM: One of these upgrades gives one of the units in the platoon a special ability. I am having a difficult time figuring out how to implement this. I had experimented with using the Attachment option, but it only allows the selection of top-level entities, which are the platoons themselves. I'd considered making the squads top-level entities as well, attached to to the platoon, but if there are multiple platoons, there's no really good way to prevent the user from selecting squads in other platoons, or taking this upgrade twice from two different platoons, and applying the upgrades to squads in the same platoon.
My second thought was to give all squads eligible for the ability an option to enable the skill, and give the option a live tag expression. Selecting the upgrade would then apply the required tag, causing the option to become active. Then it would be simple enough to write a rule to give an error message if the option was selected more than once in the same platoon.
However, I'm having some difficulty making this happen. As near as I can tell, the way to do this would be for the ability to apply a tag every entity in the platoon using the children context, but so far, all of my attempts to make this happen have failed. (A global tag would do the trick, I think, but then the option becomes live in squads outside the platoon, which won't work.)
If anybody has any suggestions, I'm open to them. My alternative right now is to give the option to take the ability to every squad, write the rule limiting the number of times it can be taken, and then write a a rule that creates an error if a squad selects the ability and hasn't already selected the upgrade separately. This is less than ideal.
1. The game uses a platoon structure. You select this by choosing the type of platoon from Available Units. Platoons have a maximum cost of 200 points.
2. Each platoon has a mandatory HQ, and several "sections." Each section has about four squads you can choose from, and you may not pick more than one from each section, though the various squads are repeated in other sections. A selection from the first section is mandatory. I have implemented this by creating entities for each section, which are then linked to the original platoon choice. You select the platoon, and the platoon's options are the sections.
3. After adding a section to the roster, you can select it in the roster window, and its options are the various squads that can be chosen from. I had originally wanted to just have picking a selection bring up a list, but some id addition to squads, there are also some sections that have weapon teams and vehicles, of which you can choose more than one, but choosing the teams precludes choosing a vehicle or squad, and choosing a light vehicle precludes choosing any squads, teams, or heavy vehicles, et cetera. At any rate, it was much easier to create exclusions for all of these as options rather than as entities chosen by a list.
4. Each platoon may also select one Platoon upgrade each. At the moment, this is another entity chosen just as the sections are, and the upgrades entity's options are the various upgrades that can be chosen. The cost of the upgrade counts against the platoon's maximum points.
THE PROBLEM: One of these upgrades gives one of the units in the platoon a special ability. I am having a difficult time figuring out how to implement this. I had experimented with using the Attachment option, but it only allows the selection of top-level entities, which are the platoons themselves. I'd considered making the squads top-level entities as well, attached to to the platoon, but if there are multiple platoons, there's no really good way to prevent the user from selecting squads in other platoons, or taking this upgrade twice from two different platoons, and applying the upgrades to squads in the same platoon.
My second thought was to give all squads eligible for the ability an option to enable the skill, and give the option a live tag expression. Selecting the upgrade would then apply the required tag, causing the option to become active. Then it would be simple enough to write a rule to give an error message if the option was selected more than once in the same platoon.
However, I'm having some difficulty making this happen. As near as I can tell, the way to do this would be for the ability to apply a tag every entity in the platoon using the children context, but so far, all of my attempts to make this happen have failed. (A global tag would do the trick, I think, but then the option becomes live in squads outside the platoon, which won't work.)
If anybody has any suggestions, I'm open to them. My alternative right now is to give the option to take the ability to every squad, write the rule limiting the number of times it can be taken, and then write a a rule that creates an error if a squad selects the ability and hasn't already selected the upgrade separately. This is less than ideal.