Forged Alliance Forever Forged Alliance Forever Forums 2016-07-16T10:16:31+02:00 /feed.php?f=41&t=12745 2016-07-16T10:16:31+02:00 2016-07-16T10:16:31+02:00 /viewtopic.php?t=12745&p=130750#p130750 <![CDATA[Re: Find out faction of user in UI mod]]> Statistics: Posted by nine2 — 16 Jul 2016, 10:16


]]>
2016-07-15T18:10:02+02:00 2016-07-15T18:10:02+02:00 /viewtopic.php?t=12745&p=130711#p130711 <![CDATA[Re: Find out faction of user in UI mod]]>

as I said, it was just a suggestion out of thin air without testing :P

Statistics: Posted by CookieNoob — 15 Jul 2016, 18:10


]]>
2016-07-15T17:56:22+02:00 2016-07-15T17:56:22+02:00 /viewtopic.php?t=12745&p=130710#p130710 <![CDATA[Re: Find out faction of user in UI mod]]>
Thanks! This does indeed work:

Code:
local armyTable = GetArmiesTable().armiesTable
local faction = armyTable[GetFocusArmy()].faction


Do not add in the () at the end, faction is just a number.

And a simple conversion function:

Code:
local Factions = {'UEF', 'Aeon', 'Cybran', 'Seraphim'};

function ConvertToFaction(factionNumber)
  return Factions[factionNumber + 1];
end


And I get the actual faction name.

@ Anihilnine,

Thanks! I didn't think of it, that indeed shows how it's done.
The same way as SirTobi did it.

Lots of love,
Jip

Statistics: Posted by Jip — 15 Jul 2016, 17:56


]]>
2016-07-15T16:29:00+02:00 2016-07-15T16:29:00+02:00 /viewtopic.php?t=12745&p=130704#p130704 <![CDATA[Re: Find out faction of user in UI mod]]> Statistics: Posted by nine2 — 15 Jul 2016, 16:29


]]>
2016-07-15T15:19:45+02:00 2016-07-15T15:19:45+02:00 /viewtopic.php?t=12745&p=130702#p130702 <![CDATA[Re: Find out faction of user in UI mod]]>
Code:
local armyTable = GetArmiesTable().armiesTable

and then
Code:
armyTable[GetFocusArmy()].faction()

Statistics: Posted by CookieNoob — 15 Jul 2016, 15:19


]]>
2016-07-15T15:02:33+02:00 2016-07-15T15:02:33+02:00 /viewtopic.php?t=12745&p=130697#p130697 <![CDATA[Find out faction of user in UI mod]]>
As the last part of the mod I want a certain part of the interface to be faction dependant.
As in, for seraphim it will be yellowish, aeon greenish, etc.

However, how do I find out what faction the user is using (the name of the faction, aka: aeon)?

I've been looking through the code of other UI scripts, but I find very few to no references to the faction, yet they change by faction.

Help would be much appreciated.

Lots of love,
Jip

Statistics: Posted by Jip — 15 Jul 2016, 15:02


]]>