Friday 25 September 2015

The you

Message pools are divided roughly for the player and other creatures which most commonly trigger a message. The problem with the second noun of a message is that it can be a creature or player, but when the name is constructed from the € and replaced with some name, it is "the you" if the target is the player. You could add "the" with creatures and only "you" with player.

How you do that is another problem. It's good that I haven't got far in the refactoring process, because I think the second noun could always be a game object. It means that rather than passing the noun as a string you should pass it as a game object. Then you can check in the actual text process routine for the type of the game object. The object name can be also a named object. It means mostly creatures who have a job, something like "Darren the shopkeeper".

The second noun could be indeed the target. The first noun is some game object and it should be also passed as a game object, since it can be that shopkeeper. If I wanted to go deep I could create a verb object that chooses from forms between for example "hit" and "hits" for player or npc, but let's not go in there. But it would likely mean that only one message pool would be required for both player and non-player characters.

No comments: