UFO:Alien Invasion

Development => Newbie Coding => Topic started by: keybounce on August 15, 2009, 01:27:44 am

Title: Structure of the system: The scripts???
Post by: keybounce 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?
Title: Re: Structure of the system: The scripts???
Post by: bayo 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.