Frictional Games Forum (read-only)
Help me with scripts - 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: Help me with scripts (/thread-9864.html)

Pages: 1 2


Help me with scripts - fuytko - 08-19-2011

Hello guys,

I have four problems:

1,How to script some scary sounds when I go through SoundArea_1 ?

2,I need to find a tutorial for making the puzzle, can you help me?
For example, I have 3 levers and when you pull them down, some door will open/unlock.

3,How can I make some fog?

4,Do you have some tricks/tips to making Custom Story?

- - -

I am developing my CS and I need some help with scripting.

- - -

Thank you.


RE: Help me with scripts - xtron - 08-19-2011

1:
Code:
PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);

2: search, there's already been like 5threads about this


RE: Help me with scripts - Elven - 08-19-2011

For start. I started studying that scripting less then week ago (and surprisingly amnesia scripting is damn easy) and I introduce you amnesia scripting holy bible: http://wiki.frictionalgames.com/hpl2/amnesia/script_functions

And here is amnesia community stories: http://www.frictionalgames.com/forum/search.php


RE: Help me with scripts - JetlinerX - 08-20-2011

Allow me to elaborate:
1. Use this code (assuming you know how to work AddEntityCollideCallback, add this under the void:
Code:
PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);
Example:
Code:
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
So thats gona play the "react_scare" at the "Player" when they walk across the area. (Area, scripted in the AddEntitlyCollideCallback)

2. Dunno yet.

3. Level Editor has fog areas

4. Tip: If it doesnt feel creepy to you, it wont feel much more creepy to the player.


RE: Help me with scripts - darkside - 08-20-2011

"If it doesnt feel creepy to you, it wont feel much more creepy to the player. " - It will be never creepy for you (for me, at least) because you know what's going to happen. Plus the testing is repetetive so it gets boring easily.

My suggestion is to never give up. There will be lot's of errors and testing but in the end, it'll all go well (if you're doin it rite Smile).

Edit: typo ... imma grammar nazi.


RE: Help me with scripts - JetlinerX - 08-20-2011

Yes, I figured someone would say that. I mean, if the environment doesnt feel creepy, not the scares Wink


RE: Help me with scripts - Khan - 08-20-2011

Remember, you know wat is all going to happen, so heres a pro tip. If you get creeped out by your own story, then you're doing good. Smile To help you out, and explaine some of the script functions. AddEntityCollideCallBack Is wat you are going to use for your script area, So lets say you want a door to slam shut, you would use this.

Void OnStart()
{
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("doorslam", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false);

PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(9.0f, true);
}

As you can see, you use collide back to work your scary parts, dont forget to name your void functions to, if both the same functions have the same names void func it will not work. I hope this helped you understand scripting, and maybe gave you a free door slam :p
Tricks and Tips to making one, dont give up, and be afraid to take your time, if it does not look good to you, it may not look good to others, I myself am a perfectionist, I cannont and will not release a custom story if I dont think its perfect, just go with the flow and do wat you think is good scary and looks good.


RE: Help me with scripts - xtron - 08-20-2011

tip: DO NOT spam monsters or keys. Don't be original, you need new shit, I've seen alot of maps that got the same stuff (ex: crowbars).

Don't be afraid of asking for help on the forum, even if it looks like you're making a new thread every minute. The FG community will provide ALOT of help, they're damn kind.


RE: Help me with scripts - fuytko - 08-20-2011

Thanks guys
(08-20-2011, 03:47 PM)JetlinerX Wrote: Allow me to elaborate:
1. Use this code (assuming you know how to work AddEntityCollideCallback, add this under the void:
Code:
PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);
Example:
Code:
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
So thats gona play the "react_scare" at the "Player" when they walk across the area. (Area, scripted in the AddEntitlyCollideCallback)

2. Dunno yet.

3. Level Editor has fog areas

4. Tip: If it doesnt feel creepy to you, it wont feel much more creepy to the player.

How i can script AddEntitlyCollideCallback ??? Please can you write me this code? I don't know how..


RE: Help me with scripts - JetlinerX - 08-21-2011

Code:
void OnStart()
{
AddEntityCollideCallback("Player", "SoundArea_1", "OnCollide", true, 1);
}
void OnCollide(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
}
That code will play "react_scare" when the "Player" walks across "SoundArea_1" so long as that area is listed as active in the editor.