which games do faction change ingame?

which games do faction change ingame?

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
dansan
Server Owner & Developer
Posts: 1203
Joined: 29 May 2010, 23:40

which games do faction change ingame?

Post 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?
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: which games do faction change ingame?

Post by Jools »

XTA at least.

Maybe spads could send the played faction along with the replay...
dansan
Server Owner & Developer
Posts: 1203
Joined: 29 May 2010, 23:40

Re: which games do faction change ingame?

Post 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 :)
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: which games do faction change ingame?

Post 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.
dansan
Server Owner & Developer
Posts: 1203
Joined: 29 May 2010, 23:40

Re: which games do faction change ingame?

Post 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.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: which games do faction change ingame?

Post 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 >_>
Post Reply

Return to “Lua Scripts”