The Secret is Out
Posted: Mon Jun 05, 2006 3:17 pm
OK, I will explain what I have been so hush hush about lately. I won't explain it in great depth, but I will gladly answer any questions you post about it.
In RF2, the scripting language is Python. ( http://www.python.org ) A scripting api consisting of multiple modules all beginning with 'rf', such as rfsetup, rfsound, and so on organizes the engine methods into various modules for easy, optimized scripting.
I can hear you saying, "Oh, great, it may mean my monster scripts are broken but it will also mean greater flexibility in Pawn scripting!
It's not only for Pawns anymore, folks.
Almost all areas of RF2 are controllable by script. RF Pretty much consists of code to run one script at start up, named 'setup.py', then create a main window, then run another script and be done with it. In this setup.py script, only the rfsetup module is available for use, which contains methods to set startup stuff, like resolution, windowed/fullscreen, etc. After that, it creates a main window using those parameters. (If the script is not found, or some values are not set, it uses default, hard-coded parameters for those values.)
Now, within these scripts, you have full control of the python language. Heck, if you so desire, you can do some pretty cool stuff, like creating a window the user can use to pick a resolution, driver, etc. with.
Next, it looks for another file. The name of that is not decided yet, but it will most likely be called 'bootstrap.py' or 'start.py'. In that script, and scripts linked to it, you will handle everything that goes on in your game, having full access to the rf engine api to do whatever you want. No more messy Pawn scripting for weapons hacks, no more scripted players, no more games held together by a player in a hollow, unlit box (anyone remember doing that to make a racing game or something similar?). If you want to change the player, just open the player script. It's that simple.
Likewise, the menu is not hardcoded, so if you want things like custom settings in the menu (selectable spraypaint image ala Half-Life anyone?) you are perfectly free to do so.
Best of all, no more trying to find the one archaic compiler that manages to compile RF1 successfully, along with a stale version of DirectX, etc. Not that those things would be a problem with RF2 anyway - hey, I can't find a compiler that WON'T compile it! - but it's still nice to know recompiling is not necessary.
I can hear everyone yelling at me by now. "THATS WHAT RF IS ALL ABOUT, YOU ONLY NEED SCRIPTING FOR ENEMIES! WHAT ARE YOU DOING TO RF?!?!?!!" Don't worry. RF2 comes acting and looking almost identical to RF1. Everything is pre-scripted for your click-and-create, red-eyed, it's-midnight-but-I'm-addicted enjoyment. Everything works almost identically to RF1 out of the box. If you don't want to script, then don't. You don't have to. But the flexibility is there, and I know one of these days you'll go "Hmm, I wish my player could go prone... HEY, he said it was controlled by scripts! Heres player.py... Hmmmmm...".
This introduces the concept of ScriptSets. ScriptSets are, shockingly enough, sets of scripts. These sets of scripts can change the functionality of RF entirely. One, and the one that ships with RF2, makes RF2 behave almost exactly like RF1. Another can make RF2 behave like Final Fantasy. They are a bit like Game Boy cartridges; they share a common interface, but they can change the functionality dramatically.
Entities are all scripted. You can easily add a new entity, too, just by scripting it (or copying it out of a scriptset you like!)
I hope you enjoy, feel free to comment, and God bless.
In RF2, the scripting language is Python. ( http://www.python.org ) A scripting api consisting of multiple modules all beginning with 'rf', such as rfsetup, rfsound, and so on organizes the engine methods into various modules for easy, optimized scripting.
I can hear you saying, "Oh, great, it may mean my monster scripts are broken but it will also mean greater flexibility in Pawn scripting!
It's not only for Pawns anymore, folks.
Almost all areas of RF2 are controllable by script. RF Pretty much consists of code to run one script at start up, named 'setup.py', then create a main window, then run another script and be done with it. In this setup.py script, only the rfsetup module is available for use, which contains methods to set startup stuff, like resolution, windowed/fullscreen, etc. After that, it creates a main window using those parameters. (If the script is not found, or some values are not set, it uses default, hard-coded parameters for those values.)
Now, within these scripts, you have full control of the python language. Heck, if you so desire, you can do some pretty cool stuff, like creating a window the user can use to pick a resolution, driver, etc. with.
Next, it looks for another file. The name of that is not decided yet, but it will most likely be called 'bootstrap.py' or 'start.py'. In that script, and scripts linked to it, you will handle everything that goes on in your game, having full access to the rf engine api to do whatever you want. No more messy Pawn scripting for weapons hacks, no more scripted players, no more games held together by a player in a hollow, unlit box (anyone remember doing that to make a racing game or something similar?). If you want to change the player, just open the player script. It's that simple.
Likewise, the menu is not hardcoded, so if you want things like custom settings in the menu (selectable spraypaint image ala Half-Life anyone?) you are perfectly free to do so.
Best of all, no more trying to find the one archaic compiler that manages to compile RF1 successfully, along with a stale version of DirectX, etc. Not that those things would be a problem with RF2 anyway - hey, I can't find a compiler that WON'T compile it! - but it's still nice to know recompiling is not necessary.
I can hear everyone yelling at me by now. "THATS WHAT RF IS ALL ABOUT, YOU ONLY NEED SCRIPTING FOR ENEMIES! WHAT ARE YOU DOING TO RF?!?!?!!" Don't worry. RF2 comes acting and looking almost identical to RF1. Everything is pre-scripted for your click-and-create, red-eyed, it's-midnight-but-I'm-addicted enjoyment. Everything works almost identically to RF1 out of the box. If you don't want to script, then don't. You don't have to. But the flexibility is there, and I know one of these days you'll go "Hmm, I wish my player could go prone... HEY, he said it was controlled by scripts! Heres player.py... Hmmmmm...".
This introduces the concept of ScriptSets. ScriptSets are, shockingly enough, sets of scripts. These sets of scripts can change the functionality of RF entirely. One, and the one that ships with RF2, makes RF2 behave almost exactly like RF1. Another can make RF2 behave like Final Fantasy. They are a bit like Game Boy cartridges; they share a common interface, but they can change the functionality dramatically.
Entities are all scripted. You can easily add a new entity, too, just by scripting it (or copying it out of a scriptset you like!)
I hope you enjoy, feel free to comment, and God bless.