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 / Trigger Animations With Scripts

Author
Message
RAXMUX Games
14
Years of Service
User Offline
Joined: 16th Dec 2009
Location: Sweden
Posted: 28th Jan 2012 17:09
Hi !
I'm pretty new to scripting and I want to make scripts so you can trigger NPC's animations. I don't need the to have AI or other funktions. I just want them to exist then do a animation when PLR enters trigger zone. Example : NPC reapeating sitting animation until PLR enters zone, wich trigger NPC's stand up animation wich goes over to a idle animation.

Is this possible and how can I do this ?

Just call me Raxmux
007
13
Years of Service
User Offline
Joined: 22nd Aug 2011
Location:
Posted: 29th Jan 2012 01:17
Hello folk,

Yes, it is possible, it`s not that hard.

First of all, you must now that in programming (scripting) there are various ways of doing the same thing.

Reading your post, i thought on something like this:

Just use the command animate=x where x is the number of the character animation specified in the fpe file (in example):

;sitting animation
anim5 = 90,190

;stand up animation
anim6 = 210,250

;idle animation
anim7 = 260,290

You would have to edit an existing character script to have the npc act as an enemy, to shoot you and such.

I think you would just have to do something like this:

:state=0:state=1

;while player is further than 6 segments the npc plays the ;animation 5 which is the sitting animation

:state=1,plrdistfurther=600:animate=5

;if player is within 2 segments (very close to the npc), will ;play the animation 6 which is the standup animation
;we use setframe and incframe because this command plays the ;animation once, while the command animate=6 would loop this ;animation instead of playing once

:state=1,plrdistwithin=200:setframe=6,incframe=6

;here will check if the animation finished, then go to state=2 ;where it will play in loop the idle position animation

:state=1,frameatend=6:state=2
:state=2:animate=7

save this as a npc-animation.fpi (or any other name, but with a *.fpi extension) and set it as the main script of your npc.

But if you want a good counseiling bro, try to study the Official Community Guide for FPSC.

I began scripting in 5 months ago, and only by studying this guide, and also, a lot of trial and error, and analizing almost all the stock FPSC scripts, i could learn A LOT, and i am doing AMAZING THINGS in FPSC Script, which i am a lot proud of myself


Study bro, study FPI Script. In the begin i could not understand the use of state variables, but after a lot of training, i learned well.

When you master FPI Script, be sure that you will be able to create an AWESOME FPSC Game.

Cheers,

007.

Goldenye 007 N64
RAXMUX Games
14
Years of Service
User Offline
Joined: 16th Dec 2009
Location: Sweden
Posted: 29th Jan 2012 13:19
@007 Wow! Thank you so much for this. Going to try out this now

Just call me Raxmux

Login to post a reply

Server time is: 2024-11-24 01:24:50
Your offset time is: 2024-11-24 01:24:50