Frictional Games Forum (read-only)

Full Version: Touch an entity/item and something is triggered?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am a newbie at Amnesia story making and I have been only scripting for about 2 days now.
I'm trying to make, let's say, a sound happen (which I know how to do) for when I pick up maybe, a tinderbox. I'm not entirely sure on how to do this. See I've been using

AddEntityCollideCallback("Player","AREANAME","FUNCTION",true,1);


I have only been triggering sounds when a player goes into a new area but I havent wanted to experiment just in case I screw up something.

What would I do if I wanted to pick up a tinderbox and that triggered any kinda growl?
For the most part when you want something to happen when the player picks up an item, its basically the same concept you just need to use SetEntityPlayerInteractCallback("Name_of_Tinderbox", "Function", false);

Edit: the callback syntax is(string &in asEntity)
Code:
void OnStart()
{
SetEntityCallbackFunc("ENTER_TINDERBOX_NAME", "FUNCTION_NAME");
}

void FUNCTION_NAME(string &in asEntity, string &in type)
{
PlaySoundAtEntity("growl", "notice.snt", "Player", 0, false);
GiveSanityDamage(7.0f, true);
}
This should do the job.
Change the names how you'd like them.
Thanks. It works awesomely