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
[SCRIPT] Breakable Door
Erik The Born Offline
Member

Posts: 59
Threads: 7
Joined: Mar 2013
Reputation: 0
#17
RE: [SCRIPT] Breakable Door

(03-24-2013, 09:14 AM)Knusper. Wrote: You need to have new names for the variables.
like: AddLocalVarInt("BreakDoorInt2", 1);
Thats why you seem to have to hit it infinity times.
I dont see more mistakes...

edit:

if(GetLocalVarInt("BreakDoorInt") == 2)
{
PlaySoundAtEntity("", "break_wood_metal.snt", "Pieces_3", 0, false);
SetPropHealth("BreakableDoor_2", -1);
AddPropImpulse("BreakableDoor_2", 0, 0, -0.5, "world");
}
PlaySoundAtEntity("", "break_wood.snt", "BreakableDoor_2", 0, false);
AddLocalVarInt("BreakDoorInt", 1);
CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect_1", false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect2", false);

}

Why do you have both effects here?
You made that three times in your script.
I think its wrong, you just need the effect on the door where you hit Tongue

Ok I seem to be able to hit all the doors but... When I hit one of the doors I see particle effects and all that but when it breaks the door isnt broken! Instead Another door is broken. If I try to break that door it will do the same but it wont break any door at all. Whats wrong?

(03-24-2013, 11:55 AM)The chaser Wrote: *ehem*

Guys, you are complicating yourself. It's not hard to make a breakable door. With the sledge:

Make a area which fits the door, called, for example: AreaThatIsInTheDoor

void OnStart()
{
AddEntityCollideCallback("Sledge", "AreaThatIsInTheDoor", "Break_dammit", true, 1);
}

void Break_dammit (string &in asParent, string &in asChild, int alState)
{
SetPropHealth("DoorToBreak", 0); ///This will destroy it
SetPropHealth("DoorToBreak", 10); ///This will make it very destroyed but still in it's place
SetPropHealth("DoorToBreak", 40); ///This will crack it

CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaThatIsInTheDoor", false);

////Choose between these to have your breakable door
}

I choose between the Health values? Why dont you make it so first hit it has 40. Second 10, and finally 0?
(This post was last modified: 03-24-2013, 12:08 PM by Erik The Born.)
03-24-2013, 12:05 PM
Find


Messages In This Thread
[SCRIPT] Breakable Door - by Vic7im - 09-26-2012, 02:33 PM
RE: I'll just leave this here. - by Robby - 09-26-2012, 02:34 PM
RE: [SCRIPT] Breakable Door - by Fatalist - 12-22-2012, 08:59 AM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-21-2013, 06:21 PM
RE: [SCRIPT] Breakable Door - by PutraenusAlivius - 03-22-2013, 03:13 AM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-23-2013, 09:01 AM
RE: [SCRIPT] Breakable Door - by Knusper. - 03-23-2013, 10:33 AM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-23-2013, 10:41 AM
RE: [SCRIPT] Breakable Door - by PutraenusAlivius - 03-23-2013, 02:54 PM
RE: [SCRIPT] Breakable Door - by Knusper. - 03-23-2013, 12:01 PM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-23-2013, 01:48 PM
RE: [SCRIPT] Breakable Door - by Knusper. - 03-23-2013, 06:09 PM
RE: [SCRIPT] Breakable Door - by PutraenusAlivius - 03-24-2013, 08:04 AM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-24-2013, 08:21 AM
RE: [SCRIPT] Breakable Door - by Knusper. - 03-24-2013, 09:14 AM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-24-2013, 12:05 PM
RE: [SCRIPT] Breakable Door - by PutraenusAlivius - 03-24-2013, 12:19 PM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-24-2013, 12:27 PM
RE: [SCRIPT] Breakable Door - by PutraenusAlivius - 03-24-2013, 02:14 PM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-24-2013, 02:26 PM
RE: [SCRIPT] Breakable Door - by PutraenusAlivius - 03-24-2013, 02:27 PM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-24-2013, 02:58 PM
RE: [SCRIPT] Breakable Door - by PutraenusAlivius - 03-24-2013, 02:59 PM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-24-2013, 03:18 PM
RE: [SCRIPT] Breakable Door - by PutraenusAlivius - 03-24-2013, 03:19 PM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-24-2013, 03:30 PM
RE: [SCRIPT] Breakable Door - by Adrianis - 03-24-2013, 10:21 PM
RE: [SCRIPT] Breakable Door - by The chaser - 03-24-2013, 11:55 AM
RE: [SCRIPT] Breakable Door - by The chaser - 03-24-2013, 03:09 PM



Users browsing this thread: 7 Guest(s)