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 / runFPI does anyone use this?

Author
Message
carroll6
16
Years of Service
User Offline
Joined: 28th Aug 2008
Location:
Posted: 30th Aug 2008 13:05
It seems to me, that runFPI would be one of the most powerful commands in the scripting language, but I can't get it to work. My theory is to use "runFPI" like calling a subroutine.. for nice and clean script, and also to introduce a larger variety of behaviors to entities.

But.. man I can't get it to work. I hacked all night. I tried setting the file path "runFPI=myfile" to the absolute path, several other paths.. duh..
I read the scripting tutorials. I was hoping to make a container script that I could just plug whatever script I wanted to in it... here
;container script
desc = container
::runfpi=\scriptbank\anubis4-fast.fpi


;end of script

Seems like it should work.. I've tried it with just one : Tried it just by setting ":state-0" (whatever that would do). I'm stumped.
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 30th Aug 2008 19:48 Edited at: 30th Aug 2008 19:54
The script line is wrong.

First you have two colons next to each other. You will need a condition after the first colon. There should not be a "\" before the scriptbank folder name. It already assumes that it is in the scriptbank folder, so if your fpi is only in the scriptbank folder then you need something like this:

:some condition:runfpi=anubis4-fast.fpi.

Here is what I had done with it. It is in the very last line.:



As you see if it is in a subfolder of scriptbank, then that subfolder needs to be added -- without a "\" in the beginning.

I coded this prior to the availability of variables. Having variables will now truly make this command more usable and "powerful."

The past has a lot of memories to hold onto; but, today is chock full of new adventures, and, the future shouts out, "The best is yet to come!" -- TerryC
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 30th Aug 2008 23:28
Some light may be helpful in this dark situation.

The way FPI has been coded into the engine, conditions are TRUE by default... thus if the engine has no conditions to prove FALSE, it is considered TRUE.

This means using two colons off the bat to execute an action all the time is acceptable scripting behaviour.


carroll6, your line SHOULD be correct, however there is a signle flaw. You start your path with a backslash. When placed into the engine like that, the engine will literally be trying to look in "C:\Program Files\The Game Creators\FPS Creator\Files\\scriptbank\anubis4-fast.fpi"

Notice the double slash in the path.

Remove the beginning backslash and it should work fine.




The one and only,


Those who live in the past, are destined to insanity. Those who live only for the future, will be slaves to their ambitions.
Those who live in the moment... only they, are truly happy.
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 31st Aug 2008 00:40 Edited at: 31st Aug 2008 00:59
A dark situation, huh?

Yes, I know it works, but I like to maintain good programming practices. That is the way I was trained and that is the way I trained those I managed as a Software Engineer. If you were using any other programming language you would need a condition in an "IF" statement for it to work. Yes, the scripting language is quite tolerable of mistakes but those mistakes can lead to a script not working although it will not crash the program. It might as well and I believe it should. If you want a condition to "always" be true, then use that condition. First of all it helps when you are debugging. In other words I would put it this way:

:always:runfpi=anubis4-fast.fpi

Edit:

Deleted some text that was irrelevant.

The past has a lot of memories to hold onto; but, today is chock full of new adventures, and, the future shouts out, "The best is yet to come!" -- TerryC
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 31st Aug 2008 01:09
Quote: "::runfpi=scriptbank\anubis4-fast.fpi
"


Sorry to have to correct you Ply, but this code will still not work. Not because of the two colons next to each other but because "scriptbank" cannot be included in the given path. It is for the same reason you had given that would include the extra backslash. caroll6's code would have produced the following:

"C:\Program Files\The Game Creators\FPS Creator\Files\scriptbank\scriptbank\anubis4-fast.fpi"

Leaving out "\Scriptbank" will produce the desired path as follows:

"C:\Program Files\The Game Creators\FPS Creator\Files\scriptbank\anubis4-fast.fpi"

So it is apparent that Lee put in as a default path: "C:\Program Files\The Game Creators\FPS Creator\Files\scriptbank\"

So, caroll6, do you have a character that is a System Lord who was once ascended? If you don't maybe the name is spelled differently but I know Anubis as a System Lord.

The past has a lot of memories to hold onto; but, today is chock full of new adventures, and, the future shouts out, "The best is yet to come!" -- TerryC
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 31st Aug 2008 01:29
Thank you for the correction, FL. I don't mean to insult your programming practices, I just felt it necessary to state that it will still run.

I, too, understand what it means to be properly trained and to maintain good programming habits, such as properly indenting, including the variable used in a for loop when giving the "next" closing statement. The program will still run if the variable is excluded from the next statement, but it's just good programming to use it.


The one and only,


Those who live in the past, are destined to insanity. Those who live only for the future, will be slaves to their ambitions.
Those who live in the moment... only they, are truly happy.
CoffeeGrunt
17
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 31st Aug 2008 02:38
Meh. My prrogramming skills suck....By the way, have you checked your EM-ail lately Ply?

carroll6
16
Years of Service
User Offline
Joined: 28th Aug 2008
Location:
Posted: 31st Aug 2008 13:12
thank you, got it to run. Not without some more tweaking though.. it used
:state=0:runfpi:people\anubis-4.fpi

boy you have to really focus, your mind wholeheartedly on the present moment.

thank of you.. plystire, and flatlander.

NOW.. how to make it drop out of "anubis-4" and execute another script, that is what I will work on next. I do not fully grasp what is going on, but the rewards would be good. I'd be able to make a character behave in a variety of ways.

There are lots of commands but I am not getting the syntax and file paths right.

Hmm.. how about a "randomize" state.. that would change the state so different scripts would run? chase, coward, attack, etc. Seems a good idea to me.

Also another question is.. can states be passed from script to script?
"attack.fpi" runs, but the timer runs out, so the state is set to 100, and
in the next script the state is checked, and "flee.fpi" runs.

Maybe this is overkill. The idea is, a environment where the characters behavior is not predictable. Or even better, one NPC's behavior affects another NPC's behavior.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 1st Sep 2008 07:56
For randomizing the outcome how about the following:




Getting the script sto return to the parent script will need to be put into the child scripts, because once it executes a new script, the old one is dumped and the new one gets looped until told otherwise by dying or told to use another one.


The one and only,


Those who live in the past, are destined to insanity. Those who live only for the future, will be slaves to their ambitions.
Those who live in the moment... only they, are truly happy.
carroll6
16
Years of Service
User Offline
Joined: 28th Aug 2008
Location:
Posted: 1st Sep 2008 17:00
Why thank you.. I will try it!

I am a noob. I do not know why "random=1:incstate=1; has to be stated so many times.. I'll have to look it up

However, I am only slightly daunted. The graphics and complexity are almost the LEAST part. A game is exciting because of the way it hooks you into it. It is almost- indescribable. A game, like a movie, captures the imagination.

I have a level that I am trying all these scripts out with. What I am trying for is- suspense and storyline. Then-graphic detail. Then-sound. This level is a "egyptian grave robber" type where he picks up the gold bars, armed only with a 5 shot revolver. Then, on the way out, he faints (a hurtzone I guess).. and wakes up in a hospital room..and then, the storyline continues.

Thanks!
carroll6
16
Years of Service
User Offline
Joined: 28th Aug 2008
Location:
Posted: 1st Sep 2008 18:09
The "random" statement I dont get. Hmm..someone came in as I was making the last post. RANDOM=X is true when a random value between 0 and X is equal to one. RANDOM=X is true when a random value between 0 and X is equal to one
At first glance, it seems like the outcome is simply "5" state is set to 5. That's what I keep coming up with as I look at this code.

I dont get it.

Login to post a reply

Server time is: 2024-11-24 13:42:51
Your offset time is: 2024-11-24 13:42:51