"Mutant" Fusing System - How do i approach it properly? (MV)

Im developing a game similar to “Mutants Genetic Gladiators”. The game features up to 7 elements, and each actor can have 2 of those elements. It is possible to “crossbreed” these actors. When this happens, All the possible elements of each actor are checked for, (e.g. Actor 1 has fire and water, actor 2 has water and earth) and 2 of them (1 from each actor) are picked and placed in a random new order, creating a new actor with those 2 elements.) The game does not create these actors dynamically, there is a large list of predetermined actors which will be the results of all possible combinations.

Im already in the process of commissioning a UI plugin that allows for the selection and variable-storing of an actor (because base MV engine does not allow to literally just select an actor the same way you would select an item). The selected actor will have their states/elements checked, then the process repeats with a second actor.

Now the real issue and question comes: How do i set up a common event in the most efficient way to have the confirmed elements be shuffled into a new order (but also considering that ONLY 1 element of each “parent” actor will be taken) which will determine the outcome?
(NOTE: The order of the elements changes the outcome, there can be both a “Water/Fire” actor and a “Fire/Water” actor (As well as Fire/Fire, Water/Water etc.).

Sorry i missunderstand.
The problem is solved using variables, conditional branches, and lookups—not collision plugins. Here is the correct structure:

1. Store the elements of the two parents in variables

Parent1_Element1, Parent1_Element2

Parent2_Element1, Parent2_Element2

2. Pick 1 element from each parent

Randomly choose between 1 and 2 for parent 1 → store in Picked1

Randomly choose between 1 and 2 for parent 2 → store in Picked2

3. Shuffle the order (2 elements → 2 possible orders)

Random 0 or 1 → if 0: Final1 = Picked1, Final2 = Picked2; if 1: Final1 = Picked2, Final2 = Picked1

4. Lookup table to determine the resulting actor

Create a lookup table (e.g., in an array, a JSON file, or a series of conditional branches) that maps the ordered pair (Final1, Final2) to the ID of the resulting actor.

With 7 elements and a meaningful order → 7×7 = 49 possible combinations. Feasible with conditional branches, but better with an array or a lookup plugin.

5. Create the resulting actor

Use the ID obtained from the lookup to add the actor to the party, database, or whatever is needed.

6. (Optional) Handling Fire/Fire, Water/Water, etc. cases

These are naturally included in the 7×7 table, so no extra code is needed.

Thank you for the input. The only problem is i have 0 knowledge of jscript. I let AI write a plugin that actually manages the lookup table and combines the elements etc. but i dont want to use anything AI-created in the final game, so im kind of at a loss.

Don’t worry, no problem,let me explain, let’s create few simple steps.


1 - Preparation (one-time setup)

Encode your 7 elements as numbers 1–7.
Use numbers 1–7 (Fire=1, Water=2, Earth=3, Air=4, Nature=5, Light=6, Dark=7)
| Where? |
Database → Common Events → new event “Init_ElementTable” (Trigger: None, called once at game start) sorry my engine is in italian, let me know if im wrong.
↓
Control Variable [100 + ActorID] = Constant <element1>
Control Variable [200 + ActorID] = Constant <element2>

Example: Actor 5 has Fire/Water

Control Variable [105] = 1
Control Variable [205] = 2


2. Parent selection

Your UI plugin writes
• 1. Var[10] = Parent 1 Actor ID
• 2. Var[11] = Parent 2 Actor ID


3. Pick one element per parent

In your breeding Common Even

Control Variable [20] = Random 1..2
Control Variable [21] = Random 1..2

t hen, for Parent 1 (repeat identical structure for Parent 2 → Var[31], using Var[11] and Var[21]):

Conditional Branch: Var[10] == 1
  Conditional Branch: Var[20] == 1
    Control Variable [30] = Var[101]
  Else
    Control Variable [30] = Var[201]
  End
Else
  Conditional Branch: Var[10] == 2
    Conditional Branch: Var[20] == 1
      Control Variable [30] = Var[102]
    Else
      Control Variable [30] = Var[202]
    End
  Else
    ... (one block per actor in your DB)
  End
End

i know. its so bored and confusional

This is the unavoidable cost of MV’s lack of variable indirection without JS. Put it in a Common Event “Pick_Element” that takes Var[10]/Var[20] as input and outputs Var[30], then call it twice (second call uses Var[11]/Var[21] → Var[31]). Cleaner.


4. Shuffle order, its easy

Control Variable [40] = Random 0..1

Conditional Branch: Var[40] == 0
  Control Variable [50] = Var[30]
  Control Variable [51] = Var[31]
Else
  Control Variable [50] = Var[31]
  Control Variable [51] = Var[30]
End

5. Build unique index

Control Variable [55] = Var[50]
Control Variable [55] *= 10
Control Variable [55] += Var[51]

Var[55] ranges 11–77, unique per ordered pair.


Hard part

6. Lookup table

Database → Common Events → “Lookup_Child” (Trigger: None). Input: Var[55]. Output: Var[60].

Conditional Branch: Var[55] == 11
  Control Variable [60] = <ActorID Fire/Fire>
Else
  Conditional Branch: Var[55] == 12
    Control Variable [60] = <ActorID Fire/Water>
  Else
    ...
    (49 branches total, flat chain)
  End
End

(Cover all 49 values: 11,12,13,14,15,16,17, 21,22,…,77)

7. Create child

Back in the breeding event, after Call Common Event: Lookup_Child:
Change Party Member: Add Var[60]


I know thats crazy…

I think you could skip both of the big branch chains with a bit of math, if every actor is one of the 49 element pairs. Put those 49 actors in the database in the same order as your roster grid, in blocks of 7. All the First Aspect 1 actors go first (Second Aspect 1 through 7), then First Aspect 2, and so on. Say they start at actor 11.

Then the lookup in steps 5 and 6 becomes:

Control Variables [60] = Var[50]
Control Variables [60] -= 1
Control Variables [60] *= 7
Control Variables [60] += Var[51]
Control Variables [60] += 10

The 10 is your first actor ID minus 1.

The same layout works backwards to get a parent’s elements from its ID, so you wouldn’t need step 1 or the per actor chain in step 3. For parent 1:

Control Variables [25] = Var[10]
Control Variables [25] -= 11
Control Variables [26] = Var[25]
Control Variables [25] /= 7
Control Variables [25] += 1
Control Variables [26] %= 7
Control Variables [26] += 1

Var[25] is the first element and Var[26] is the second. MV rounds variables down when you divide, which is what makes the /= 7 work. Then pick with Var[20] like before (1 → Var[30] = Var[25], 2 → Var[30] = Var[26]) and repeat for parent 2.

For step 7, Change Party Member in MV only lets you pick a fixed actor, not a variable. A one line Script command can do the add instead:

$gameParty.addActor($gameVariables.value(60));