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 / Door starts slightly open?

Author
Message
doopus
16
Years of Service
User Offline
Joined: 23rd Dec 2007
Location:
Posted: 19th Nov 2012 05:15
Hey everyone,

Is it possible via scripting to have a door start slightly ajar, but still act as a normal door? I'd like the door to still be able to be opened, but it starts off open a little bit. Like this:

http://www.yourpurposeguide.com/sites/default/files/door_ajar.jpg

I'm not sure if it can be done with any sort of animation properties in a script, or if it would have to be modelled and animated in a specific way. If anybody had any advice, I'd greatly appreciate it.

Thanks!

*This post will self-destruct in 10 seconds.*
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 19th Nov 2012 05:34 Edited at: 19th Nov 2012 05:54
Simply open the .fpe for the door and change the anim frames, you will have to adjust to how far you want the door open. Change the frames:
;Animationinfo
animmax = 1
anim0 = 0,30

To say:
;Animationinfo
animmax = 2
anim0 = 10,30
anim1 = 0,10

You will need to include a line in the script to play anim 1 at start of whichever script you use so it plays at spawn, that should do it, you should be able to work it out from there.

I left the main animation call as anim=0 as this would mean less messing around with the default script.

doopus
16
Years of Service
User Offline
Joined: 23rd Dec 2007
Location:
Posted: 19th Nov 2012 06:04
Thanks for the quick reply!

I changed those animation frames in the .fpe, and I added "animate=1" at the beginning of the "dooruse.fpi" script, but it doesn't work quite right. The door starts off completely shut, and it opens fine. However, when I close it, it doesn't close all the way. I've done a bit of fiddling, but I can't get it to work the way I want it to. Any suggestions? :/

*This post will self-destruct in 10 seconds.*
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 19th Nov 2012 06:33 Edited at: 19th Nov 2012 06:45
Dont use animate= use incframe=1 for anim=1.

You might also need to include frameatend= frameatstart= conditions and setframe action..

Look more closely at the door script to get a better understanding of how its working.

In fact thinking of it simply using setframe=1 and moving to another state, might do the trick using:
;Animationinfo
animmax = 2
anim0 = 0,30
anim1 = 10,11

This would allow to shut the door completely after animating.

I dont have the time to test it for you right now, play around with it

rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 19th Nov 2012 07:36 Edited at: 19th Nov 2012 07:47
I was able to do a quick test using the settings in entity .fpe:

;Animationinfo
animmax = 2
anim0 = 0,30
anim1 = 10,11

and simple script



Definitely starts the door open, you can add this to whatever script you are using and change the states accordingly thereafter.
Do not however change state=0 in the original script as this would be your hud creation and requires this state. Change this one instead.

Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 19th Nov 2012 21:14 Edited at: 19th Nov 2012 21:18
Rolfy, thanks for the info. I would not have figured out the animation part for the fpe file. I am going to use this as well sometime. It is very cool as the following image shows. This is a still of the door partially open at the start. I don't think I would be fast enough to take the image while it was opening.



BTW, I set anim1 equal to 5,6 to be even less open. You can play around with this until you get it to how open you want it. Also, be sure and set animmax to 2. I forgot to do this and it didn't work because it ignored the second animation set. I know that's a little confusing as the second animation is "anim1"

rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 19th Nov 2012 21:43 Edited at: 19th Nov 2012 22:23
Does look pretty cool
Wouldn't be hard to script it as blocked by something and you could place something seen inside to entice the player to find a way in

This can be applied to any animated entity including characters for dead bodies etc, simply check out the animation lists in the manual for whatever positions you might want..and call a stand up anim if its playing dead. It can be as simple or as complex as you want it to be.

doopus
16
Years of Service
User Offline
Joined: 23rd Dec 2007
Location:
Posted: 20th Nov 2012 03:59
I've got it working now, thanks a ton for the help! I hope this is beneficial for everyone else as well.

@F l a t l a n d e r

That looks awesome, indeed!

*This post will self-destruct in 10 seconds.*
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 21st Nov 2012 07:48
Very nice Flatlander! Thank you for these tips rolfy, they will come in very handy.

Login to post a reply

Server time is: 2024-11-23 20:09:16
Your offset time is: 2024-11-23 20:09:16