Page 1 of 1

which games do faction change ingame?

Posted: 01 Oct 2013, 11:08
by dansan
I want to correctly show the actually played faction on the replay site. Which games except BA & TA allow/do faction change ingame?

Re: which games do faction change ingame?

Posted: 01 Oct 2013, 15:14
by Jools
XTA at least.

Maybe spads could send the played faction along with the replay...

Re: which games do faction change ingame?

Posted: 01 Oct 2013, 16:21
by dansan
Thank you, found the code in gui_commchange.lua.
Unfortunately XTA uses a different cmd-code (177) than BA and TA (138)... but it has a fixed number for the faction - that's very helpful :)

Re: which games do faction change ingame?

Posted: 01 Oct 2013, 16:54
by Jools
Oh, so you're making a widget or gadget that listen to those codes. But that's not 100 % reliable, because that widget only works when a modoption has been set that you can change commander in game:

Code: Select all

ModOptions.commander == 'choose'
Otherwise, no messages will be sent. But in this case, the commander will be as what is stated in lobby. XTA can be started with the following commanders:

Code: Select all

  
autoupgrade = "arm_commander",
halfupgrade = "arm_u2commander",
fullupgrade = "arm_u4commander",
noupgrade = "arm_u0commander",
comshooter = "armcom",
decoystart = "arm_decoy_commander",
capturethebase = "arm_base",
nincom = "arm_nincommander",
plain = "arm_scommander",
This is for arm, similar for core. All arm commanders have their unitname start with "a", so it's probably even more reliable to get the startingunit by this:

Code: Select all

startUnit = GetTeamRulesParam(TeamID, 'startUnit')
Then you can get the name from that unitDefID and check if it starts on a "a".

This is all a bit complicated maybe, maybe we should standardise this process between different games. Of course the LuaRules code in XTA could be same as in BA, I put it deliberately to be different to avoid clashes (just to be safe).

The other code, '195' + faction (1/2), is for widgets. Yes, you can use it also.

Re: which games do faction change ingame?

Posted: 01 Oct 2013, 22:54
by dansan
Jools wrote:Oh, so you're making a widget or gadget that listen to those codes.
No, I just want to display the faction that was actually played on the replay website, and parsing the demofile I can catch those lua messages.

Re: which games do faction change ingame?

Posted: 02 Oct 2013, 20:03
by zwzsg
dansan wrote:I want to correctly show the actually played faction on the replay site. Which games except BA & TA allow/do faction change ingame?
There's KP, but it's a secret >_>