Have a variable appear in a localization key

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Have a variable appear in a localization key

Post by Noobasaurus »

I have a variable that I want to appear in a string as a message to a player. I know that I can have variables in print messages, but I need one that appears to the player. Is there any way to do this?
Last edited by Noobasaurus on Thu Jul 10, 2014 11:49 am, edited 1 time in total.
User avatar
GAB
1st Lieutenant
1st Lieutenant
Posts: 431
Joined: Sun Jul 03, 2011 8:56 pm
Location: Somewhere around the world
Contact:

Re: Have a variable appear in a localization string

Post by GAB »

I'm not sure if I understand well what you want, but I know that the script for the Felucia campaign, has a sort of variable localization string stuff. Maybe it would help you:
Hidden/Spoiler:
[code] --Setup callback to show update messages when turrets are killed
turret_count = 5
TurretKill = OnObjectKillClass(
function(object, killer)
if killer and IsCharacterHuman(killer) then
turret_count = turret_count - 1

if turret_count > 0 then
ShowMessageText("level.fel1.objectives.campaign.5a-" .. turret_count, 1)
end
end
end,
"tur_bldg_recoilless_fel_auto"
)
end[/code]
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Have a variable appear in a localization string

Post by Marth8880 »

If you mean basically using anything *but* localization key with ShowMessageText, I'm almost positive you can't do that. :(
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Have a variable appear in a localization string

Post by Noobasaurus »

@GAB: Thanks. That's really close to what I want, but that sets it to a certain localization key. I want to modify the localization string with a variable.

@Marth: So I'll have to use a localization key then, but I need it to load a variable.
Post Reply