MaxCoderz

for your 1 bit pleasure!

All times are UTC




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Thu 09 Feb, 2006 9:49 am 
Offline
Maxcoderz Staff
User avatar

Joined: Wed 15 Dec, 2004 7:26 pm
Posts: 2735
Location: The Hague, Netherlands
This thread will describe the buildscript feature of EarlyMorning.

Data
Syntax:
Code:
[Object].(Object.)[Variable]


[Object] = The Object in which contains the data
(Object.) = Optional. The index of the object you want to access
[Variable] = The data itself.

Examples:
Code:
[Sprites].[Title]
[Sprites].1.[Title]
[Original Levels].*.[Data]


[Objects]
The buildscript uses some kind of OO-language to indicate what data is needed. There are two types of "root"objects. Spritesheets & MapCollections. In EarlyMorning you give a name to those spritesheets and mapcollections. In the mapcollection you'll have to use that name to indicate which data you want.

If you created the SpriteSheet "Sprites" and you want to get the amount of sprites you have, you use for example:
Code:
[Sprites].[Amount]
Sprites is in this example the object.

(Object.)
Every map and sprite is handled as a Object in EarlyMorning. Every sprite/map object has it's own variabls, just like a spritesheet and mapcollection. A spritesheet is an object which contains several other sprite objects. If you want to access a sprite, you will have to indicate an identifier to tell EarlyMorning which sprite you are talking about. Note that EarlyMorning starts counting with 0.

If you want to display the title of the 2nd sprite (1) of the SpriteSheet "Sprites" you should do the following:
Code:
[Sprites].1.[Title]


[Variable]
All objects have a set of variables. Look below for a list of all variables.

Spritesheet
Code:
[Title]     : The title of the spritesheet.
[LastIndex] : The index of the last sprite within the spritesheet.
[Height]    : The height of the sprites.
[Width]     : The width of the sprites.


MapCollection
Code:
[Title]     : The title of the mapcollection.
[LastIndex] : The index of the last map within the mapcollection.


Sprite
Code:
[Title]     : The title of the sprite.
[Data]      : The spritedata. Data uses two arguments. See for more info below.
[Mask]      : Only the maskdata of the sprite.
[Height]    : Height of the sprite.
[Width]     : Width of the sprite.


    3.0.0.0 introduced a new way of getting the data by giving arguments. The syntax is as followed:
    Code:
    [Object].(Object).[Data(Format, Compression)]


    Format is the format of the data you want. The following formats can be used:
    • Standard
    • Masked (Interlanced)
    Compression is the compression-method you want to use.
    No compressions can be chosen at the moment

    Default is 'Standard' when no argument is given.

    Examples:
    Code:
    [Sprites].*.[Data(Standard, Standard)]
    [Sprites].*.[Data()]
    [Sprites].*.[Data(,Standard)]
    [Sprites].*.[Data(Masked)]
Map
Code:
[Title]     : The title of the map.
[Data]      : Data of the map.
[Length]    : The length of the map (H*W).
[Height]    : The height of the map.
[Width]     : The width of the map

    3.0.0.0 introduced a new way of getting the data by giving arguments. The syntax is as followed:
    Code:
    [Object].(Object).[Data(Format, Compression)]


    Format is the format of the data you want. The following formats can be used:
    • Standard
    • Flagged
    Compression is the compression-method you want to use.
    • Standard
    • ByObject
    • RLE
    Default is 'Standard' when no argument is given.

    Examples:
    Code:
    [Maps].*.[Data(Standard, Standard)]
    [Maps].*.[Data()]
    [Maps].*.[Data(,ByObject)]
    [Maps].*.[Data(Flagged)]

_________________
Image


Last edited by kv83 on Thu 05 Oct, 2006 7:36 pm, edited 5 times in total.

Top
 Profile  
Reply with quote  
PostPosted: Thu 09 Feb, 2006 10:09 am 
Offline
Maxcoderz Staff
User avatar

Joined: Wed 15 Dec, 2004 7:26 pm
Posts: 2735
Location: The Hague, Netherlands
Comments
Syntax:
Code:
;Data-expression


Examples:
Code:
;[Sprites].[Title]
;[Sprites].1.[Title]
;[Original Levels].*.[Data]


To comment something you can just use a ";" before the line. This can be handy for reference.

_________________
Image


Top
 Profile  
Reply with quote  
PostPosted: Thu 09 Feb, 2006 10:23 am 
Offline
Maxcoderz Staff
User avatar

Joined: Wed 15 Dec, 2004 7:26 pm
Posts: 2735
Location: The Hague, Netherlands
Commands

#NewFile()
NewFile() is used for starting a new include file. This statement should be used at least once in your buildscript, otherwise no include file will be created.

Syntax:
Code:
#NewFile(filename)


filename should be the name of the file.

Examples:
Code:
#NewFile(include.inc)


#For...#Next

Syntax:
Code:
#For X to Y
...Code block...
#Next


X should be an integer.
Y can be an integer or an data-expression. If Y is an data-expression, use a $ before the data-expression

Within the code block, you can use a "*" to use the current-value of the For-loop.

Examples:
Code:
#For 0 to 10
;[Sprites].[Title]
#Next

#For 1 to $[Sprites].[Amount]
;[Sprites].*.[Title]
[Sprites].*.[Data]
#Next

#For 0 to 2
;[Levels].*.[Title]
[Levels].*.[ByObject(Data)]
#Next


Note that you can't use more than one loop at a time.

#End
The "#End" command is used for ending the file.

Examples:
Code:
#End


#:
The "#:" command is used for plotting text directly to the file. This could be used for using labels.

Examples:
Code:
#:;(c) Vincent J.

#:tileData:

#:MapData:

_________________
Image


Last edited by kv83 on Tue 29 Aug, 2006 10:12 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
PostPosted: Thu 09 Feb, 2006 10:27 am 
Offline
Maxcoderz Staff
User avatar

Joined: Wed 15 Dec, 2004 7:26 pm
Posts: 2735
Location: The Hague, Netherlands
Script Example
Code:
#NewFile(include.inc)

#:;Spritesheet - TileData
#:TileData:
#For 0 to $[TileData].[LastIndex]
;[TileData].*.[Title]
[TileData].*.[Data(Standard, Standard)]
#Next

#:;MapCollection - MapData
#:MapData:
#For 0 to $[MapData].[LastIndex]
;[MapData].*.[Title]
[MapData].*.[Data(Standard, Standard)]
#Next

#End

_________________
Image


Last edited by kv83 on Tue 29 Aug, 2006 10:13 am, edited 3 times in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu 09 Feb, 2006 10:28 am 
Offline
Maxcoderz Staff
User avatar

Joined: Wed 15 Dec, 2004 7:26 pm
Posts: 2735
Location: The Hague, Netherlands
placeholder

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu 09 Feb, 2006 10:33 am 
Offline
Maxcoderz Staff
User avatar

Joined: Wed 15 Dec, 2004 7:26 pm
Posts: 2735
Location: The Hague, Netherlands
As you can see I managed to make a first version of the script building engine. Here above is the documentation for this. Of course this can and propably will change. Most surely in terms of amount of possibilities. Think in terms of more variables, more compressed variables and more commands. If you have any good ideas feel free to submit them in this thread.

Note that I was able to succesful build a include file for the GrayScale Slippy - project. :D

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 17 Feb, 2006 1:34 pm 
Offline
Maxcoderz Staff

Joined: Fri 17 Dec, 2004 5:33 pm
Posts: 790
Location: On the dark side of the moon.
But I still don't know how the file should be named...buildscript.xml?

_________________
"They say that sea was created by a man named Maarten Zwartbol, a long time ago...." - Duck, an old Corbin version


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 17 Feb, 2006 3:23 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Wed 15 Dec, 2004 7:26 pm
Posts: 2735
Location: The Hague, Netherlands
Kozak wrote:
But I still don't know how the file should be named...buildscript.xml?
Oops. It should be buildscript.txt and in the same folder as your EM .xml file :)

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 17 Feb, 2006 3:31 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
kv83 wrote:
Kozak wrote:
But I still don't know how the file should be named...buildscript.xml?
Oops. It should be buildscript.txt and in the same folder as your EM .xml file :)
Are you going to decide on an EM extension, or are you going to stick with the vague and generic .xml extension? :?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 17 Feb, 2006 3:52 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Wed 15 Dec, 2004 7:26 pm
Posts: 2735
Location: The Hague, Netherlands
benryves wrote:
kv83 wrote:
Kozak wrote:
But I still don't know how the file should be named...buildscript.xml?
Oops. It should be buildscript.txt and in the same folder as your EM .xml file :)
Are you going to decide on an EM extension, or are you going to stick with the vague and generic .xml extension? :?
Next version will have use a .emf extension. (Happy? :P)

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 17 Feb, 2006 4:02 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
kv83 wrote:
benryves wrote:
kv83 wrote:
Kozak wrote:
But I still don't know how the file should be named...buildscript.xml?
Oops. It should be buildscript.txt and in the same folder as your EM .xml file :)
Are you going to decide on an EM extension, or are you going to stick with the vague and generic .xml extension? :?
Next version will have use a .emf extension. (Happy? :P)
Yes! :D Now I can work on the Latenite->EM interface (Happy? :P)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue 29 Aug, 2006 10:31 am 
Offline
Maxcoderz Staff
User avatar

Joined: Wed 15 Dec, 2004 7:26 pm
Posts: 2735
Location: The Hague, Netherlands
The Buildscript Documentation has been updated to include all features introduced by 0.3.0.0:
  • In Data, all variables called [Amount] were renamed to [LastIndex]
  • In Data, Spritesheet have now the [Height] and [Width] variables
  • In Data, Maps have now the [Height], [Width] and [Length] variables
  • In Data, Sprites have now the [Mask] variable
  • In Data, Sprites and Maps have now [Data] variable with arguments
  • In Commands, #NewFile() is now available
  • ScriptExample has been changed.

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu 05 Oct, 2006 7:37 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Wed 15 Dec, 2004 7:26 pm
Posts: 2735
Location: The Hague, Netherlands
The Buildscript Documentation has been updated to include all features introduced by 0.3.0.0:
  • RLE compression for maps.

_________________
Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB ® Forum Software © phpBB Group | DVGFX2 by: Matt