Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / How do i use a barrel to explode a door?

Author
Message
riccetts
6
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 22nd Jan 2017 01:01
I figured out how to make the door explode by shooting at it,but I want to use a barrel to blow the door by shooting the barrel. I messed with the friction and strength of the door but it still won't work. Any ideas?
ncmako
5
Years of Service
Recently Online
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 22nd Jan 2017 22:50
Hi riccetts, nice to see you.
Quote: " I want to use a barrel to blow the door by shooting the barrel"

Very easy to do. I am guessing your using a Segment Door? Am I correct?
All you have to do is place your barrel close to the door, set it to explode (yes) set it's Explode Damage to something like 10?
Next for your door, set to explode (yes) also, set it's Explode Damage also low like 10. Last (important) set the doors "Strength" lower
than the "Barrels" explode damage, like 1-3. Now the door will explode when the barrel explodes
best
My games never have bugs. They just develop random features..
Lots and lots of random features...
2S!K
5
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 23rd Jan 2017 02:37 Edited at: 23rd Jan 2017 02:40
@ncmako, I believe you misunderstood his question; riccetts knows how to explode the door but doesn't want it to be explodable via gun/standard damage. @riccetts, Am I right?

Unfortunately the standard entity properties (explodable=yes) wont work for this. You will need to use scripts that trigger the effect. I have some simple scripts that will work for you however the barrel must be immobile or else the player can shoot it in a different location and the door will still destroy. If you want the barrel to be able to move let me know and I'll work my magic (I might even look into it if I ever get bored). OK LETS START...
Create this script and use it for the barrels "destroy script":
+ Code Snippet

Then create this script and use for the doors "main" script:
+ Code Snippet
Go ahead and set the barrels damage to whatever you like and leave door properties the same if desired. Door does not need to be exp loadable that's just tacky game making. For a nice effect place a second door entity on the ground beyond the door and set it to static so it looks like the door was knocked down by the explosion.
2S!K Productions
ncmako
5
Years of Service
Recently Online
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 24th Jan 2017 00:12
@ 2S!K Yeah, wasn't sure if he's using a segment door or an entity one? Or maybe, if he just wanted to blow "open a door"
The "static" door behind it is a nice idea/effect Thanks.
My games never have bugs. They just develop random features..
Lots and lots of random features...
2S!K
5
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 24th Jan 2017 01:35
@ncmako, I believe using a segment door creates an entity in ure entity list? (Correct me if im wrong) or atleast it does for me.
2S!K Productions
riccetts
6
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 24th Jan 2017 13:07
Thanks to all
2S!K that's what I had in mind I'll try it.
riccetts
6
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 25th Jan 2017 02:38
I tried it and the entity door will not fall on static.
2S!K
5
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 25th Jan 2017 08:58
@riccetts, can you be a little more specific on what you want to achieve?
This script is designed to destroy a door when the barrel is shot (the door cannot be static). This door will not fall it simply "disappears". A static door is placed on the floor behind the door to make it look as if it falls.
2S!K Productions
riccetts
6
Years of Service
User Offline
Joined: 14th Oct 2010
Location:
Posted: 25th Jan 2017 11:24
I would like the door to explode when the barrel explodes. In your code the door isn't even there before the barrel explodes. The entity door has to lay flat on the floor for th the effect. I get that part. So how do get the door to explode when I shoot the barrel?
2S!K
5
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 25th Jan 2017 22:57
Hmm I dont understand what you mean by the door "isn't even there", did you set up the scripts correctly? Sorry, I forgot to mention to put the doors name in the "ifused" property of the barrel but this shouldn't be the reason why the door doesn't show. Im attaching some screenies of my item properties make sure you place the scripts in the correct spots.
2S!K Productions

Attachments

Login to view attachments
2S!K
5
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 20th Feb 2017 11:09
@riccetts, Did you ever get this to work properly?
I decided to tinker around some more today and came up with a far better solution one that allows you to move the barrels and use RPG's/Grenades if you wish!!!

There are 2 ways to set this up a lazy way and the proper way. First of all use a door segment and place the door such as in my previous posts screen shots. Set the doors strength to what you wish besides 0 (higher values can allow you to use multiple explosives on the door).
Exp-loadable (yes/no) it doesn't matter just be sure to adjust the explode damage to 0 if you decide to. Now use the script in the doors "main" field. + Code Snippet
That's it lazy way done!! However this way you will not get bullet holes on the door and actually bullets will travel through so you may see holes on the other side.
Now the proper way! After these steps place this script in the "destroy field" + Code Snippet and place a name in the "if used property" ex: "door2"
Next, place a new door from the entity model, not the segment. Do not change anything (strength must be 0) besides the "main" script and the name of the entity, use the previously created name (door2). Use this for the "main", + Code Snippet
Lastly align your door right in front of the segment door.

You now have a door that can only be destroyed through explosions! The door will leave bullet holes/sparks/chips when shot (depending on type of door).

If you liked this run-around let me know so I will continue to devote my time for users on the forums!
As always, Game on! -2S!K Productions

Login to post a reply

Server time is: 2017-08-20 20:22:15
Your offset time is: 2017-08-20 20:22:15