Feature #17
Support for object containers
| Status: | New | Start: | 10 June 2009 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | Editor | Spent time: | - | |
| Target version: | V0.1.0 | |||
Description
Objects such as a 'treasure chest' should be able to hold other objects, such as a 'key'. The editor needs to be able to support this behaviour so that in the game if the treasure chest was opened, the player could then retrieve the key from inside.
History
Updated by Ross Forshaw 456 days ago
Derek Stobbs wrote:
Objects such as a 'treasure chest' should be able to hold other objects, such as a 'key'. The editor needs to be able to support this behaviour so that in the game if the treasure chest was opened, the player could then retrieve the key from inside.
This should be fairly simple to do.
A class would be created that inherits Entity probably named Chest. It would then have have a pointer that points to an Entity that the "chest" is holding.
{
classname "chest" //create object of class type chest
targetname "TheBigChest" //unique identifier of this chest
target "key1" //Points to Entity named key1
target "key2" //Points to Entity named key2
}
{
classname "key" //create object of class type key
targetname "key1" //unique identifier of this key entity
target "door1" //Points to Entity named door1
}
{
classname "key" //create object of class key
targetname "key2" //unique identifier of this key entity
target "TheBigDoor" //Points to Entity named TheBigDoor
}
As from the example the "chest" targets 2 Key entities, named key1 & key2. The keys themselves target particular doors that they can open.
Updated by Derek Stobbs 456 days ago
I think 'target' is too ambiguous though. In one example it means 'contains' and the other it means 'opens'.