[carceri-dev] A little rant and data

  • From: Kornel Kisielewicz <charon@xxxxxxxxxxxx>
  • To: carceri-dev@xxxxxxxxxxxxx
  • Date: Thu, 02 Jun 2005 21:08:57 +0200

Okay, seems like I have everyone here that I wanted ;-)

For your information there are three (excluding myself) subscribers now 
-- ABCGi, Ilya Bely and Igor Savin.

   Currently this list will probably be low-traffic (especialy that some 
of us have exams now) but I hope that in the future this list will 
become for Carceri what gearhead_dev is for GearHead. As for my activity 
on Carceri itself it will be very low the next three weeks -- I have 
three exams -- on the 13th, 16th and 20th of June. Still, I know myself, 
so probably I will be coding Carceri when I will be pressed by the 
deadlines at most :-). Afterwards probably between 5th and 24th of July 
I'll probably be on vacation. But after that the  hardcore development 
will start ;-).

   Anyway, to go back on topic -- here's an example of how the Carceri 
Data File format looks like. It is still beta, so changes in the way it 
looks can be made without problem, so I await your commens. "//" are 
comments after which I provide explanations.

   Let's take a tile (cell) for example:

TILE "st_closeddoor" [st_wall] ( // the data type "TILE", id:"st_closeddoor
                                // in the square brackets we have 
inheritance
 Name        : "closed door";   // self-explanatory
 LightColor  : #brown;          // This should be a number, but the 
engine supports
                                // pre-defined constants, and resolves 
them at run
                                // time.
 Picture     : '+';             // characters are in '' quotes, strings 
in ""
 ActivateTo  : @st_opendoor;    // "@" sign denotes a reference to 
another object
 ActivateMsg : "You open the door.";
 BloodTo     : 0;               // This would be a reference to what the 
tile changes
                                // if blooded over
 flags       : [tfBlockMove | tfBlockSight | tfOpenable];
                                // set of flags.
)

Another one, without comments:

TILE "st_stairup" [st_floor] (
 Name        : "stairs leading upwards";
 LightColor  : #yellow;
 Picture     : '<';
 ActivateTo  : @st_stairdown;
 ActivateMsg : "You climb upwards.";
 BloodTo     : 0;
 Flags       : [ tfStairUp | tfNoChange ];
 OnEnter     : $onenter_stairs;
)

The new thing here is the OnEnter field. Fields starting with On are 
script hooks. Variables starting with "$" are references to Lua 
functions. This example is artificial, for the stairs do not need any 
"OnEnter" script tough.

There are more fields in a TILE type data, but the rest are inherited 
from st_wall. If not present, the system tries to guess reasonable 
defaults.

FORWARD "st_bloodycorpse"
NPC "wolf" (
 Name        : "wolf";
 Picture     : 'w';
 Color       : #lightgray;
 SpeedMove   : 50;
 Corpse      : @st_bloodycorpse;
 HitPoints   : 2;
 OnDie       : $ondie_wolf;
)

In the above data we see a special type called "FORWARD". It is needed 
because st_bloodycorpse is defined later. The data here is pretty random 
and simple tough ;-).

Any comments, questions, suggestions? I have a nice syntax coloring for 
this data in Texturizer. I can post the whole current data file if 
anyone is interested.

-- 
At your service, 
Kornel Kisielewicz (charonATmagma-net.pl) [http://chaos.magma-net.pl]
"The development cycle for roguelikes never ends..." -- Joseph 
Hewitt

-- 
Carceri Development Mailing List (carceri-dev@xxxxxxxxxxxxx)
Carceri Homepage (http://chaos.magma-net.pl/carceri)

Other related posts: