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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hammer break window script?
GoreGrinder99 Offline
Member

Posts: 166
Threads: 47
Joined: Feb 2013
Reputation: 1
#4
RE: Hammer break window script?

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.

-Grind to the Gore-
(This post was last modified: 11-14-2013, 08:57 PM by GoreGrinder99.)
11-14-2013, 08:44 PM
Find


Messages In This Thread
Hammer break window script? - by ZurkQyulox - 11-14-2013, 05:36 PM
RE: Hammer break window script? - by The chaser - 11-14-2013, 06:55 PM
RE: Hammer break window script? - by ZurkQyulox - 11-14-2013, 07:49 PM
RE: Hammer break window script? - by GoreGrinder99 - 11-14-2013, 08:44 PM
RE: Hammer break window script? - by ZurkQyulox - 11-15-2013, 01:13 PM
RE: Hammer break window script? - by daortir - 11-15-2013, 01:46 PM
RE: Hammer break window script? - by Romulator - 11-15-2013, 02:05 PM
RE: Hammer break window script? - by ZurkQyulox - 11-15-2013, 03:39 PM
RE: Hammer break window script? - by The chaser - 11-14-2013, 09:04 PM
RE: Hammer break window script? - by Romulator - 11-15-2013, 10:57 PM
RE: Hammer break window script? - by ZurkQyulox - 11-16-2013, 08:56 AM
RE: Hammer break window script? - by Romulator - 11-16-2013, 11:13 AM
RE: Hammer break window script? - by ZurkQyulox - 11-16-2013, 01:50 PM



Users browsing this thread: 7 Guest(s)