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
More Newbie problems..
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#1
Question  More Newbie problems..

Hey guys, two questions this time. Firstly, my hallucinations are no longer working. I tick the hallucination box, and set the disappearing distance to 0.5, yet they dont disappear, and inevitable kill the player. My first hallucination worked fine, but my second did not, and from then on, I might as well have left the box unticked. I'm sure there's something simple I've overlooked once again, but I can't spot it.. Any ideas?

Secondly, I'm curious to know how to get a sound to work as a monster spawns.
At the moment I'm getting "FATAL ERROR - No matching signatures for the PlaySoundAtEntity bladiblah part of the script".

Here's my script -
PHP Code: (Select All)
void OnStart()
{
}

////////////////////////////
// Run when entering map

void OnEnter()
{
AddUseItemCallback("""room101key""room101""UsedKeyOnDoor"true);
AddUseItemCallback("""room100key""room100""UsedKeyOnDoor"true);
SetEntityCallbackFunc("room100key""OnPickup");
AddUseItemCallback("""hatch101key""hatch101""UsedKeyOnDoor"true);
}

void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked(asEntityfalsetrue);
PlaySoundAtEntity(""asEntity"room101"0false);
PlaySoundAtEntity(""asEntity"room100"0false);
PlaySoundAtEntity(""asEntity"hatch101"0false);
RemoveItem(asItem);
}

void OnPickup(string &in asEntitystring &in type)
{
  
SetEntityActive("poofer1"true);
  
ShowEnemyPlayerPosition("poofer");
  
PlaySoundAtEntity("monsterappear1""04_break.snt""poofer1"""0false);


I would like the sound to come on as the monster spawns, once the key is picked up. So as to scare/alert the player.

Thanks alot.

[Image: theshanusyoutube.jpg]
(This post was last modified: 06-19-2012, 05:34 PM by The Shanus.)
06-19-2012, 03:01 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#2
RE: More Newbie problems..

I think 0.5 is too close for a hallucination...Try changing it to 1.5 atleast.

06-19-2012, 03:15 PM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#3
RE: More Newbie problems..

Your issue is that your arguments for PlaySoundAtEntity are incorrect.
You want
PlaySoundAtEntity("", "Soundfile.snt", "EntitytoPlayAt", 0, false);

06-19-2012, 03:22 PM
Find
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#4
RE: More Newbie problems..

(06-19-2012, 03:22 PM)Obliviator27 Wrote: Your issue is that your arguments for PlaySoundAtEntity are incorrect.
You want
PlaySoundAtEntity("", "Soundfile.snt", "EntitytoPlayAt", 0, false);
Well that worked, but it also made the sound play as soon as the player spawned. Any ideas how to stop that?
And +1 rep for both of you because after setting it to 1.5 distance it worked fine - thanks!

Forget that! I added a sound file through the editor aswell, so deleting it removed that problem.

[Image: theshanusyoutube.jpg]
(This post was last modified: 06-19-2012, 03:27 PM by The Shanus.)
06-19-2012, 03:25 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#5
RE: More Newbie problems..

Hi again Smile
Found your problem:
look at the PlaySoundAtEntity functions inside UsedKeyOnDoor. You misplaced asEntity, and missed the soundfile. Try this:
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundatEntity("", yoursoundhere.snt, asEntity, 0, false);
}
Also, ShowEnemyPlayerPosition has a different name(missing 1) than the others, Idk if you intended that.

Edit: Nevermind, got ninja'd. Maybe replace the callbacks to OnStart()?
(This post was last modified: 06-19-2012, 03:28 PM by Cruzore.)
06-19-2012, 03:27 PM
Find
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#6
RE: More Newbie problems..

Excuse the double post but I felt it needed a "bump" so as all concerned would know there is a new post here. I've made the mistake of setting the "Z" scale value of a large wall to "0", so now it is inselectable. Does anyone know how I can select/remove it? Thanks.

(06-19-2012, 03:29 PM)theshanus Wrote: Excuse the double post but I felt it needed a "bump" so as all concerned would know there is a new post here. I've made the mistake of setting the "Z" scale value of a large wall to "0", so now it is inselectable. Does anyone know how I can select/remove it? Thanks.
Woops, that was an edit of the previous post ^ Re-bumped.

[Image: theshanusyoutube.jpg]
(This post was last modified: 06-19-2012, 04:07 PM by The Shanus.)
06-19-2012, 03:29 PM
Find
Stepper321 Offline
Senior Member

Posts: 263
Threads: 26
Joined: Nov 2011
Reputation: 8
#7
RE: More Newbie problems..

Do you still have CTRL + Z enabled, or did the cache refresh?

Signature to awesome to be displayed.
06-19-2012, 06:18 PM
Find
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#8
RE: More Newbie problems..

(06-19-2012, 06:18 PM)Stepper321 Wrote: Do you still have CTRL + Z enabled, or did the cache refresh?
I didn't, but don't worry, this was answered in a new thread. Thanks for the reply, however :]

[Image: theshanusyoutube.jpg]
06-19-2012, 07:24 PM
Find




Users browsing this thread: 1 Guest(s)