Hello
I am planning on a game with a lot of item interactions, i want items to have interactions with most other items, even if all they produce is a quip from the player
normally i would do something like this:
Code: ags
now if i were to do that, and if i had 6 or 7 items that can all interact with each other, then i would already end up with with a ridiculously big GlobalScript
So are there more efficient ways to do this, or just ways to keep my code shorter?
I am planning on a game with a lot of item interactions, i want items to have interactions with most other items, even if all they produce is a quip from the player
normally i would do something like this:
function iItemA_UseInv()
{
if (cEgo.ActiveInventory==iItemB) {
cEgo.LoseInventory(iItemA);
cEgo.LoseInventory(iItemB);
cEgo.AddInventory(iItemC);
}
else if (player.ActiveInventory == iItemD)
{
cEgo.Say("bla bla bla ");
}
}
now if i were to do that, and if i had 6 or 7 items that can all interact with each other, then i would already end up with with a ridiculously big GlobalScript
So are there more efficient ways to do this, or just ways to keep my code shorter?