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 / Simple animation questions for opening a cash register.

Author
Message
MaskedMakrel
15
Years of Service
User Offline
Joined: 1st Feb 2011
Location: US
Posted: 22nd Mar 2011 01:08
So, I am trying to animate a cash register. The cash register opens on the first 21 frames and closes on the next 19. (Frame 21 is midpoint). So it should be anim1=1,21 and anim2=21,40. Not sure what the animax should be.

My first thought was to create a simple script which would open the register if the player approached it. But it fails.




So, I guess I have 2 questions.

First, what should my FPE look like in the anim section at the bottom?

Second, how should I structure the FPI to work as the main script for open register.

Thanks.
Pirate Myke
16
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 22nd Mar 2011 02:54 Edited at: 22nd Mar 2011 02:56
animmax=any number greater then the number of animations you have.

The reason your script failed is because you dont tell it to go to state=1. so its just sitting there at frame 40 just as instructed.

Try this:
;Check players distance
:state=0,plrdistwithin=50:state=1
:state=0,plrdistfurther=50:state=10

;OpenRegister Door
:state=1:setframe=0,state=2
:state=2:incframe=0,state=3
:state=3,frameatend=0:state=0

;Close Register Door
:state=10:setframe=1,state=11
:state=11:incframe=1,state=12
:state=12,frameatend=1:state=0


making the state go back to 0 will allow the routine to work over again. If this is a one shot deal then in the state=12 line send it to any other state not listed.

Hope this helps.

Nothing but coffee in my veins 'Insomnia is Coming'
MaskedMakrel
15
Years of Service
User Offline
Joined: 1st Feb 2011
Location: US
Posted: 22nd Mar 2011 04:26
Thank you.

I tried the code and the register just sits there, even if I jump on top of it...

I have 2 versions of the register. One version is limited to 20 frames. So the anim would just open. The other is 40 frames and it has the animation both opening and closing. I'm using the 40 frame anim version right now.

I have the entity set to dynamic. If I use your script and set the main ai to something called "openregister.fpi" in the main ai, the register still does not open.

I've tested it out in Fragmotion and the drawer opens fine when I play the anim, but not when I try it in FPSC.
MaskedMakrel
15
Years of Service
User Offline
Joined: 1st Feb 2011
Location: US
Posted: 22nd Mar 2011 07:26
Here's what I have so far. (The textures are default sketchup textures). Here are the files zipped.

I put Pirate Myke's script in the Script folder (normally, I throw these in my user directory). I did not add the script path to the default FPE because I just change it when I build the level for testing. When it works, I'll change the fpe.

http://www.mediafire.com/?ri2abrs30y10a

This isn't a really critical thing to get working, but I wanted something to try to learn from.
Pirate Myke
16
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 28th Mar 2011 01:46
I have downloaded the files and will look at them.
I have been busy. Sorry not to get back sooner.

Nothing but coffee in my veins 'Insomnia is Coming'
MaskedMakrel
15
Years of Service
User Offline
Joined: 1st Feb 2011
Location: US
Posted: 28th Mar 2011 10:15
Do not worry about it. It's a very low priority for me. I am more interested in learning how to make a simple animation work in an object than getting the cash register to work, but started with the cash register. (It was that or the beer tap...) Anyway, I appreciate the fact that you responded.
Pirate Myke
16
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 30th Mar 2011 07:42
I double click on the xfile and opened it in direct x viewer.

The whole thing is moving not the drawer only.

Its an export issue.

Sorry for the delayed response.

Nothing but coffee in my veins 'Insomnia is Coming'

Login to post a reply

Server time is: 2026-07-18 07:32:06
Your offset time is: 2026-07-18 07:32:06