Frictional Games Forum (read-only)
Another script that randomly just does not work [solved] - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Another script that randomly just does not work [solved] (/thread-10439.html)



Another script that randomly just does not work [solved] - Bennick - 09-22-2011

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??


RE: Another script that randomly just does not work - GreyFox - 09-22-2011

Could it just be because you have the } one to low?

I don't see anything else though

-Grey Fox



RE: Another script that randomly just does not work - Your Computer - 09-22-2011

IIRC, you cannot look at entities (yes, i know this is counter-intuitive), only certain areas.


RE: Another script that randomly just does not work - Obliviator27 - 09-22-2011

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.



RE: Another script that randomly just does not work - Bennick - 09-22-2011

(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.


RE: Another script that randomly just does not work - Obliviator27 - 09-22-2011

Yeah, it kind of was a long shot, but perhaps it'll work. Otherwise, I can't see anything wrong with the script.



RE: Another script that randomly just does not work - Bennick - 09-22-2011

(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


RE: Another script that randomly just does not work - Obliviator27 - 09-22-2011

(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