Hello,
I am trying to add a mind control spell which can be used to a player or enemy combatant to switch faction for a few turns. So the player or AI can use the affected combatant and after few turns it resets. Can someone suggest how to achieve this functionality.
I do it with a Status Effect
So the ability does it's hit chance and stuff and applies the Charmed Status Effect, which handles duration for you (I use another formula here so that gear can increase duration too).
The Status Change Type in the Status Effect is Schematic, with On Apply
Starting Object is the combatant with the Status Effect applied.
The schematic just uses a Join Battle Group node on Starting Object and then whatever player group you want (like maybe you don't want it showing on your health HUD so put it in a different player group ID).
I also store the combatant to selected data and then do a Change Faction node but GiL said that is not needed. I feel like I had to add it for some reason but I can't remember lol.
The you do another Status Change Type Schematic as Remove and in the remove schematic reverse the process, joining them back to the enemy group.