Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hey Stella! Reiterating the question from the Discord, how would I go about implementing Smart Barks for a character whose character key is a variable? Thanks in advance!

So there's a few approaches I would consider here:

Approach 1: Duplicate the dictionary for the character and the aliases the character has.  This is lazy, but as long as none of the aliases overlap with other characters, (eg. Multiple people with a name that is exactly "???") it will work.

Approach 2: If the character name is an input, if the name variable is created before the dictionary, it should be usable as the key to the dictionary whenever it is called.   This is what you'd want to do if you have a situation where the character's name is customizable.

Approach 3: The hard but probably right way:  You'd need to extend smart barks by creating a secondary dictionary.

So you'd have 1 dictionary that would be (psuedocode)

A dictionary named nicknames


KEY(The name used)->VALUE(What the character is referred to in the original Smart Barks dictionary)

Fred-> Fred

Frederick - > Fred

Freddy - > Fred

??? -> Fred

Jim -> Jim

James -> Jim

Jimothy -> Jim

Jimbob-> Jim

???? -> Jim

Then you'd need to insert a dictionary lookup into the original smart barks code, so that it references that dictionary, and then sends the value into the original set up.  The end result is that whether you use Fred or Frederick or Freddy, it will return Fred instead from the other dictionary.  Same for Jim.

I can probably include this functionality in the future, if you're patient.  I'm currently absorbed in a number of other projects and planned on coming back to this after May