PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: [SCRIPT] Breakable Door
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|
03-23-2013, 02:54 PM |
|
Knusper.
Member
Posts: 58
Threads: 7
Joined: Feb 2013
Reputation:
2
|
RE: [SCRIPT] Breakable Door
as i said:
You have to name all entities like they are named in the scripts
or name all entities in the scripts like you named them in the editor.
To have more doors:
I think just make everything as like the first door, and then just name all entities like:
breakdoor_2
so, maybe just for example add a 2 at the end.
And change the names in the script, witch you copy paste to have two.
Then you need to use new function names.
just with an other impactarea and so on.
I think that works, but i didnt test it.
No one knows, how "I" goes.
(This post was last modified: 03-23-2013, 06:10 PM by Knusper..)
|
|
03-23-2013, 06:09 PM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: [SCRIPT] Breakable Door
(03-23-2013, 06:09 PM)Knusper. Wrote: as i said:
You have to name all entities like they are named in the scripts
or name all entities in the scripts like you named them in the editor.
To have more doors:
I think just make everything as like the first door, and then just name all entities like:
breakdoor_2
so, maybe just for example add a 2 at the end.
And change the names in the script, witch you copy paste to have two.
Then you need to use new function names.
just with an other impactarea and so on.
I think that works, but i didnt test it.
I didn't direct it to you. I was directing it to Erik The Born. And actually you can make another one.
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|
03-24-2013, 08:04 AM |
|
Erik The Born
Member
Posts: 59
Threads: 7
Joined: Mar 2013
Reputation:
0
|
RE: [SCRIPT] Breakable Door
(03-24-2013, 08:04 AM)JustAnotherPlayer Wrote: (03-23-2013, 06:09 PM)Knusper. Wrote: as i said:
You have to name all entities like they are named in the scripts
or name all entities in the scripts like you named them in the editor.
To have more doors:
I think just make everything as like the first door, and then just name all entities like:
breakdoor_2
so, maybe just for example add a 2 at the end.
And change the names in the script, witch you copy paste to have two.
Then you need to use new function names.
just with an other impactarea and so on.
I think that works, but i didnt test it.
I didn't direct it to you. I was directing it to Erik The Born. And actually you can make another one.
Yes this is what my custom story has in its HPS file. However for some reason when I try to break a door. I hear the door break. But instead of the actual door im banging on geting broken, another door is lol. And then when I try to smash the door you actually need to smash it takes like infinity hits it never breaks. It might be me fucking something up but how? I paste my HPS to see if you can see some wrong in it.
void OnStart() { AddEntityCollideCallback("Sledgehammer", "ImpactArea", "ImpactScript", false, 1); AddEntityCollideCallback("Sledgehammer", "ImpactArea_1", "ImpactScript_1", false, 1); AddUseItemCallback("", "rusty_key", "celler", "UsedKeyOnDoor", true); }
// BreakableDoor_1 == Mansion_1 door // Pieces_1/2 == custom Mansion_Broken made static and undying (-1 lifetime) // Pieces just behind the door, the ImpactArea veeery close to BreakableDoor_1. // Sledgehammer= Item used to destroy it. // BreakEffect areas are on BreakableDoor_1
void ImpactScript (string &in asParent, string &in asChild, int alState) { if(GetLocalVarInt("BreakDoorInt") == 3) { SetEntityActive("ImpactArea", false); SetPropStaticPhysics("Pieces_2", false); SetPropStaticPhysics("Pieces_1", false); AddPropImpulse("Pieces_1", 0.5, 1, 3, "world"); AddPropImpulse("Pieces_2", 0.6, 0.3, 2.5, "world"); CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect", false); PlayGuiSound("break_wood_metal.snt",2); }
if(GetLocalVarInt("BreakDoorInt") == 2) { PlaySoundAtEntity("", "break_wood_metal.snt", "Pieces_1", 0, false); SetPropHealth("BreakableDoor_1", -1); AddPropImpulse("BreakableDoor_1", 0, 0, -0.5, "world"); } PlaySoundAtEntity("", "break_wood.snt", "BreakableDoor_1", 0, false); AddLocalVarInt("BreakDoorInt", 1); CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect", false); CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect2", false); } void ImpactScript_1 (string &in asParent, string &in asChild, int alState) { if(GetLocalVarInt("BreakDoorInt") == 3) { SetEntityActive("ImpactArea_1", false); SetPropStaticPhysics("Pieces_4", false); SetPropStaticPhysics("Pieces_3", false); AddPropImpulse("Pieces_3", 0.5, 1, 3, "world"); AddPropImpulse("Pieces_4", 0.6, 0.3, 2.5, "world"); CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect_1", false); PlayGuiSound("break_wood_metal.snt",2); }
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); } void ImpactScript_2 (string &in asParent, string &in asChild, int alState) { if(GetLocalVarInt("BreakDoorInt") == 3) { SetEntityActive("ImpactArea_2", false); SetPropStaticPhysics("Pieces_6", false); SetPropStaticPhysics("Pieces_5", false); AddPropImpulse("Pieces_5", 0.5, 1, 3, "world"); AddPropImpulse("Pieces_6", 0.6, 0.3, 2.5, "world"); CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect_2", false); PlayGuiSound("break_wood_metal.snt",2); }
if(GetLocalVarInt("BreakDoorInt") == 2) { PlaySoundAtEntity("", "break_wood_metal.snt", "Pieces_5", 0, false); SetPropHealth("BreakableDoor_2", -1); AddPropImpulse("BreakableDoor_2", 0, 0, -0.5, "world"); } PlaySoundAtEntity("", "break_wood.snt", "BreakableDoor_3", 0, false); AddLocalVarInt("BreakDoorInt", 1); CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect_2", false); CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect2", false); } void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("celler", false, true); PlaySoundAtEntity("", "unlock_door", "celler", 0, false); RemoveItem("rusty_key"); }
(This post was last modified: 03-24-2013, 08:22 AM by Erik The Born.)
|
|
03-24-2013, 08:21 AM |
|
Knusper.
Member
Posts: 58
Threads: 7
Joined: Feb 2013
Reputation:
2
|
RE: [SCRIPT] Breakable Door
You need to have new names for the variables.
like: AddLocalVarInt("BreakDoorInt 2", 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
No one knows, how "I" goes.
(This post was last modified: 03-24-2013, 09:23 AM by Knusper..)
|
|
03-24-2013, 09:14 AM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: [SCRIPT] Breakable Door
*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
}
THE OTHERWORLD (WIP)
Aculy iz dolan.
|
|
03-24-2013, 11:55 AM |
|
Erik The Born
Member
Posts: 59
Threads: 7
Joined: Mar 2013
Reputation:
0
|
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
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 |
|
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."
|
|
03-24-2013, 12:19 PM |
|
Erik The Born
Member
Posts: 59
Threads: 7
Joined: Mar 2013
Reputation:
0
|
RE: [SCRIPT] Breakable Door
(03-24-2013, 12:19 PM)JustAnotherPlayer Wrote: (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.
What? Can you explain how to make it have 40 Health first hit. 10 after second hit. and at 3rd hit break? PS: This guys script didnt wokr at all. All I see is some very small particle effect no sound and most importantly it doesnt break. My apploligizes, I were stupid enough not to name the door to DoorToBreak lol. But I still need a way to make it so that you can hit 3 times and first tme 40 then 10 and last 0 so the door breaks. How does this work?
(This post was last modified: 03-24-2013, 01:18 PM by Erik The Born.)
|
|
03-24-2013, 12:27 PM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: [SCRIPT] Breakable Door
(03-24-2013, 12:27 PM)Erik The Born Wrote: (03-24-2013, 12:19 PM)JustAnotherPlayer Wrote: (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.
What? Can you explain how to make it have 40 Health first hit. 10 after second hit. and at 3rd hit break? PS: This guys script didnt wokr at all. All I see is some very small particle effect no sound and most importantly it doesnt break. My apploligizes, I were stupid enough not to name the door to DoorToBreak lol. But I still need a way to make it so that you can hit 3 times and first tme 40 then 10 and last 0 so the door breaks. How does this work?
Hitting 40 first creates a big gap in the door. Using 10 makes a much smaller gap.
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|
03-24-2013, 02:14 PM |
|
|