Frictional Games Forum

Full Version: How to make a memo appear on item pickup?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How do I make a memo appear (or memento or whatever it is called) after I pick up and read through a letter?

How do I make a monster appear after picking up an item such as a key?

Also: How can you make a sound like a monster growling without the monster appearing when you pick up an item?

Thank you!
Study this: http://wiki.frictionalgames.com/hpl2/amn..._functions

The function you're looking for would be:

Code:
SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);

string& asName would be the name of the object interacted.

string& asCallback would be the name of the function you want to call (Make a monster spawn, play a sound, etc.)

bool abRemoveOnInteraction is either true or false. It's asking if you want to remove the effect of the interaction on the object.

edit: http://www.youtube.com/watch?v=WfgFEG4TSCE
(10-18-2011, 05:42 AM)Russ Money Wrote: [ -> ]Study this: http://wiki.frictionalgames.com/hpl2/amn..._functions

The function you're looking for would be:

Code:
SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);

string& asName would be the name of the object interacted.

string& asCallback would be the name of the function you want to call (Make a monster spawn, play a sound, etc.)

bool abRemoveOnInteraction is either true or false. It's asking if you want to remove the effect of the interaction on the object.

edit: http://www.youtube.com/watch?v=WfgFEG4TSCE
Are you sure it isn't AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);
No. AddEntityCollide is when 2 things collide. Player or area. Picking up item is picking it up, not colliding with it Smile.

Code:
void SetEntityCallbackFunc(string& asName, string& asCallback);
   Calls a function when the player interacts with a certain entity.
  Callback syntax: void MyFunc(string &in asEntity, string &in type)
  Type depends on entity type and includes: “OnPickup”, “Break”, “OnIgnite”, etc
(10-20-2011, 07:27 PM)Elven Wrote: [ -> ]No. AddEntityCollide is when 2 things collide. Player or area. Picking up item is picking it up, not colliding with it Smile.

Code:
void SetEntityCallbackFunc(string& asName, string& asCallback);
   Calls a function when the player interacts with a certain entity.
  Callback syntax: void MyFunc(string &in asEntity, string &in type)
  Type depends on entity type and includes: “OnPickup”, “Break”, “OnIgnite”, etc
*facepalm* I feel stupid Tongue