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 / Referencing other scripts?

Author
Message
Oakley Design
17
Years of Service
User Offline
Joined: 18th Jun 2007
Location: Uranus
Posted: 2nd Jun 2008 17:47 Edited at: 2nd Jun 2008 18:14
Is it possible to reference an fpi script within another?

Say for example the enemy goes through their main script (pace.fpi say), then at a certain point switches to another script automatically? (i.e. from pace.fpi to cover.fpi)

EDIT: After reading the Hints n Tips guide, it says you can use RUNFPI=X as an action. I assume this answers my question.

Seth Black
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 2nd Jun 2008 21:21
...affirmative.


Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 2nd Jun 2008 22:17 Edited at: 2nd Jun 2008 22:23
Yup, here's how I have used it ( Seth, I don't mean to take anything away from you succinct answer ):

Quote: ";Artificial Intelligence Script

;Header

desc = l1d5

;Triggers

:plrcanbeseen:rotatetoplr

:state=0:hudreset,hudx=38,hudy=4,hudimagefine=dialogtofjane.png,hudname=assistant,hudhide=1,hudmake=display
:state=0:hudreset,hudx=38,hudy=4,hudimagefine=dialogtofjames.png,hudname=plyrname5,hudhide=1,hudmake=display
:state=0:hudreset,hudx=38,hudy=8,hudimagefine=dialogtofl1d1_j.png,hudname=l1d1_j,hudhide=1,hudmake=display

. . .

:state=55:rotatetoplr
:state=55,plrdistwithin=90:state=56
:state=56,plrdistwithin=90:hudshow=plyrname5,hudshow=l1d6_j
:state=56,plrdistwithin=90,plrusingaction=1:timerstart,state=57,hudunshow=l1d6_j,hudunshow=plyrname5
:state=57,timergreater=500:state=75

:state=75:rotatetoplr,activateifused=1,state=100

:state=100:runfpi=tof\l1d5a.fpi

;End of Script

"


You actually use the path and name of the fpi script in place of the "X". The path begins within the "scriptbank" folder.

Now with variables this can be even more powerful. Depending on the value of a variable you can run a particular script that is unique to the situation.

** We are not Alone **
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 2nd Jun 2008 23:54
Exactly, so you could use this command for difficulty settings (I believe we talked about this at some point) or even use it for "alarms", so if the alarm goes off, then every entity becomes active and heads to kill the player.


The one and only,


Seth Black
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 3rd Jun 2008 17:27
Quote: "( Seth, I don't mean to take anything away from you succinct answer )"


...that's quite alright, Flatlander.


Login to post a reply

Server time is: 2024-11-24 09:43:58
Your offset time is: 2024-11-24 09:43:58