Frictional Games Forum (read-only)
[SCRIPT] Can inventory.hps trigger a script in a map? - 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] Can inventory.hps trigger a script in a map? (/thread-18673.html)



Can inventory.hps trigger a script in a map? - Damascus - 10-07-2012

I'd like to be able to trigger a script in a specific map by combining items, but as far as I know the CombineCallback only works in the inventory.hps. I'm talking about combining items in a certain map and have an effect on that map, such as setting an entity inactive or fading lights. And I want the player not to be able to combine these items in a different map. Is this all doable?


RE: Can inventory.hps trigger a script in a map? - Adny - 10-07-2012

You could possibly set a global variable in the inventory.hps and then use an if statement to check the variable to trigger the event.

On a side note, I do think you can use the combine callback in any hps file (not just the inventory.hps); this of course completely nullifies the above statement.

Hope that helped Confused


RE: Can inventory.hps trigger a script in a map? - Rapture - 10-08-2012

You could run a timer (I would have it enabled only when the player has the required items to help performance and keep it cleans.) that does a check for the combined item. If it's true, execute your code.

For the second part, you can have another bool item check and replace it with another replicate dummy one. Although it might seem stupid if it's noticed that it works on one map but not another. Might want to have another stationary ingredient/step in the correct map added.