PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: [SCRIPT] Breakable Door
(03-24-2013, 12:05 PM)Erik The Born Wrote: (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
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?
If it hit first with the damage of 40, it will fall off.
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|