Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - ZiggyZaggston

#1
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

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?
SMF spam blocked by CleanTalk