Skip to main content

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

Good day, as indicated, I'm moving my suggestion/request for the plug in here: 

Good day Myth. In your sample game script you have in one of your cards: 

Eval var skillIDs = Myth.CGC.getIDsOfType("Rare"); 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.");

If a Skill have multiple types. All those types will between the brackets? Example:

Eval var skillIDs = Myth.CGC.getIDsOfType("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 way, we the card will generate a random "Rare" and "Fire" Type. This is a feature which will be nice to add, allowing us to have more control for random cards like these.

By the way, I don't know if tha is coded correctly, I took the code from the Demo you have with the plugg in and put it has example XD

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