Request: add local features to _() and playerData

For AI and campaign script related discussions and questions
Post Reply
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Request: add local features to _() and playerData

Post by aubergine »

_() currently assumes the language of the human player on the same client machine

In order to allow scripts to send translated text to other players in an MP game, could an optional locale param be added to the function?

Syntax becomes:

_(string[,locale])

Where locale defaults to the locale set on the client machine.

The playerData objects would get a new .locale property. This will then allow scripts to chat with players in their chosen language.

I assume this will require additional info to be sent via net code at the start of a game so I wouldn't expect this in the 3.1 branch, but would be great if it could be added for 3.2 branch.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
stiv
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 876
Joined: 18 Jul 2008, 04:41
Location: 45N 86W

Re: Request: add local features to _() and playerData

Post by stiv »

Sending message IDs would seem simpler.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Request: add local features to _() and playerData

Post by aubergine »

If it was just for "AI --> AI or Human" messages, that would be fine. But in the case of "Human --> AI" messages it's problematic because the human won't know all the message IDs to use.

I want human to be able to chat to my AI in an easy manner, using words they are familiar in their language (+ basic English which I assume is more common in MP games?). By knowing their language I could create a prototypal stack that would look for words in their language (or check against English failing that).

I created a similar system in a Flash-based chat app several years ago - it's surprisingly effective, so long as you know what language the other person is likely to speak.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Post Reply