Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Can inventory.hps trigger a script in a map?
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#1
Can inventory.hps trigger a script in a map?

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?

10-07-2012, 11:04 PM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Can inventory.hps trigger a script in a map?

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

I rate it 3 memes.
(This post was last modified: 10-07-2012, 11:08 PM by Adny.)
10-07-2012, 11:07 PM
Find
Rapture Offline
Posting Freak

Posts: 1,078
Threads: 79
Joined: May 2011
Reputation: 30
#3
RE: Can inventory.hps trigger a script in a map?

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.
10-08-2012, 02:02 AM
Find




Users browsing this thread: 1 Guest(s)