Object Slots

Tutorials for game development.
Post Reply
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Object Slots

Post by Zefz »

Objects in Egoboo modules are fairly simple, once you know a few little things about them. This topic will attempt to describe the basics of how this works to give the necessary background information.
NOTE: This needs to be updated with the introduction of the new object loading system.

Two major concepts:

Modules basically contain two major parts related to objects: An "objects" directory which contains all the possible objects for that module, and a spawn.txt file, directing Egoboo where to put these objects.

Factories:

The main thing to remember is that the "Objects" directory is used like a factory, to create objects in the module. Having just an object folder in the "objects" directory will do pretty much nothing unless it's also being spawned.

Each object directory (ex: sword.obj) contains several files, but the important one as far as modules are concerned is "data.txt". This file has a "Slot Number" as it's first entry. This is how the spawn file refers to any particular object. Each object must have a unique ID in the ranges of 36 to 255. (NOTE: I am not positive of the upper limit)

The first 36 slots are reserved for importing of characters. Since Egoboo supports 4 Hero's (Players) at a time, each Hero can have 8 items. 0 would be player one, and 1 through 8 would be his/her items. 9 would then be player 2, and so on.

If an object has a conflicting Slot Number, egoboo will exit immediately because it will not be able to tell them apart.

Whenever an object is manually copied into a different module, the "Slot Number" must be unique. The module editor EgoMap does this automatically if an object is imported from inside the editor.

Spawning:

The file "spawn.txt" is used to create objects. It use's the object's Slot Number to figure out which object to spawn, and makes an instance of it at the positions specified (in "spawn.txt").
Post Reply