FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Using a Single Crowbar on Multiple Doors
Of course that's why... I'm an idiot.. sorry.
The problem was that when you were done with the first door, you'd get a crowbar from GiveItem but I had given it the wrong name, since I didn't know what name you were using. And since it now had the wrong name, it wouldn't work on the other doors. Glad you got it working!
Trying is the first step to success.
|
|
09-22-2014, 09:24 AM |
|
AGP
Senior Member
Posts: 448
Threads: 45
Joined: Dec 2012
Reputation:
23
|
RE: Using a Single Crowbar on Multiple Doors
It's no problem! Thank you for the wall of text though, it was super helpful.
Just wish I knew what was going on with the sounds and particles. :/
EDIT:
Nvm, fixed that too!
I never added the variable to AreaEffect. *facepalm*
The script is now in full working order and I will edit the OP with the script for future generations! ;D
(This post was last modified: 09-22-2014, 09:29 AM by AGP.)
|
|
09-22-2014, 09:26 AM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
RE: Using a Single Crowbar on Multiple Doors
Edit: AHEM, I'll just spoiler this because of the comment below
(This post was last modified: 09-22-2014, 09:31 AM by Mudbill.)
|
|
09-22-2014, 09:29 AM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Using a Single Crowbar on Multiple Doors
Well, let's see if you can fix it yourself.
Hint:
Everytime you break the door with the crowbar, a sound and a particle effect will be active at "AreaEffect".
Any idea why it won't work at other areas?
NINJA'D.
God dammit Mudbill!
Trying is the first step to success.
|
|
09-22-2014, 09:30 AM |
|
AGP
Senior Member
Posts: 448
Threads: 45
Joined: Dec 2012
Reputation:
23
|
RE: Using a Single Crowbar on Multiple Doors
(09-22-2014, 09:29 AM)Mudbill Wrote: See, your particles and sounds are being played at the area named AreaEffect for each door. Because the doors probably aren't in the same location, that won't do well. Try this:
Rename the area for each door to match the placement of it, for example AreaEffect_Door_1 for Door_1.
In the script, do a similar thing as before with the particle and sound script lines. When referencing the "AreaEffect" instead try "AreaEffect_"+GetLocalVarString("Door"). If that string is Door_1, then the name should match the area by Door_1.
Yes, just realized this. *facepalm*
for(int i=1; i<=4; ++i) CreateParticleSystemAtEntity("", "ps_hit_wood.ps", "AreaEffect_"+i, false);
for(int i=1; i<=4; ++i) PlaySoundAtEntity("", "break_wood_metal", "AreaEffect_"+i, 0, false);
|
|
09-22-2014, 09:31 AM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
RE: Using a Single Crowbar on Multiple Doors
Dammit, I was too late for the spoiler xP
(This post was last modified: 09-22-2014, 09:32 AM by Mudbill.)
|
|
09-22-2014, 09:32 AM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: [SOLVED] Using a Single Crowbar on Multiple Doors
Actually, no the for loop won't work here, AGP.
Because now, when you're doing the callback, the sound will play at ALL of the doors, and the particle will spawn at all the areas at the same time!
Trying is the first step to success.
|
|
09-22-2014, 09:35 AM |
|
AGP
Senior Member
Posts: 448
Threads: 45
Joined: Dec 2012
Reputation:
23
|
RE: [SOLVED] Using a Single Crowbar on Multiple Doors
Haha! XD Thanks, guys, for the help! I went ahead and posted the full working script so that others may enjoy the awesomeness.
(09-22-2014, 09:35 AM)FlawlessHappiness Wrote: Actually, no the for loop won't work here, AGP.
Because now, when you're doing the callback, the sound will play at ALL of the doors, and the particle will spawn at all the areas at the same time!
Oh shoot! You're right! *facepalm again*
(This post was last modified: 09-22-2014, 09:36 AM by AGP.)
|
|
09-22-2014, 09:35 AM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: [SOLVED] Using a Single Crowbar on Multiple Doors
Since you're having the two things in the collide callback, why not have them call at
"AreaEffect_"+asParent.
And just rename all the effect areas to the right names.
Trying is the first step to success.
|
|
09-22-2014, 09:39 AM |
|
AGP
Senior Member
Posts: 448
Threads: 45
Joined: Dec 2012
Reputation:
23
|
RE: [SOLVED] Using a Single Crowbar on Multiple Doors
It's now gone back to skipping the particle effects. :/
It did work using "_"+i, but it did make the particles appear for all the other doors.
|
|
09-22-2014, 09:44 AM |
|
|