Frictional Games Forum (read-only)
More Newbie problems.. - 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: More Newbie problems.. (/thread-16300.html)



More Newbie problems.. - The Shanus - 06-19-2012

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


RE: More Newbie problems.. - Datguy5 - 06-19-2012

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


RE: More Newbie problems.. - Obliviator27 - 06-19-2012

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


RE: More Newbie problems.. - The Shanus - 06-19-2012

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


RE: More Newbie problems.. - Cruzore - 06-19-2012

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


RE: More Newbie problems.. - The Shanus - 06-19-2012

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.


RE: More Newbie problems.. - Stepper321 - 06-19-2012

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


RE: More Newbie problems.. - The Shanus - 06-19-2012

(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 :]