Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

One technical question. Let's say that i write object definition as : 

cat_lump : scenery "YELLOW FURBALL" msg = "SOME TEXT" ;

So "cat_lump" is just a tag identifier for object. But it seems the engine uses this when writing "get lump". When i write "get furball" or "get yellow" the engine does not recognize any of these two words. Then "YELLOW FURBALL" is just a description text visible in scene but it is not used by engine when parsing get/take commands?

As you have discovered, the object id consists of an (optional) adjective followed by a noun and it is preferable that these are the same as the object description, so "cat_lump" should be "yellow_furball". You can use the vocabulary{} block to define synonyms for furball. I'm sure Adventuron can explain this better than I can.

Yes, the text in the quotes is just narrative only. 

The id of the object is a shorthand for the associated adjective and noun, but specifying explicit adjective and/or noun will override this behaviour. 

You can also switch off this entity_id association in the game_settings {} section, but it is on by default, and I think it's a sensible default.

objects {
   noun              : scenery "anytext";
   adjective_noun    : scenery "anytext";
   anything_you_line : scenery "anytext" noun="lump" adjective ="yellow";
}

You can't specify multiple nouns or multiple adjectives per object, but you can create noun groups and adjective groups that the parser will automatically collect together:

vocabulary {
   : verb      / aliases = [pet, stroke]
   : noun      / aliases = [cat, creature, feline]
   : adjective / aliases = [yellow, golden]
}

In the : match "" {} section, you can use any item in a noun group to match on, and it will treat it the same as any other member of the group. That is : match "stroke cat" {} is exactly the same as : match "stroke feline" {}, the player could type STROKE CAT, or STROKE FELINE, or PET CAT, or PET FELINE, and it both these match statement would match all 4 of these inputs. 

If you want a completely different noun to represent the same object, but the noun is not a synonym, then you can also chain together nouns in match statements like this:

// You may not want to put "lump" as a synonym for cat, therefore you can just list it as a different match item

: match "stroke cat; stroke lump" {
   : print "Cat Purrs."
}

I'll be using questions in this thread to bolster the documentation so thank you for reminding me I need to improve this.

Both of you thanks. Very usefull to know this. :-)