Frictional Games Forum (read-only)

Full Version: Gandalf's scripting questions thread
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
So, my interact script still isn't working properly. I've read around that the type of "interaction" can depend on the item, but I'm not sure how I'd go about changing it if need be.

SetEntityPlayerInteractCallback("rock_small_1", "CorridorScream", true);

...

void CorridorScream(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "04_scream.snt", "ScriptArea_8", 0.0f, false);
StartScreenShake(0.025f, 2, 0, 1.5f);
GiveSanityDamage(5.0f, true);
}

I've tried setting the boolean to false, but that didn't help (not that I really expected it to). If I change this function to an entitycollide with player, it works. But I don't want collision with the rock to trigger this event, but when you move it around. I'm not sure if moving it around counts as "interaction" though.
In the wiki you got following:
Code:
/**
* Callback syntax: MyFunc(string &in entity)
*/
void  SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);
/**

The commented line shows you what your formal function parameters have to look like. In this case, when using SetEntityPlayerInteractCallback, you will need a function

Code:
void CorridorScream(string &in entity) {
}

Always take a look at the scripting functions. Wink
Ahh..thank you. Smile I can assure you, once I start realizing my mistakes I'll begin picking this all up a lot quicker! At the very start though it's just hard for me to understand what means what and what I need to be looking for when troubleshooting.
Pages: 1 2