which games do faction change ingame?
Moderator: Moderators
which games do faction change ingame?
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?
XTA at least.
Maybe spads could send the played faction along with the replay...
Maybe spads could send the played faction along with the replay...
Re: which games do faction change ingame?
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 :)
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?
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:
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:
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:
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.
Code: Select all
ModOptions.commander == 'choose'
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",
Code: Select all
startUnit = GetTeamRulesParam(TeamID, 'startUnit')
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?
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.Jools wrote:Oh, so you're making a widget or gadget that listen to those codes.
Re: which games do faction change ingame?
There's KP, but it's a secret >_>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?