NODE Documentation | Script Reference | Screenshots

NODE version: 1.2.4 build 0068

Last changed: 12.06.2006


Contents

1. General
1.1. Directives
1.2. Commands and showers
1.3. Comments

2. MND Script
2.1. Single-values
2.2. Default value
2.3. Multi-values
2.4. Coordinates
2.5. Command parameters
2.6. Target, shower and local area
2.7. Timing
2.8. Nested projects

3. Directives Reference
3.1. @@C - Set Project Caption
3.2. @@T - Set Project Time
3.3. @@R - Set Project Resolution

4. Commands Reference
4.1. @C - Fill with Color
4.2. @I - Show Image
4.3. @S - Render Scene Frame(s)
4.4. @D - Render Project Frame(s)
4.5. @M - Play Music
4.6. @T - Print Text

5. Parameters Reference
5.1. Blending modes
5.2. Wrapping modes


General

MND file contains directives and commands to describe project. Directives
describe static properties of project, and commands are used to animate
elements.

Directives

Directives are used to set some static, non-changable parameters of project.
They have form of:

@@X <parameters>

where X can be any letter.

Examples:
@@T 0:100
@@R 1600 1200

Commands and showers

Commands are used to tell NODE how to display and animate specific elements.
They have form of:

@X <mandatory-parameters> <optional-parameters>

where X can be any letter, mandatory parameters have to be present always, and
optional parameters can be omitted.

Each command creates one shower for that command. Shower is responsible for
interpreting parameters of commands and executing that command. Every command
has one corresponing shower type. There are exectly as many showers as there
are commands in the project script.

Example:
@C 0:300 $FF $FF $FF

Comments

Comments in scripts start with ; and last until the end of line.

Example:
@@T 0:300 ; this project starts at 0th and ends at 300th second

 

MND Script

Single-values

Most of the parameters for commands are floating point values. For each floating
point parameter there are two possible ways to specify its value:

* default value: ?
     - this denotes default value for parameter

* normal value: <number>
     - this is normal floating point or integer number

Numbers can be signed (have + or - before digits). Scientific notation (like
1.0E-3) is not supported for floating point numbers. Integer numbers can be
specified in hexadecimal notation when $ is written before hexadecimal digits.

Examples:
100
-0.5
$fA98

Default value

For all parameters which have default value, question mark (?) can be used
instead of that value.

For example, default project resolution is 800x600. So, instead of

@@R 800 600
you can write
@@R ? ?
or
@@R 800 ?
or
@@R ? 600

All four combinations will have exactly same final effect.

Multi-values

Multi-values are simple and powerful way to linearly animate almost any
parameter which is floating point value. In Command Reference section,
parameters which can have multi-values are marked with *.

Instead of a multi-value, you can always use single-value (default or normal).

Multi-value starts with [ and ends with ]. Between brackets, you specify
keyframes (much like keyframes in Lightwave) - time and value for each keyframe
in the form TIME:VALUE and you separate keyframes with commas. Here are some
simple examples:

[0:1, 10:5] means:
- at time 0, and before 0, parameter will have value 1
- at time 10, and after 10, parameter will have value 5
- between 0 and 10, value is linearly interpolated between 1 and 5, so,
at time 5, value of parameter is 3, because 3 is at the half between 1 and 5

You can also specify more than one keyframe:

[0:1, 10:5, 20:1]
[-20:1, -10:0, 0:1, +10:0, +20:1]

Note that time can be either ordinary floating point number or default value.
Default value of time for any keyframe is length of local time (see section
Timing for explanation of local time).

As for value of any keyframe, you can use any single-value (default or normal).

Multi-values can be repeated/looped. You can do this by putting ! after the
last keyframe and before ]. In this case, behavior of multi-value is repeated
after the last keyframe. So, if you have multi-value

[0:1, 10:5, 20:1 !]
then its value in 30s is same as value in 30-20=10s, in 40s it is same as in
40-20=20-20=0s. But when you have
[-10:0, 0:1, +10:0 !]
(which length is +10-(-10)=20s), then in 20s it's value will be same as value
in 20-20=0s, and in 30s value is same as in 30-20=10-20=-10s.

You can also specify when to begin repeatition by putting that time after !.
So, if you have
[0:0, 10:10, 20:20, 30:10 ! 10]
Then, in 50s, it will be 50s -> 50s-(30s-10s) -> 30s -> value 10

There is one more thing you can do with multi-value. Imagine that you want to
have value of some to be 1 from 0s to 10s and 2 from 10s to 20s. Something like:

[0:1, 10:1] combined with [10:2, 20:2]

As you can see, the only problematic place is 10s, where you have some kind of
jump from 1 to 2. It is possible to have this behaviour in easy way:

[0:1, 10:1:2, 20:2]

You can think of this as an abbrivation for two multi-values above. Note that
you can "combine" more than two multi-values:

[0:1, 10:1:2, 20:2:3, 30:3:4, 40:4]

Coordinates

All coordinates in project are relative to resolution in which project was
designed. So, if you use resolution 800x600, point at (400,300) actually
indicates center of the screen. More precisly, it indicates center of the area
of the screen to which project is rendered, called 'target area'. See section
Target, shower and local area for more detail.

Coordinates are relative to the upper left corner, which means (0,0) indicates
upper left corner of the screen.

Examples:

0 0 = left upper corner of the screen
400 300 = center of the screen
100 75 = 100th pixel horizontally, at the 1/4 vertically

Command parameters

Each command have mandatory and optional parameters. In this document,
optional parameters are those inside squared brackets. Mandatory parameters
must follow command name and time, and optional parameters can be entered in
any order.

At the time, one parameter can be entered multiple times in which case
behavior of the program will be valid but undefined.

Target, shower and local area

Target area is rectangular area on image (or screen) on which current project
is rendered in specific moment. Size and position of project target are changed
in these cases:

- at the beginning of each frame, target area is set to full screen
- parameter P of command @D denotes new target area
- parameter S of command @D sets proportions of target area

Target area is not limited to the size of image (or screen), it can be larger
in which case everything outside visible area is clipped.

Shower area is part of target area on which shower renders its command. Shower
area is not limited to target area, but only those parts inside target area
will be rendered, everything else will be clipped.

Local area is part of the source of the command which is rendered to shower
area. Usually, size of local and shower area are same. They differ in some
situations like when part of image (or whole image) is stretched to shower
area which means it's not anymore in original proportions.

Timing

Each project has its starting and ending time (these are set with @@T directive).
This tells range inside which are all times in project. This time is called
'project time'.

All commands in script have time which tells when they are "active". Outside
this range, commands are not being executed, and nothing is rendered (or heard,
in case of sounds). This time is called 'shower time'.

Shower times must fall inside project time, and for each command, starting time
must be less than or equal to ending time. Default value for shower starting
time is project starting time, and default value for shower ending time is
project ending time.

Inside one command for shower, all times are written in local time. Local time
for every shower is 0 at shower starting time and lasts for as long as shower.
For example, if shower time is 30:75, then its local time is 0:45 (45 = 75-30).

Examples:

; project time is 0:100
@@T 100

; shower time is 0:100, local time is 0:100
@I 0:100 background.jpg

; shower time is 45:100, local time is 0:55
@I 45:100 title2.jpg

Nested projects

Nested projects are powerful way to have animated images. The basic idea is to
have 'target image' and associated 'nested project'. Whenever you use target
image as a texture on object, in command @I, or in some other place, current
frame of nested project is rendered to that image. Current time of nested
project is determined as follows:

- if some project is rendered, then current time of that project is picked for
rendering
- otherwise, time since application started is picked as current time for
nested project rendering

Nested projects are created in following way: Let's say that we have image
called TEXTURE.JPG. Now, if we create project TEXTURE.JPG.MND, then contents of
this project will be used instead of image TEXTURE.JPG. After we create the
project, original image (TEXTURE.JPG) doesn't have to exist anymore. Also note
that image can be in any format, not only JPEG.

Target image rendered in this way can be used as any other image (all
properties of surface regarding way the image is rendered apply to it, all
parameters of command @I...). It is ordinary image like any other after it is
rendered.

Note that every target image is rendered only once per application frame. So,
if you have same target image used as a texture on two objects, it will be
rendered only once.

Also, be careful when using nested project because you can get strange effects
like in this situation:

=== NESTED.PNG.MND ===
; animate from black to red
@@R 800 600
@@T 10
@C 0:? [0:0, ?:255] 0 0
=== TEST_INNER.MND ===
; render nested project and show target image
@@R 800 600
@@T 10
@I 0:? NESTED.PNG
   P 0 0 800 600
=== TEST.MND ===
@@R 800 600
@@T 10
; left part of the screen: animate from black to red
@D 0:? TEST_INNER.MND
   T [0:0, ?:1]
   P 0 0 400 600
; right part of the screen: animate from red to black
@D 0:? TEST_INNER.MND
   T [0:1, ?:0]
   P 400 0 400 600

But, you will not get desired effect. Both left and right side of the screen
will animate from black to red because they use same target image (NESTED.MND).
To have correct behaviour, you will need to create NESTED2.MND. So, create
TEST_INNER2.MND and modify TEST.MND:

=== NESTED2.MND === (same as NESTED.MND)
@@R 800 600
@@T 10
@C 0:? [0:0, ?:255] 0 0
=== TEST_INNER2.MND === (almost same as TEST_INNER.MND)
@@R 800 600
@@T 10
@I 0:? NESTED2.PNG
   P 0 0 800 600
=== TEST.MND === (almost sam as original TEST.MND)
@@t 800 600
@@T 10
@D 0:? TEST_INNER.MND
   T [0:0, ?:1]
   P 0 0 400 600
@D 0:? TEST_INNER2.MND
   T [0:1, ?:0]
   P 400 0 400 600

 

Directives Reference

@@C - Set Project Caption

Usage
   @@C <caption>

Description
   This directive sets caption of the project. This caption is used
   when project is played directly in NORD.

Default value
   @@C <name-of-MND-file>

Example:

@@C "Frozen Lands"

@@T - Set Project Time

Usage
   @@T <endtime>
   or
   @@T <starttime>:<endtime>

Description
   This directive sets starting and ending time for animation. In the first
   case, when there is not <starttime>, it is assumed to be 0.

   Ending time must be greater than starting time.

   This directive is mandatory, and has to be set before any command in the
   script.

Default value,
   None. This directive is mandatory.

Examples

@@T 100
@@T -1:+1


copyright © 2002,2006 mindnever.org /// node.mindnever.org /// www.mindnever.org