Posted by Data in Cortex Command - July 28th, 2008

Area EditorAfter many months of work and preparation, we are finally ready to start creating the real campaign missions! There were several large hurdles that needed to be cleared before we could proceed with this, including:

  • Exposing almost all of the C++ engine to Lua, using LuaBind.
  • Adding a powerful in-game console for testing and debugging scripts.
  • Making the game Activites’ logic be completely driven by Lua scripts.
  • A new and flexible data-driven system of trigger “Areas” in each Scene, which the scripts can hook into.
  • Making a completely new in-game editor for defining and naming the Areas of each Scene: The Area Editor —->.

The scripting of Activities is super important; before their logic could only be hardcoded in C++. That meant the whole executable had to be recompiled each time a change was made to the winning condition or whatever of a specific mission. Now, the script can be edited (by you!) while the game is running, and it is just reloaded automatically when Ctrl+R is pressed. Any errors encountered in the script will be reported to the in-game console, with line numbers and decent descriptions.

Here’s an example of how the Areas tie into the scripts. This snippet of Lua in your script’s UpdateActivity() function will cause any Actor that wanders into a specific Area named “Kill Zone” to be instagibbed:

for actor in MovableMan.Actors do if SceneMan.Scene:WithinArea("Kill Zone", actor.Pos) then actor:GibThis(); end; end;

We are also working on the online documentation for all of CC’s Lua interface – more on that later!

You can follow any responses to this entry through the RSS 2.0 feed.
Both comments and pings are currently closed.

1,152 Responses to “We are set for Campaign Production”

  1. Tomaster - # November 17th, 2009 at 9:57 pm

    I hate to break it to you, but you’re simply not well known. And as such, anything you say will be taken into account, and then promptly disregarded, and will not warrant a reply. So your plan will fail.

  2. badog001 - # November 20th, 2009 at 2:04 pm

    A few things. firstly, good luck on reaching 1337 posts. secondly, i was linked here by a DIFFERENT post which means its spreading like some kind fungus. a bit like the one they’re putting natural selection 2…