Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hello again,

Here's a quick script that turns the Switch 33 if the inventory is full. It can manage an inventory mixing both stackable and non stackable items. 

var itemNb = 0;
for (var i = 0; i < $gameParty.items().length ; i++) {
if ($gameParty.items()[i]["defaultCategory"] == "item") {
if ($gameParty.items()[i]["note"] == "<Stackable>") {
itemNb++;
}
else {
itemNb += $gameParty.numItems($dataItems[$gameParty.items()[i]["id"]]);
}
}
// Variable 45 => Max Inventory Slots
if (itemNb >= $gameVariables.value(45)) {
$gameSwitches.setValue(33, true);
} 
else {
$gameSwitches.setValue(33, false);
}

Don't know if this helps but I'm heavily relying on it.

Thanks! I will see if I can replicate this issue and fix this. But where are you putting this script?