Frictional Games Forum (read-only)

Full Version: Hammer break window script?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Is there a script that allows a hammer to be used on a window to break it?

Please reply Smile
Yeah, more or less:

I need to know what window are we talking about and what hammer do you want to make it break. Saying their names (like hammer_1) will help too Smile
(11-14-2013, 06:55 PM)The chaser Wrote: [ -> ]Yeah, more or less:

I need to know what window are we talking about and what hammer do you want to make it break. Saying their names (like hammer_1) will help too Smile
Example: Use hammer_1 on window = broken window, what i ment was that if you use a hammer on a normal window it turns into a broken window which you can go through

(11-14-2013, 06:55 PM)The chaser Wrote: [ -> ]Yeah, more or less:

I need to know what window are we talking about and what hammer do you want to make it break. Saying their names (like hammer_1) will help too Smile
Btw your custom story looks nice, when is it coming out?
void OnStart()
{
AddEntityCollideCallback("Hammer_1", "Window_1", "Break", false, 0);
}

void Break(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Window_1", false);
SetEntityActive("Window_2", true);
}

Place you broken window entity in the same location as your original window and set it to NOT active, de-check the active box. Window_2 will be the broken one and Window_1 will be the original one; you can name them whatever you may, I'm just giving an example.

You could then go in and create a particles system or two or three, some sounds, whatever you will.

Oh, if the window(s) is/are a static object and not an entity, you'll need to use the SetPropActiveAndFade script instead of the SetEntityActive. I just threw this together without testing but can say it should work if done correctly. It's not very advanced but you can tinker with this and that and perfect it to the way you'd like.

Hope this helps.
Well, GoreGrinder pretty much summed it up.

Abour my story: Progress is slow, as I try to improve the quality of the mod as much as possible. I don't have a release date, but it won't be soon Sad
(11-14-2013, 08:44 PM)GoreGrinder99 Wrote: [ -> ]void OnStart()
{
AddEntityCollideCallback("Hammer_1", "Window_1", "Break", false, 0);
}

void Break(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Window_1", false);
SetEntityActive("Window_2", true);
}

Place you broken window entity in the same location as your original window and set it to NOT active, de-check the active box. Window_2 will be the broken one and Window_1 will be the original one; you can name them whatever you may, I'm just giving an example.

You could then go in and create a particles system or two or three, some sounds, whatever you will.

Oh, if the window(s) is/are a static object and not an entity, you'll need to use the SetPropActiveAndFade script instead of the SetEntityActive. I just threw this together without testing but can say it should work if done correctly. It's not very advanced but you can tinker with this and that and perfect it to the way you'd like.

Hope this helps.
Thank you i'll try it out as soon as i can

(11-14-2013, 09:04 PM)The chaser Wrote: [ -> ]Well, GoreGrinder pretty much summed it up.

Abour my story: Progress is slow, as I try to improve the quality of the mod as much as possible. I don't have a release date, but it won't be soon Sad
Okay but it's gonna be awesome when you're done, btw do you have a good script for a jump scare?
No : >
There is no such thing as a good script for a jumpscare.
A "good" jumpscare, if such thing exists, could be anything, it's about WHEN you use it in my humble opinion.
(11-15-2013, 01:13 PM)ZurkQyulox Wrote: [ -> ]Okay but it's gonna be awesome when you're done, btw do you have a good script for a jump scare?

The only "good" jumpscares, in my opinion:
- Something in another room falls off something high, and is noticeable on enter/re-enter. It's not exactly a jumpscare, but the sound effect may trigger something.
- A painting or something falls off the wall. This gets me everytime.
- Music starts playing in a room where appropriate (choir, piano, etc)
- A trapdoor opens below you, causing you to fall to somewhere underneath.

All can be scripted fairly simply Smile

When making a serious CS, do not use these:
- A grunt charges at you and disappears just before it hits you
- Everything suddenly flings at you
- No overused scare stuff, like a really loud GONG effect when you look at something.
(11-15-2013, 02:05 PM)Romulator Wrote: [ -> ]
(11-15-2013, 01:13 PM)ZurkQyulox Wrote: [ -> ]Okay but it's gonna be awesome when you're done, btw do you have a good script for a jump scare?

The only "good" jumpscares, in my opinion:
- Something in another room falls off something high, and is noticeable on enter/re-enter. It's not exactly a jumpscare, but the sound effect may trigger something.
- A painting or something falls off the wall. This gets me everytime.
- Music starts playing in a room where appropriate (choir, piano, etc)
- A trapdoor opens below you, causing you to fall to somewhere underneath.

All can be scripted fairly simply Smile

When making a serious CS, do not use these:
- A grunt charges at you and disappears just before it hits you
- Everything suddenly flings at you
- No overused scare stuff, like a really loud GONG effect when you look at something.
Okay but what if i want a grunt to spawn behind a doorm then start breaking it when a player interact with a area, how do you do that?

(11-15-2013, 02:05 PM)Romulator Wrote: [ -> ]
(11-15-2013, 01:13 PM)ZurkQyulox Wrote: [ -> ]Okay but it's gonna be awesome when you're done, btw do you have a good script for a jump scare?

The only "good" jumpscares, in my opinion:
- Something in another room falls off something high, and is noticeable on enter/re-enter. It's not exactly a jumpscare, but the sound effect may trigger something.
- A painting or something falls off the wall. This gets me everytime.
- Music starts playing in a room where appropriate (choir, piano, etc)
- A trapdoor opens below you, causing you to fall to somewhere underneath.

All can be scripted fairly simply Smile

When making a serious CS, do not use these:
- A grunt charges at you and disappears just before it hits you
- Everything suddenly flings at you
- No overused scare stuff, like a really loud GONG effect when you look at something.
And btw if you have time, tell me how im going to do if i want those scares you gave me.
Well, firstly, you can't learn how to do things if I just give you a/the script. You only learn when you try it.

And you cant just simply script these, you need to design your map to be suited for the scripting to work. Making a pitfall trap (a hole in the ground outside) would be more difficult to make than in indoor one, but would probably be kind of silly unless really incorporated well. After seeing Ash (Pokemon) fall into that many, it becomes clichè.

Think about how something happens if something occurs.

Example
Code:
> Player needs to pick up the key
> Player walks over towards the key
   > Player hears noise of enemy
     > Player becomes scared
      - Trigger a insanity event
      - Use visual effects
      - Slow movement for a brief moment
      - Return to normal with slight sanity loss
   > Noise of enemy has ended
     > Player continues on
      - Enemy gets louder
      - Player can realise danger
        - Lower Sanity slightly
        - Cue effects and slow movement as before
     > Enemy begins to bang on a door in the other room
        - Player feels potential to hurry
        - Start breathing sound effects
   > Player picks up key
   [continue code]

That psuedocode is an example of what you should do. Think about what you mainly want, then add to the immersion.
Pages: 1 2