Re: developing a singular verses plural grammar system in your game

Hi,
I have spent some time tackling this in both Python and Dart.

I wrote it a while ago, and I've used both packages in my own projects.

Looking at the Python version, it's code is fairly outdated, and massively under-documented, which I'm in the process of fixing.

The general idea is you have a social factory, which you can add suffixes to. The PopulatedSocialsFactory class already has the common ones, and you can add others with the suffix decorator.

Each suffix takes 2 arguments: The object being worked (which will depend on your use case), and the textual name of the suffix. This is because you could have "n" and "name" doing the same thing.

It should return a tuple of 2 items: The first being the text that should be sent to the object which is running the social, and the second to everyone else.

For example:

"%1N %1has gained 14 gold from %2n."

Assuming a n (lower case) suffix which returns the name of the object, and the has / have suffix which is already defined. Also, 2 objects (%1 and %2): "Bill" and "Jane".

This would yield 3 strings: The string to send to Bill, the string to send to Jane, and the string to be sent to all other bystanders.

I appreciate this isn't the most complete overview in the world, and I'm going to work to bring the project into the 21st century, but it does work, and I'm more than happy to receive emails asking for help while I write up documentation and the like.



-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : visualstudio via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector

Reply via email to