Frictional Games Forum (read-only)

Full Version: Another script that randomly just does not work [solved]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to make a model disappear and then have a sound come from the intstrument the model is "playing". I know that the model can disappear because I used it earlier and was able to make it disappear no problem. They are both LookAt callbacks so I copy pasted the callback syntax, I've checked and rechecked the names hundreds of times, and nothing is working. Here's the script:

OnEnter()

{
SetEntityPlayerLookAtCallback("brother2", "brother2", true);

}



void brother2(string &in asEntity, int alState)
{
SetEntityActive("brother2", false);
PlaySoundAtEntity("", "03_waking_up.snt", "piano_2", 0, false);
}

what the hell could possibly be wrong??
Could it just be because you have the } one to low?

I don't see anything else though

-Grey Fox
IIRC, you cannot look at entities (yes, i know this is counter-intuitive), only certain areas.
My only thought would be to use the LookAtcallback feature directly from the editor itself, instead of having it scripted in, though it makes no difference as to what you use, in theory. Try naming the function name seperate from the entity name and see if that makes a difference.
(09-22-2011, 08:47 PM)Your Computer Wrote: [ -> ]IIRC, you cannot look at entities (yes, i know this is counter-intuitive), only certain areas.
My point is that I had another function: "brother". That one is the exact same way. I look at the same model in a different location, and it disappears no prob. This one won't work for some reason.

And Obliviator, I named the function the same as an entity before and it worked fine, but I'll give it a shot.
Yeah, it kind of was a long shot, but perhaps it'll work. Otherwise, I can't see anything wrong with the script.
(09-22-2011, 09:28 PM)Obliviator27 Wrote: [ -> ]Yeah, it kind of was a long shot, but perhaps it'll work. Otherwise, I can't see anything wrong with the script.
Weirdly enough, that seems to have worked, go figure. I think I'm becoming a part of a real life Amnesia story where Amnesia's story developing tools come to life and make me go insane. @_@.

ah well thank you!! Big Grin
(09-22-2011, 09:42 PM)Bennick Wrote: [ -> ]Weirdly enough, that seems to have worked, go figure. I think I'm becoming a part of a real life Amnesia story where Amnesia's story developing tools come to life and make me go insane. @_@.

ah well thank you!! Big Grin
Haha, well that's what this forum is for! To keep the sanity of the modders! Anyhow, you're welcome. Smile