Concat localizations and ShowMessageText()
Posted: Thu Dec 31, 2009 9:36 am
I'm just toying around with ideas at work, but I'm trying to find an easy, global way of doing SWBF1-style CP capture descriptions.
Here's the current code:
Here's the current code:
And here's what I'd like to do:--To go in ObjectiveClassicConquest.lua
OnFinishCaptureTeam(
function(cPost)
local cpName = GetEntityName(cPost) -- Gets the name of the post that was captured
local cpTeam = GetCommandPostTeam(cPost) --Gets the team name
ShowMessageText("level.ZZZ.capture." .. pName .. cpTeam) -- Show this string to all teams
end,
)
-- Result: Output the value of level.ZZZ.capture.CP1CIS
Trouble is, I don't think you can do raw text with ShowMessageText(), and I doubt can you use the & symbol to create a dynamic sting like in VB.net. There must have been something like this in the SWBF1 code. I know they didn't localize every instance, just the side, the "captured the" and the CP name. Any ideas? I'd really hate to localize every capture and nuetralize for every CP/map/faction.--To go in ObjectiveClassicConquest.lua
OnFinishCaptureTeam(
function(cPost)
local cpName = GetEntityName(cPost) -- Gets the name of the post that was captured
local cpTeam = GetCommandPostTeam(cPost) --Gets the team name
ShowMessageText("The " & "entity.sides." ..cpTeam & " captured the " & .. pName) -- Show this string to all teams
end,
)
-- Result: A dynamic string, with some static text, and some localization, with the end result being something like "The CIS captured the Spire".