Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Can you have "sub-objects"?

A topic by Garry Francis created Oct 10, 2019 Views: 79 Replies: 2
Viewing posts 1 to 2
Submitted

Imagine you have something like a horse. The horse has a head and a tail and it wears a saddle. The head and tail are fixed to the horse (like scenery, but conspicuous = "false"). The saddle may be removed (like object). You want to be able to EXAMINE and describe these. As the horse can move around, it makes sense for the head, tail and saddle to be part of the horse. When defining start_at for the object, Ctrl+Space allows you to select an object, but if you do, you get an error saying, "Object is defined as starting inside other object "id:horse", but that object has not been defined as a container". You have been discouraging us from using containers, so is this sort of thing possible or not?

Submitted

I'm not actually using a horse. This is just an example. I gave the horse container_type = "surface" and examined the things on the horse and they weren't visible. I then tried container_type = "bag" and again they weren't visible. So it looks like I have to do it the hard way, i.e. can't use examine_message, but must use something like:

: match "examine saddle" {
   : if (is_present "horse") {
      : print "Description of saddle.";
      : done;
   }
}

Actually, that doesn't look so bad. Getting it is a bit messier, though.

Host

Containers are not there yet. Sorry. Your workaround looks good to me.