project-navigation
Personal tools

Author Topic: Structure of the system: The scripts???  (Read 4230 times)

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Structure of the system: The scripts???
« on: August 15, 2009, 01:27:44 am »
I have taken a bit of a look around, and as far as I can tell, the compiled code is just an engine. The actual what's-happening is driven by the scripts.

But I'm completely lost when it comes to what's what, and what's the main(), of the scripts.

So, simply enough: What's the setup/structure of the scripting system?

Offline bayo

  • Professional loser
  • Project Coder
  • Captain
  • ***
  • Posts: 733
    • View Profile
Re: Structure of the system: The scripts???
« Reply #1 on: August 16, 2009, 04:08:33 pm »
I dont know what script you talk about, but .ufo are declarative scripts (like an XML document for example). It only define game content. Then there is no main().

All .ufo files into /base/ufos are load and according to the block type it execute the right block reader. The reader will update internal game data with the content of the block. Maybe sometime we use bipass reader (not sure about that).

Code: [Select]
blockType someTimeWeHaveDataHereToo
{
     blockContent
}

For example, the block type "alienteam" is read by CL_ParseAlienTeam.

Then the the game is executed, and script are no more read.