Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hello again Arcanamoon, this was actually a lot of fun to figure out and we'll be including it with the next update. Let's get into it.

So, first, you need to edit the MYTH_CGC_Card Types plugin and include two new functions at the bottom.

1. Go to the js/plugins folder in the project directory. Open MYTH_CGC_CardTypes.js in a text editor (like Notepad) or IDE (like Visual Studio) and scroll all the way to the bottom.

2. Copy and paste the following code block below the last curly brace so that it doesn't mess with the existing functions.

//Returns array of Skill IDs that have ANY of the listed types
Myth.CGC.getIDsOfTypesOR = function (...types)
{
    var matchType = [];
    for (let type of types) matchType = matchType.concat(Myth.CGC.getIDsOfType(type));
    return matchType;
}
//Returns array of Skill IDs that have ALL of the listed types
Myth.CGC.getIDsOfTypesAND = function (...types) 
{
     var matchType = [];
     for (let type of types)
     {
         if (matchType.length == 0)
         {
             matchType = Myth.CGC.getIDsOfType(type);
             continue;
         }
         nextType = Myth.CGC.getIDsOfType(type);
         matchType = nextType.filter(elem => matchType.includes(elem));
     }
      return matchType;
}

3. Save this copy of MYTH_CGC_CardTypes and close the editor.

Now, open up your RPG Maker project and go to the Skill Notetags of the Card in your project where you are trying to generate Cards of both Rare and Fire type. The Eval script call will now look like this:

Eval var skillIDs = Myth.CGC.getIDsOfTypesAND("Rare", "Fire"); var index = Math.floor(Math.random() * skillIDs.length); user.addCardToZone(skillIDs[index],"hand"); BattleManager._logWindow.addText("Added \c[6]" + $dataSkills[skillIDs[index]].name + "\c[0] to Hand.");

This will look through the Database for Skills that have both "Rare" and "Fire" type and then add them to the pool of cards that could be generated. This function is not restricted to two types btw, you can specify any number of types and get the result you want.

Let us know if you are able to get it working on your end. Happy to continue troubleshooting till we get things working :)

Cheers,

MythAtelier Team