Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help me with scripts
fuytko Offline
Junior Member

Posts: 41
Threads: 6
Joined: Jun 2011
Reputation: 1
#1
Help me with scripts

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.
(This post was last modified: 11-20-2014, 10:02 PM by fuytko.)
08-19-2011, 02:07 PM
Find
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#2
RE: Help me with scripts

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

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

[Image: 44917299.jpg]Dubstep <3
08-19-2011, 02:10 PM
Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#3
RE: Help me with scripts

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/amn..._functions

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

The Interrogation
Chapter 1

My tutorials
(This post was last modified: 08-19-2011, 02:58 PM by Elven.)
08-19-2011, 02:58 PM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#4
RE: Help me with scripts

Allow me to elaborate:
1. Use this code (assuming you know how to work AddEntityCollideCallback, add this under the void:
PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);
Example:
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.

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

08-20-2011, 03:47 PM
Website Find
darkside Offline
Junior Member

Posts: 20
Threads: 2
Joined: Aug 2011
Reputation: 0
#5
RE: Help me with scripts

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

Snowy background, anyone?
Now, where was that grunt with the santa hat ....
(This post was last modified: 08-20-2011, 03:56 PM by darkside.)
08-20-2011, 03:55 PM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#6
RE: Help me with scripts

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

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

08-20-2011, 03:57 PM
Website Find
Khan Offline
Member

Posts: 61
Threads: 12
Joined: Aug 2011
Reputation: 0
#7
RE: Help me with scripts

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.
(This post was last modified: 08-20-2011, 06:46 PM by Khan.)
08-20-2011, 06:42 PM
Find
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#8
RE: Help me with scripts

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.

[Image: 44917299.jpg]Dubstep <3
08-20-2011, 07:31 PM
Find
fuytko Offline
Junior Member

Posts: 41
Threads: 6
Joined: Jun 2011
Reputation: 1
#9
RE: Help me with scripts

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:
PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);
Example:
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..
(This post was last modified: 08-20-2011, 09:43 PM by fuytko.)
08-20-2011, 09:34 PM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#10
RE: Help me with scripts

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.

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

(This post was last modified: 08-21-2011, 12:07 AM by JetlinerX.)
08-21-2011, 12:06 AM
Website Find




Users browsing this thread: 1 Guest(s)