• Hello game master! Welcome to our growing community. Please take a moment to Register (top right button, see how: Slides).

    If you use Campaign Logger, you can use the same login details - we've linked the app to this forum for secure and easy single sign-on for you.

    And please drop by the Introductions thread and say hi.

How to avoid duplicates in two or more entries

Hannu

Mythras Guru
Gold WoA
Wizard of Story
Wizard of Combat
I have two generators

FormationFighting that has entries like Line, Square, Wedge etc

Another one named Shieldwall: Line, Square, Circle

I have a unit that has both of these FormationFighting and Shieldwall - I would like to avoid duplicates in the result. So no matter what wedge should not come up twice in the result for that unit. Each of these generators are able to come up with multiple choices for example result might be

from Formation Fighting -> Line´, Square, Wedge and from Shieldwall: Line, Circle

End result for the unit should be Line, Square, Circle, Wedge

How should I do this currently?
 

ELF

Generator Sage
Wizard of Story
Wizard of Combat
Sadly there is currently no way to evaluate variable values. How many duplicates are there between the two tables?

If not many, would it be feasible to create multiple shield wall tables, each with a one of the dupes missing? You could first call the formation table, with each of the formation entries specifying which shield wall table to call. So the formation entry of wedge would call a shield wall table without the wedge.

If there are plenty of duplicates, another way to solve this could be doing things backwards. Have a single table containing all the duplicates, and call with the unique {!table} call twice, setting the result of the first call to a formation variable and the next result to a shield wall variable. This guarantees that you have two different results at you disposal. After that you could do the real shield wall call from a table that either returns the shield wall variable, or a non-duplicate result. Weigh the table entries to produce probabilities to your liking.
 
Last edited:

Hannu

Mythras Guru
Gold WoA
Wizard of Story
Wizard of Combat
This would be wonderful feature. In addition it would be lovely to be able to sort the resulting list...
 

Hannu

Mythras Guru
Gold WoA
Wizard of Story
Wizard of Combat
Will need to resort to your brute force tactic
 

Hannu

Mythras Guru
Gold WoA
Wizard of Story
Wizard of Combat
I have multiple combat styles like the above.... it is going to be awkward. could be done, but awkward. I have this ruby program I built to generate the previous flat list for fonritan experience several megabytes in size which I was able to refactor to normal tables in Campaign logger recently - easier to understand, change and much smaller. and atom does not complain / freeze on the file size
 

ELF

Generator Sage
Wizard of Story
Wizard of Combat
Hmm, that does sound like a headache... Maybe decision trees with intermediate step(s) could alleviate some of the pain?

If you first randomize the initial choice, and from there call the next step involving options that would work well with the already selected option?

Maybe you could even consider generating only the most optimal, hand-picked combinations without being able to produce every combo that could potentially occur? (I know this proposition is not going to fly.)
 
Top