
Isn't that done through the Localization?

Moderator: Moderators
Code: Select all
assert(cp.name, "WARNING: no name supplied for the command post")
cp.name = string.lower(cp.name)
self.commandPosts[cp.name] = cp
Code: Select all
OnFinishCaptureTeam(function (ShowMessageText("level.VNV.cp2c_r", ATT, DEF) (cp2) ... end, 1)
OnFinishCaptureTeam(function (ShowMessageText("level.VNV.cp2c_c", ATT, DEF) (cp2) ... end, 2)
OnFinishNeutralizeTeam(function (ShowMessageText("level.VNV.cp2l_r", DEF, ATT) (cp2) ... end, 1)
OnFinishNeutralizeTeam(function (ShowMessageText("level.VNV.cp2l_c", DEF, ATT) (cp2) ... end, 2)
Nah, all Lua scripts are treated the same way by the game engine. The only "special" situation is where a script is called by the exe: in that case only the name of the script file and the functions it contains have to have the correct names, and must do what is expected of them (mostly interface stuff). Any scripts read in by ScriptCB_DoFile() are not called by the exe 'directly', but by the Lua interface/engine instead. The only time you need to edit those scripts is when you are using them yourself, but they are doing something "unwanted".Teancum wrote:Oh duh lolz--- it probably needs to be in ObjectiveConquest.lua
Code: Select all
-- This would go into ScriptPostLoad()
-- and you would have one for each team capturing CPs
OnFinishCaptureTeam(
function(cPost)
local pName = GetEntityName(cPost) -- Gets the name of the post that was captured
ShowMessageText("level.VNV." .. pName .. "_r") -- Show this string to all teams
end,
teamNumber -- Team number for the strings
)
-- the ".." is Lua's concatenate, ie connecting two strings together
-- If the post's name was "cp1" then the line above should create "level.VNV.cp1_r"
-- Just make sure you have a localized string for each side and CP otherwise it will show as "NULL"
Code: Select all
-- This would go into ScriptPostLoad()
-- and you would have one for each team capturing CPs
OnFinishCaptureTeam(
function(cPost)
local pName = GetEntityName(cPost) -- Gets the name of the post that was captured
ShowMessageText("level.VNV." .. pName .. "_r") -- Show this string to all teams
end,
teamNumber -- Team number for the strings (don't forget to change me)
)
-- the ".." is Lua's concatenate, ie connecting two strings together
-- If the post's name was "cp1" then the line above should create "level.VNV.cp1_r"
-- Just make sure you have a localized string for each side and CP otherwise it will show as "NULL"