• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Translated onLook - TFS 1.2

Loriana

Member
Joined
Dec 5, 2015
Messages
3
Reaction score
5
Hi! I created a system which translate all "you see" messages.
XZxepJn.png

EFE37GH.png

function to change language:
Code:
player:setLang(-1) -- en
player:setLang(0) -- pl
player:setLang(1) -- swe - missing translation
player:setLang(2) -- pt - missing translation
player:setLang(3) -- es - missing translation

I will post source if I get enough help with translation to other languages.
demo works until 31 jan 2016

events\events.xml:
set <event class="Player" method="onLookInShop" enabled="0" /> to enabled ="1"

events\scripts\player.lua:
remove all Player: onLook functions and add this:
Code:
function Player:onLook(thing, position, distance)
   self:sendTextMessage(MESSAGE_INFO_DESCR, self:getTranslatedDesc(thing, distance))
end

function Player:onLookInBattleList(creature, distance)
   self:sendTextMessage(MESSAGE_INFO_DESCR, self:getTranslatedDesc(creature, distance))
end

function Player:onLookInTrade(partner, item, distance)
   self:sendTextMessage(MESSAGE_INFO_DESCR, self:getTranslatedDesc(item, distance))
end

function Player:onLookInShop(itemType, count)
   local thing = Item(doCreateItemEx(itemType:getId(), count))
   local cid = self:getId()
   local msg = self:getTranslatedDesc(thing, -1)
   addEvent(doPlayerSendTextMessage, 100, cid, MESSAGE_INFO_DESCR, msg)
   return true
end

global.lua, add this below lib.lua:
Code:
dofile('data/lib/translate/words.lua')

data/lib/translate/dictionary.lua:
http://wklej.to/6L3HA

data/lib/translate/words.lua:
http://wklej.to/IozXD
 
What exactly do you need help with converting the languages? Couldn't we use a translator to get a majority of the words?
 
I'm looking for native speakers to give that script proper grammar.
 
CqgaXeB.jpg

That scripting... only 2 posts... who the fuck are you?
Demo? are you kidding? Who the fuck you think you are? Do you realise I could write a script like that easily and release it for free?
Didn't thought someone would actually attempt to hide a script. Just either post it or not ffs!
 
Why didnt anybody contribute this? Is this OTClient code only? Why so much hate?
 
I am Es / Pt small, can help

Altho i prefer to do this in OTClient lua
 
Back
Top