fuytko
Junior Member
Posts: 41
Threads: 6
Joined: Jun 2011
Reputation:
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 |
|
xtron
Senior Member
Posts: 402
Threads: 37
Joined: May 2011
Reputation:
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
Dubstep <3
|
|
08-19-2011, 02:10 PM |
|
Elven
Posting Freak
Posts: 862
Threads: 37
Joined: Aug 2011
Reputation:
26
|
|
08-19-2011, 02:58 PM |
|
JetlinerX
Senior Member
Posts: 599
Threads: 49
Joined: Jun 2011
Reputation:
19
|
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.
|
|
08-20-2011, 03:47 PM |
|
darkside
Junior Member
Posts: 20
Threads: 2
Joined: Aug 2011
Reputation:
0
|
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 ).
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 |
|
JetlinerX
Senior Member
Posts: 599
Threads: 49
Joined: Jun 2011
Reputation:
19
|
RE: Help me with scripts
Yes, I figured someone would say that. I mean, if the environment doesnt feel creepy, not the scares
|
|
08-20-2011, 03:57 PM |
|
Khan
Member
Posts: 61
Threads: 12
Joined: Aug 2011
Reputation:
0
|
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. 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 |
|
xtron
Senior Member
Posts: 402
Threads: 37
Joined: May 2011
Reputation:
2
|
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.
Dubstep <3
|
|
08-20-2011, 07:31 PM |
|
fuytko
Junior Member
Posts: 41
Threads: 6
Joined: Jun 2011
Reputation:
1
|
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 |
|
JetlinerX
Senior Member
Posts: 599
Threads: 49
Joined: Jun 2011
Reputation:
19
|
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.
(This post was last modified: 08-21-2011, 12:07 AM by JetlinerX.)
|
|
08-21-2011, 12:06 AM |
|
|