Unity

Unity - The DarkBASIC Scripting Pack

The Unity scripting pack takes your DarkBASIC Professional games to the next level. Unity marries the commercially used Lua scripting language with DarkBASIC Professional.

What is Unity?

Unity is a Third Party Command set that allows your DarkBASIC Professional games to utilise the Lua scripting language in your games. Lua has been used in the games industry for years - and its users include, but are not limited to:

  • Blizzard - Warcraft III
  • Bioware - Baldur's Gate
  • Lucasarts - Grim Fandango
  • Crytek - Far Cry
  • Sierra - Homeworld 2
  • Electronic Arts - Various Projects

The industry has been using it for years - now it's your turn. The uses of Unity are not limited to scripting. The plugin can also be used to:

  • Load structured files (for example save games) quicker and easier than before
  • Replace DarkBASIC Professionals arrays - Lua provides you with arrays that grow, shrink, order and shuffle on demand. You can also use strings as array keys, instead of just numbers
Learn about Unity

Click a link to jump to that section:

Beginner - What is scripting?
Intermediate - How do I use the plugin?
Advanced - What are the technical specifications?

What is scripting?

In most games, all media (for example, textures and models) are located outside of your program file. Normally only game logic is held within the actual EXE file. By using scripts, you can abstract core game logic and actions, such as the code that makes a noise when a certain level is loaded, or code that makes a certain character speak when you start the game, and place these pieces of logic in text files, called scripts, outside of your main application. When you're ready to use that bit of code, you simply load the script and the code is executed.

As an example, consider when you load a level. In some cases you may want a cut-scene to play, in others you may want a voiceover to sound, or perhaps you may want the player to only start with a certain weapon. If you coded this game with standard procedural code you would end up with a lot of IFs or similar conditional statements in your code - and things would quickly spiral out of control. Wouldn't it be easier to have a simple script file that loaded and executed when the level starts? Something like the following:

PlayCutscene("lev-03")
GiveWeapon(Player,Guns["AK47"])

Right now this might sound like something you could achieve using functions and external DBA files in DBPro - the difference is that Lua is an entire language all in itself. Designed from the start to be a tiny and simple language it offers programmers extensibility. Lua scripts run in a safe environment, have automatic memory management, and powerful string and dynamic data handling features. Consider it a 'glue language', allowing a component-based approach to development. Although a simple language in structure, it is a very powerful one. Offering: advanced data-types, a fully threaded environment, arithmetic/relational and logical operators, concatenation, control structures, functions, iterators, very powerful array handling, matrices, linked lists, queues, string buffers, data serialisation, metatables and object orientated programming functionality (classes, inheritance, multiple inheritance, and privacy).

This is a small taster of the power of scripting. There is an excellent article on Lua on the Gamedev.net web site here, and we'd recommend you read it if still not convinced about its usefulness.

How do I use the plugin?

Using Unity couldn't be easier. Simply use the command LOAD LUA, and your script will be loaded and executed. There is no need to initialise the scripting engine first.

You don't have to use scripts however - you can also take advantage of Lua's powerful data storage engine. This can be started and used simply by calling a command such as LUA SET STRING straight off - Unity will sort out any initialisation that needs to be done for you.

No external DLLs are required, so all you need to distribute is your game EXE file and any relevant media and scripts.

What are the technical specifications?

Unity fully implements the new and updated Lua 5.0 language.

    Lua 5.0
  • Fast loading, compilation and execution of code
  • Flexible PHP style arrays
  • Automatic memory management and garbage collection
  • All File IO, Mathematical and Core command libraries integrated with the plugin
  • Multi-threading via Lua co-routines
  • Support for object orientation
    The plugin
  • 25 new commands
  • Full support for directly reading and writing to Lua variables
  • Full access to the contents of Lua arrays
  • Call functions written in Lua from your DarkBASIC Professional games
  • Access the 3D DarkBASIC world directly from your scripts
  • Ability to load compiled scripts or scripts as text files - using just one command
  • Innovative message queue system for Lua to/from DBPro communication
  • Full keywords list and help files with example code for each command
  • Full tutorials included to help you get started
Special Offers

There are currently no special offers containing this product.

Order Now
Unity

The Unity scripting pack takes your DarkBASIC Professional games to the next level.

  $ Dollar € Euros £ Sterling Click to Buy
Price: $20.00 €15.99 £13.99 Click here to buy

Unity is distributed electronically.
You must download this product. Download instructions are sent after purchase.