EarlyMorning - Buildscript Documentation

One suite to code them all. An complete IDE and assembler for all your z80 projects!

Moderators: benryves, kv83

Post Reply
User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

EarlyMorning - Buildscript Documentation

Post by kv83 »

This thread will describe the buildscript feature of EarlyMorning.

Data
Syntax:

Code: Select all

[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: Select all

[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: Select all

[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: Select all

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

Spritesheet

Code: Select all

[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: Select all

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

Code: Select all

[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: Select all

    [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: Select all

    [Sprites].*.[Data(Standard, Standard)]
    [Sprites].*.[Data()]
    [Sprites].*.[Data(,Standard)]
    [Sprites].*.[Data(Masked)]
Map

Code: Select all

[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: Select all

    [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: Select all

    [Maps].*.[Data(Standard, Standard)]
    [Maps].*.[Data()]
    [Maps].*.[Data(,ByObject)]
    [Maps].*.[Data(Flagged)]
Last edited by kv83 on Thu 05 Oct, 2006 7:36 pm, edited 5 times in total.
Image
User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

Re: EarlyMorning - Buildscript

Post by kv83 »

Comments
Syntax:

Code: Select all

;Data-expression
Examples:

Code: Select all

;[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
User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

Re: EarlyMorning - Buildscript

Post by kv83 »

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: Select all

#NewFile(filename)
filename should be the name of the file.

Examples:

Code: Select all

#NewFile(include.inc)
#For...#Next

Syntax:

Code: Select all

#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: Select all

#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: Select all

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

Examples:

Code: Select all

#:;(c) Vincent J.

#:tileData:

#:MapData:
Last edited by kv83 on Tue 29 Aug, 2006 10:12 am, edited 2 times in total.
Image
User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

Re: EarlyMorning - Buildscript

Post by kv83 »

Script Example

Code: Select all

#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
Last edited by kv83 on Tue 29 Aug, 2006 10:13 am, edited 3 times in total.
Image
User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

Post by kv83 »

placeholder
Image
User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

Post by kv83 »

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
Kozak
Maxcoderz Staff
Posts: 791
Joined: Fri 17 Dec, 2004 5:33 pm
Location: On the dark side of the moon.
Contact:

Post by Kozak »

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
User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

Post by kv83 »

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
User avatar
benryves
Maxcoderz Staff
Posts: 3089
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

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? :?
User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

Post by kv83 »

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
User avatar
benryves
Maxcoderz Staff
Posts: 3089
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

kv83 wrote:
benryves wrote:
kv83 wrote: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)
User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

Post by kv83 »

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
User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

Post by kv83 »

The Buildscript Documentation has been updated to include all features introduced by 0.3.0.0:
  • RLE compression for maps.
Image
Post Reply