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
Gandalf's scripting questions thread
gandalf91 Offline
Senior Member

Posts: 439
Threads: 13
Joined: Feb 2011
Reputation: 0
#11
RE: Gandalf's scripting questions thread

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.
03-06-2011, 12:26 AM
Find
Pandemoneus Offline
Senior Member

Posts: 328
Threads: 2
Joined: Sep 2010
Reputation: 0
#12
RE: Gandalf's scripting questions thread

In the wiki you got following:
/**
* 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

void CorridorScream(string &in entity) {
}

Always take a look at the scripting functions. Wink

(This post was last modified: 03-06-2011, 01:10 AM by Pandemoneus.)
03-06-2011, 01:10 AM
Find
gandalf91 Offline
Senior Member

Posts: 439
Threads: 13
Joined: Feb 2011
Reputation: 0
#13
RE: Gandalf's scripting questions thread

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.
03-06-2011, 01:29 AM
Find




Users browsing this thread: 2 Guest(s)