Frictional Games Forum (read-only)

Full Version: Can inventory.hps trigger a script in a map?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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
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.