I'm trying to put Faction Specific strings into an Lua addon for BGs. I can directly edit the strings in the Lua, but if I put "Ally Bitches" in there and then play it with my ally toon, that's obviously not right.....
I want to put an IF statement and assign the strings:
[Lua]
if (faction==FACTION_HORDE) then -- First find out What your current Faction is
JoeyDEnemy_Plurl= 'Ally Bitches '
JoeyDEnemy_Runner='Bitch ass Ally runner'
else
JoeyDEnemy_Plurl= 'Horde Bastards '
JoeyDEnemy_Runner='Bastard Horde runner'
end
[/Lua]
Then to use these variable in different contexts I used string concatenation like this:
[Lua]
desc=JoeyDEnemy_single..'are '
desc= JoeyDEnemy_Runner..' is '
--[elsewhere in the code: ]--
JoeyD_Cleanup="Tossing "..JoeyDEnemy_Plurl.."in the incinerator and hosing down the blood, gimme minute"
self:Print(JoeyD_Cleanup)
[/Lua]
But then the addon doesn't load when I run the game & go into a BG the addon doesn't load/launch,so I assume there is either a syntax error or something else wrong.
So I basically have 2 questions:1- what is the Lua method to discover what faction I'm on?
and 2: do you see any syntax errors in the examples above?
Any help would be appreciated.
Yer Ol' Pal,
JoeyD