Hello, I've been reading through the wiki & other posts but can't seem to find any answers on this; is there any way to make all actors share the same deck, and draw from it when its their turn respectively?
Deckbuilder Combat System for your games · By
Hello ariDingus,
Folks on the Discord have already figured this one out so we are posting their solution here for Shared Actor Decks:
1. You'll need to make a change to the CGC v1.6.2 Core Engine plugin file, open it in a text editor/IDE and go to line 5491. You will need to change the if statement to match the following:
2. Create a new Actor (called this one DummyLeader) and set them to an empty Class (one with no Skills to Learn). If you are using Block Generate, make sure to include <Hide Health> and <Hide Block> notetags so that it is the party members taking the damage and not the leader.
3. Create two Common Events: one which will execute before a Battle (here called Dummy Leader Start) and one that will execute after a Battle (here called Dummy Leader Cleanup).
Dummy Leader Start will add the Dummy Leader and then add all the Cards from other Party Members and apply the FullStun state on them (keeps them Stunned until the end of battle). You will also need to initialize any local variables you need for Card Actions to process. In the screenshot, it should have the local variables we use for the Demo Project. We also override Max Battle Members function to allow for 1 more Actor.
Script Call for DummyLeader Start
$gameParty.swapOrder(0, $gameParty.members().length - 1); $gameParty.leader()._skillCards.clear(); $gameParty.leader()._cardDeck.clear(); Game_Party.prototype.maxBattleMembers = function() { return 5; }; for(var i = 1; i < $gameParty.members().length; i++) { $gameParty.members()[i]._skillCards._data.forEach((skill) => {$gameParty.leader().addCardToZone(skill._skillId, "deck")}); $gameParty.members()[i].addState(19); }
Dummy Leader Cleanup is a lot simpler. The Dummy Leader must lose all their Cards, the previous Party Leader should be put on back on top and reset the MaxBattleMembers function in case there are any battles that don't use the Dummy Leader. Lastly, we remove the DummyLeader from the Party as we are only using them for Battles.
Script Call for Dummy Leader Cleanup
$gameParty.leader()._skillCards.clear(); $gameParty.leader()._cardDeck.clear(); $gameParty.swapOrder(0, $gameParty.members().length - 1); Game_Party.prototype.maxBattleMembers = function() { return 4; };
4. Before any Battle Processing Event, make sure you include a call to the DummyLeader Start Common Event and after the event make sure to include a call to the DummyLeader Cleanup Event.
There are still a few things remaining such as making the DummyLeader not targetable by Enemy or Ally actions. Those can be achieved through other plugins like YEP Target Core and YEP Selection Control.
This solution can also work if you don't want a Dummy Leader. You will just need to save the old deck of that Actor and then like Dummy Leader clear their deck and add the Cards again. Note: If you are using Independent Card Variables plugin, those values won't transfer over as the newly added Cards will have them set to initial values.
Once you have this working, you can modify this solution to have cards drawn on a specific Actor's turn. Follow up on this thread or the How To Do This thread. We are happy to continue to troubleshooting this with you :)
Thanks,
MythAtelier Team