I’m working on a persistent server that will have diferent languages avaliables. To help players understand each other in diferent languages, I’m thinking of a tool that will translate what ever a player says into the desired language using the onplayerchat event. My idea is using a custom Python program that checks data from a data base and send the text to translate to an API to translate, once received the translation, write it on the database and set it as msg in the chat message. ( I’ll need to introduce a delay so the process can be completed)
Well I won’t extent much more, I got stuck on reading content from databases created using NWN. Whenever I connect to the database and read the tables there, it says there is no table called “db”, but using online sqlite3 viewers I clan clearly see " Table : db" I need to solve that to be able to read the blob text in the table >.<
Anyone has any idea about how these databases are built? Or any useful tips,
check SIMTools, your idea was already implemented and without database
the original SIMTools was created for a NWNX plugin before the functionality of OnChat event was added into game, it was possibly never updated, but updating it onto 1.69/EE should be piece of cake
IIRC the reason it wasn’t updated was lack of the function to send specific player custom Chat command - but this can be now workarounded via PostString function if you don’t use NWNX which has this functionality under EE as well.
I’ll check that tool ^^, I don’t have NWNX tho. My knowledge is not enough to use it yet.
I though of database cause was the only thing I know to transfer data from the game to outside it, then back in again.
Thanks !!
edit: Damn, second sentence of SIMTools page in the vault: “It requires NWNX to be installed and running in order to use it”. Guess I’ll need to learn NWNX
This is the reason that SIMTools requires NWNX. You cannot do that in vanilla NWN except of using PostString as workaround which won’t be perfect and when I think about it more, might not be useable at all.
As for the translation of languages, you do not need Python, database or anything external, you can code this easily via NWScript (if you open SIMTools scripts for OnChat event it is all there plain and simple, very nice coding), in fact you cannot even do what you want without NWNX anyway (yes you can store something into database but you cannot tell Python from NWN to process it and put back). And btw, NWNX has no plugin for Python either, but it would be possible to do. Still there is no reason to do it, if you can code NWNX plugin then you can do whatever you would want to do in Python directly in that plugin in c++.
In summary - if you want to send chat message to single player and noone else you need NWNX. PostString will probably not be good replacement.