On my new game I would like to know the script so that I can check multiple items with if (player.ActiveInventory ==). This is the script i've used but I need some help.
function iSouthernwood_UseInv()
{
if (player.ActiveInventory == iSouthernwood){
(player.ActiveInventory == iSouthernwood)
(player.ActiveInventory == iSouthernwood)
(player.ActiveInventory == iSouthernwood)
(player.ActiveInventory == iSouthernwood)
(player.ActiveInventory == iSouthernwood)
(player.ActiveInventory == iSouthernwood)
(player.ActiveInventory == iSouthernwood)
(player.ActiveInventory == iSouthernwood)
(player.ActiveInventory == iSouthernwood)
(player.ActiveInventory == iVial)
player.LoseInventory(iSouthernwood);
player.LoseInventory(iVial);
player.AddInventory(iAConcoct);
Display ("Mixed the Southernwood in the Vial to create an Appleringie Concoction");
}
else Display ("You need 10 Southernwood herbs to produce an Appleringie Concoction!")
}
Thanks in advance
Try
function iSouthernwood_UseInv()
{
if ((player.ActiveInventory==iVial)&&(player.InventoryQuantity[iSouthernwood.ID]==10))
{
//do stuff
player.InventoryQuantity[iSouthernwood.ID]-=10;
player.LoseInventory(iVial);
player.AddInventory(iAConcoct);
UpdateInventory();
Display ("Mixed the Southernwood in the Vial to create an Appleringie Concoction");
}
else Display ("You need 10 Southernwood herbs to produce an Appleringie Concoction!")
}
You want you use iVial on iSouthernwood, right?
~Trent
Thanks that will help alot!
If for some reason you can carry more than 10 Southernwood, you'll need to change this line:
(player.InventoryQuantity[iSouthernwood.ID]==10)
to this
(player.InventoryQuantity[iSouthernwood.ID]>=10)
If this is just a one-shot puzzle though, it's fine.