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 / Faking simple animation? Shooting a lock to open a door?

Author
Message
James Kravenwolf
16
Years of Service
User Offline
Joined: 22nd Nov 2008
Location: Ohio
Posted: 1st Mar 2009 08:31 Edited at: 1st Mar 2009 08:38
NOTE: I was refraining from posting this question for a while because I wasn't sure if it would violate the 'no requests' rule in this thread. But I figured, I would let the moderators decide if this crosses the line in that sense.




I was searching through the forum a while back for ideas to contribute to the community, and I found a very appealing script provided by meteorite, that allows you to shoot a lock in order to open the door that script is applied to. I wanted to make a model of a padlock and share it with other users as my first contribution to the site, for all the help everyone has been giving my thus far. Here is his original post: http://forum.thegamecreators.com/?m=forum_view&t=143285&b=23

And here is the lock's snipplet:



...And the door's script:



I tried this in my game and it works great--I'm very happy with it! But, I wanted to make it more realistic and was wondering if it was possible to fake an animation of the lock actually falling off the door after it was shot.

The concept was to create two models of a padlock. One of these models was the locked padlock, and the other was a model of a broken padlock (i.e. the lock after being shot). I was wondering how (if even possible) to add to the lock's script so that when the player shoots the lock entity, it makes it dissapear, and INSTANTLY spawns the broken lock model in the same spot, in which that model will fall to the ground? Creating the illusion the lock was destroyed when shot. I guess I am ultimately asking someone that knows how to script to provide the modification to this code to make it work (which is why I was unsure about posting this in violation to the rules)so I could finally start to contribute back for all my questions answered. Thanks.

-Kravenwolf
Seth Black
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 1st Mar 2009 15:45
...piece of cake.

This thread will unlock the potential of what you seek to accomplish:
http://forum.thegamecreators.com/?m=forum_view&t=120223&b=24

Pay special attention to how the illusion is acheived, and you'll have this working, in no time flat!


dumpus
16
Years of Service
User Offline
Joined: 1st Jan 2008
Location: Canada, eh?
Posted: 1st Mar 2009 17:12 Edited at: 1st Mar 2009 17:13
How I'd do it:

Set the broken lock model right overtop of the real lock. Go into its properties and set "Spawn at start" to no, and "Spawn after delay" to yes. Give it the same name as the original lock.

It seems as if you've already got an "activateused=1" line in the script, so all you need to do is specify the ifused (in this case, the lock name).

Now, it should spawn the destroyed lock as the original disappears. Best of luck!

*This post will self-destruct in 10 seconds.*
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 1st Mar 2009 19:48
or you could just make the lock thats suppose to be on the floor the same name as the door.

So put a lock on the floor.
Put spawn at start to no
and spawn after delay to yes
then change the lock of the floors name to the same name as the door.


Seth Black
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 2nd Mar 2009 04:10
...the lock actually seen dropping to the ground would be big part of this illusion, I'd think...


James Kravenwolf
16
Years of Service
User Offline
Joined: 22nd Nov 2008
Location: Ohio
Posted: 2nd Mar 2009 08:08 Edited at: 2nd Mar 2009 08:09
Thanks a lot for the help, guys. I'm going to try to work with this tonight, and take a look at Luke's collapsing balcony (appreciate the link, Seth), and hopefully will have this script working and the model up on the forums in a few days as my way of saying thanks.

One last thing I wanted to find out before I dive into the scripting...do the physics of the broken model have to be adjusted so when it spawns it actually falls to the floor, and doesn't hang on the wall like the first lock does? What exactly needs to be changed to make the model fall to the floor?


-Kravenwolf
dumpus
16
Years of Service
User Offline
Joined: 1st Jan 2008
Location: Canada, eh?
Posted: 3rd Mar 2009 00:12
I don't think you have to toy with the physics...when you spawn the object, as long as it's a "normal object" (not a character or anything), it should fall correctly.

*This post will self-destruct in 10 seconds.*
Roger Wilco
19
Years of Service
User Offline
Joined: 6th Jul 2005
Location: In the Shadow of Chernobyl
Posted: 3rd Mar 2009 01:37
If you want, you can tinker with the spawn velocity settings. It might make the padlock fly away with a bit more punch, if you can find the right value.

By the way, great concept! I can't wait to see how it turns out with a physics-affected padlock.

Login to post a reply

Server time is: 2024-11-24 20:51:01
Your offset time is: 2024-11-24 20:51:01