Frictional Games Forum (read-only)
[SCRIPT] Inventory check - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Inventory check (/thread-17482.html)



Inventory check - Lizard - 08-04-2012

Hi guys

im at a point where i want the game to check if the player has a certain item in his inventory, when he enters a map, and if he has, i want an area to be activated.

But that this is only my first serious cs, im not that much into to the check functions yet.

I would really appreciate it, if you could help me out on this one.


RE: Inventory check - Artyom - 08-04-2012

check the engine scripts at frictionals wiki, otherwise i think it's something like HasItem(string& asName);


also I'm currently working on a custom story, so if you speak English we could help each other out, Add me on skype if interested. skype name: keegando


RE: Inventory check - Obliviator27 - 08-04-2012

void OnStart() // When the map runs for the first time.
{
if(HasItem("ItemName")) // Checks to see if the item is in the player's inventory.
{
SetEntityActive("AreaName", true); // Activates the area.
}
}


RE: Inventory check - Adny - 08-04-2012

Do what obliviator said, except put in OnEnter.


RE: Inventory check - Lizard - 08-04-2012

thanks guys