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 / FPI to other programming languages: Comparison proposals wanted

Author
Message
daarboven
16
Years of Service
User Offline
Joined: 20th Dec 2007
Location: right over there, see?
Posted: 3rd Feb 2009 12:46
Hi there,
I have a fair bit of understanding in Actionscript/Javascript, and wanted to know how the methods and practices of these language compare/translate to FPI Script.

These are some of my questions (feel free to add to them):

-Functions: the very heart of my scripts are functions like

that will be called whenever needed like:

How would you apply this concept to FPI?

-Loops: for, for..in, while, do..while;-Is that even possible in FPI?

-If or case statements: If...then, if -else if, else;- I guess this must be at least possible with the "state"-structure of FPI

-data storage: Arrays or other means of name-value pairs, local and global variables;- How do these work in FPI?

-import of code like in classes or similar constructs to make a more object-oriented approach?

There are surely more questions but for fear this would spread to wide- Let's start here, you FPI gods, and you apprentices to!

Every bit you can tell me to shed some light on this topic is highly appreciated....

best regards

daarboven

I am Jacks complete lack of surprise.
Dar13
16
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 3rd Feb 2009 13:10 Edited at: 3rd Feb 2009 13:13
This is for official version right? Variables work like this...


Arrays are an impossibility in FPI scripting.

if..then,if..else,if..else,else would be used like so:


for loops you could loop between states.

FPI scripting is made for the manipulation of media not creation of it so an object oriented approach is all you can really do.

if i'm wrong here someone tell me about it.

I know not with what weapons WWIII will be fought but WWIV will be fought with sticks and stones-Albert Einstein
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 4th Feb 2009 06:00
Loops:

An FPI script is executed every loop of the game. If your game is running at 30 fps, then the script is executed 30 times a second.

If statements:

Each line of an FPI script IS an If statement.

Take the following code as an example

In programming terminology, this would translate to


Arrays:

Impossible, but not usually needed.

Variables:

You can find tutorials on variables in the Official Community Guide, which you can find in a sticky in the FPSC Chat board.

Object Oriented Scripts:

No..... plain and simple.



Let's get this opened up, shall we? I don't like to refer to FPI as a "language". The script is not compiled, ever. It is interpreted by the engine during runtime. This means that you cannot declare things such as variables or classes. In the official version of FPSC, all of the variables are predeclared in the engine and are referenced by their "index" (a number), something I seriously dislike.

FPSC was written in DBP, a language that inherently is NOT Object Oriented, so it probably goes without saying that FPI will not be object oriented either.


You seem to be fairly familiar with programming, so here is my suggestion to you:

Stop using/Don't use FPSC. You are already at a point of understanding that you should be using a higher level tool to develop your games. In my eyes, FPSC is a learning tool for game development, to help people interested in the field get a handle on how things generally work in a game.

Since you are most familiar with javascript, I would suggest C++ or pure Java to you. If you'd like something a little easier to help you get into game development, then try using C++ with the DarkGDK libraries offered here.


Good luck out there!


The one and only,


daarboven
16
Years of Service
User Offline
Joined: 20th Dec 2007
Location: right over there, see?
Posted: 4th Feb 2009 12:11
Quote: "Stop using/Don't use FPSC. You are already at a point of understanding that you should be using a higher level tool to develop your games. In my eyes, FPSC is a learning tool for game development, to help people interested in the field get a handle on how things generally work in a game."


Thanks for that reccomendation as well as your and Dar13's comprehensive explanation of FPI scripting.

This turns my thread in a more general direction of searching the right tool for game development-Let me put it this way:
As a Designer, i like the simplicity of Concept that rules FPSC; You design reusable objects and blocks, connect the objects to a set of actions which are independent of the objects (e.g. you can define a crate to be a character if neccessary). Most of the development process is made in the level editor itself-Avoiding the designers fear to have to write 50 lines of code just to put a simple box on stage.
The drawback of this is the limitation of sorts-Everything is made of tiles, giving the designer a hard time to have it look less generic. The Scripting language is fairly awkward in structure and syntax-I guess one could pull off some cool things with it but it would be a lot harder without the common tools of a language like LUA or Javascript(see first topic).

Conclusion: I think although it's lots'a'fun to quickly prototype a game level in FPSC especially when you don't have a clue how to make the gamecore things like collission detection, camera scripting, guns, AI (applies to the author in the first place lol),
I would have to move on someday near.

That takes me to the point to ask if someone can recommend me a toolset that embraces designers with some coding experience?
My ideal pipeline would be some "Level editor" where i could import complete level geometry as well as single objects in any of the common 3d formats. (Ideally make the Level in sketchup, animated props in cinema4d). Then some scripting language in the difficulty level of JS or LUA and a friendly interface to connect scripts to objects (a behaviour editor?).
How about DarkGame Studio? is it worth while in the scope of my requirements?

(Sorry for the longish posting but ply's reply somehow put the finger on it...)

I am Jacks complete lack of surprise.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 4th Feb 2009 12:36
Leadwerks?

Didn't get a chance to play with it a lot so I don't know of it's simplicity of use, but it's very capable as an engine to work off of.


The one and only,


daarboven
16
Years of Service
User Offline
Joined: 20th Dec 2007
Location: right over there, see?
Posted: 4th Feb 2009 12:59
I'll have a look at it...Thank you!

I am Jacks complete lack of surprise.

Login to post a reply

Server time is: 2024-11-24 18:19:22
Your offset time is: 2024-11-24 18:19:22