Jump to content

Translating mod texts with modoverrides.lua


Recommended Posts

Hello everyone,

 

I spent hours trying to translate 3 texts of a mod in my language with modoverrides.lua I can't make it work... is this not possible at all? :x if not, how can I translate it...?

 

 I want to translate the mod "Armageddon"

 

here is the original code:  (ArmageddonGameLogic)

function IntroMessage()	local text = "Each time you die, the darkness grows stronger.\nKill Giants to weaken the darkness!"	local hunt_message = PopupDialogScreen( "The Armageddon!", text, {{text="Start!", cb = function() TheFrontEnd:PopScreen() end}} )	TheFrontEnd:PushScreen( hunt_message )end
function ArmageddonGameLogic:SetHuntTimer( hunt_time )	if self.time_widget and hunt_time > 0 then		local timer_text = "Lives remaining: " .. hunt_time		self.time_widget:SetString(timer_text)	end	if TheWorld.ismastersim then		self.net_hunt_timer:set(hunt_time)	endend
function ArmageddonGameLogic:OnUpdate(dt)	--create client UI for displaying remaining lives	if ThePlayer ~= nil and self.time_widget == nil then		self.time_widget = ThePlayer.HUD.overlayroot:AddChild( Text(UIFONT, 30) )		self.time_widget:SetVAnchor(ANCHOR_TOP)        self.time_widget:SetHAnchor(ANCHOR_MIDDLE)        self.time_widget:SetPosition(0, -45)        self.time_widget:SetString("")	end		--create client UI for reset screen	if self.hunt_state == GAME_STATE.OVER_TIMESUP or self.hunt_state == GAME_STATE.OVER_ALLDEAD then		if self.reset_dialog == nil then			local title = "Armageddon!"					local message = "The forces of darkness triumph. There were no survivors."			self.reset_dialog = HuntOverDialogScreen( title, message, TheWorld.ismastersim ) --ThePlayer and ThePlayer.Network:IsServerAdmin()			self:SetResetTimer( self.reset_time )			TheFrontEnd:PushScreen(self.reset_dialog)		end	end		if TheWorld.ismastersim then		self:ServerOnUpdate(dt)	endend

And here is what I am adding in modoverrides.lua : (I tried different things (example: I removed the "local' part) but none is working...)

return {    ["workshop-445184784"] = { enabled = true,        configuration_options =        {	    local text = "Hahahahaha \nHohohoho.",	    local message = "Hihihihi.",	    local title = "World",	    local timer_text = "Nooooo " .. hunt_time,        }    }}

Honestly, I know nothing about coding, but as it was kind of working for another mod I thought I would know how to do that but I was wrong... :(

 

If anyone can help I would be really grateful,

thank you very much :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...