Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: ManicMatt on Fri 02/12/2005 17:45:58

Title: Spot the scripting error!
Post by: ManicMatt on Fri 02/12/2005 17:45:58
If EGO has both items he will not find them again in the hotspot after shutting it, and opening it again.

  // script for Hotspot 1 (Hotspot 1): Interact hotspot
if ((player.InventoryQuantity[12] == 1) && (player.InventoryQuantity[13] == 1))

object[0].Visible = true;
object[1].Visible = false;
object[4].Visible = false;
return;
}

The game just appears to ignore the check and makes the items invisible.

Please advise! Is there something wrong with this scripting? If there are conditions afterwards on the interaction menu does it just ignore them?
Title: Re: Spot the scripting error!
Post by: SSH on Fri 02/12/2005 17:47:58
You missed a "{" after the "if"...
Title: Re: Spot the scripting error!
Post by: ManicMatt on Fri 02/12/2005 18:02:47
This appears to work, thanks!


// script for Hotspot 1 (Hotspot 1): Interact hotspot
if ((player.InventoryQuantity[12] == 1) && (player.InventoryQuantity[13] == 1))
{
object[0].Visible = true;
object[1].Visible = false;
object[4].Visible = false;
return;
}
}