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
Another script that randomly just does not work [solved]
Bennick Offline
Member

Posts: 77
Threads: 27
Joined: Apr 2011
Reputation: 0
#1
Another script that randomly just does not work [solved]

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

Fratricide (title not finalized): 2/7 maps. :D
(This post was last modified: 09-23-2011, 02:39 PM by Bennick.)
09-22-2011, 08:18 PM
Find
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#2
RE: Another script that randomly just does not work

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

I don't see anything else though

-Grey Fox

Current Project
Forgotten
09-22-2011, 08:23 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#3
RE: Another script that randomly just does not work

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

Tutorials: From Noob to Pro
09-22-2011, 08:47 PM
Website Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#4
RE: Another script that randomly just does not work

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, 09:06 PM
Find
Bennick Offline
Member

Posts: 77
Threads: 27
Joined: Apr 2011
Reputation: 0
#5
RE: Another script that randomly just does not work

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

Fratricide (title not finalized): 2/7 maps. :D
09-22-2011, 09:18 PM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#6
RE: Another script that randomly just does not work

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
Find
Bennick Offline
Member

Posts: 77
Threads: 27
Joined: Apr 2011
Reputation: 0
#7
RE: Another script that randomly just does not work

(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

Fratricide (title not finalized): 2/7 maps. :D
09-22-2011, 09:42 PM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#8
RE: Another script that randomly just does not work

(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


09-22-2011, 10:00 PM
Find




Users browsing this thread: 2 Guest(s)