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

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


My problems - naseem142 - 10-14-2012

From now on i will post all of my errors / helps / needs in here so i won't keep posting a thread every problem i get.
And also i will post the solution , so other newbies like me Shy , will know how to fix it if they got the same problem
Thank you.

Problem 1 : ( Playing a song ) *SOLVED*
Spoiler below!


Problem:How can i add a song/tune to play through the level all the time and keep rewinding?

Solution:

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_Name", "Func_music", true, 1);
}

void Func_music(string &in asParent, string &in asChild, int alState)
{
PlayMusic("Music.ogg", true, 1, 1, 0, false);
}



Problem 2 : ( How to end the game when entering a level door ) *SOLVED*

Spoiler below!


Problem: How to end the game when entering a level door

Solution: Just read the posts on pages 2 - 4 Dodgy



Problem 3 : ( Giving a custom item function ) *SOLVED*

Spoiler below!


Basic: GiveItem(name, type, subType, image, amount);

Problem: How can i add a custom to be given to the player when using a knife item on another entity?

Here is my script , but i couldn't know how to make the player get an item when using the knife on the entity.


void UsedKnifeOnPig(string &in asItem, string &in asEntity)

{

GiveItem(Key_0, puzzle, subType, image, amount); //<---- The problem

PlaySoundAtEntity("", "attack_claw_hit.snt", "piggy", 0, false);

SetSwingDoorLocked("Locked_door0", false, true);

RemoveItem("pig_knife");

}

Solution: GiveItem("stone_hammer_chipper", "Puzzle", "stone_hammer_chipper", "stone_hammer_chipper.tga", 0);

stone_hammer_chipper: Change it to you'r items name
stone_hammer_chipper.tga: The image of the item inside the inventory



Problem 4 : ( Playing music not working ) *SOLVED*

Spoiler below!

Problem: The function: PlaySoundAtEntity( Scream1 , Scream1.ogg, Deadbody_1 , 2.0f, false);
is not working , i get an error " Scream1 is not declared and Deadbody_1 is not declared.

Solution: Function: PlaySoundAtEntity( "Scream1" , "Scream1.snt", "Deadbody_1" , 2.0f, false);
Scream1: The sound's name
Scream1.snt: The sound file's .snt file
Deadbody_1: The entity to play the sound from
2.0f: Time til the sound fades

To play you'r .ogg files you need a .snt file so create a new text document and write this in:


<SOUNDENTITY>
<SOUNDS>
<Main>
<Sound File="Scream1" />
</Main>
</SOUNDS>
<PROPERTIES Volume="5" MinDistance="1" MaxDistance="20" Random="1" Interval="0" FadeEnd="False" FadeStart="False" Stream="False" Loop="False" Use3D="True" Blockable="True" BlockVolumeMul="0.5" Priority="0" />
</SOUNDENTITY>

Change Scream1 to the sound file's name from the script

And then save the file as Scream1.snt


(And Of course change scream1 to sound's name)





Problem 5 : ( How to add mementos ) *NOT SOLVED*

Spoiler below!

Problem: How do i add mementos when touching a script area?

Solution: x





Problem 6 : ( How to make entities disappear dramaticly ) *SOLVED*

Spoiler below!

Problem: How to make entities disappear dramaticly?

Solution: SetPropActiveAndFade("Nameofentity", false, 3);





RE: My problems - Robby - 10-14-2012

PlayMusic("example.ogg", true, 1, 1, 0, false);

That's how you play a song.

Replace "example.ogg" with the music's name that you intend to use. Include the .ogg extension.


RE: My problems - naseem142 - 10-14-2012

(10-14-2012, 08:34 AM)Nemet Robert Wrote: PlayMusic("example.ogg", true, 1, 1, 0, false);

That's how you play a song.

Replace "example.ogg" with the music's name that you intend to use. Include the .ogg extension.
Thanks , also is the music file is placed in a separate folder called "Music"?


RE: My problems - Robby - 10-14-2012

Well, that's what I do with custom music. But you can play normal music from the game itself, without having to place it in a custom "Music" folder. Just be sure the name is correct.


RE: My problems - naseem142 - 10-14-2012

(10-14-2012, 08:43 AM)Nemet Robert Wrote: Well, that's what I do with custom music. But you can play normal music from the game itself, without having to place it in a custom "Music" folder. Just be sure the name is correct.
I did what you told me , and i did it like this:




void OnStart()
{
AddEntityCollideCallback("Player", "Play_Music_Script_Area", "PlayMusic1", true, 1);
}

void PlayMusic1(string &in asParent, string &in asChild, int alState)
{
PlayMusic("Ambience.ogg", true, 1, 1, 0, false);
}

But it didn't play when i touched the script area Huh


RE: My problems - Robby - 10-14-2012

Is the music name correct? Are the script names within the editor correct?

Also, have you tried restarting Amnesia? If I add custom music to my CS, I have to restart Amnesia, because it wouldn't play.

And the script's ok, as I see.


RE: My problems - The chaser - 10-14-2012

Also, be sure the name is exactly the same. And maybe is ambience.ogg instead of Ambience.ogg?


RE: My problems - Robby - 10-14-2012

I keep forgetting. Yes, the names are case-sensitive.


RE: My problems - The chaser - 10-14-2012

If your music is custom, it should be ok, but Ambience doesn't exist. Put the name
(ex: "ambience_cave")


RE: My problems - naseem142 - 10-14-2012

When i clicked the "Music" Folder there was a new file called "Ambience_main.ogg.sfk" does that mean it worked?