LUA Scripting - One Team Selectable (Battlefront II - 2005)

Started by Gabin Dayback, March 01, 2018, 06:33:30 PM

Previous topic - Next topic
March 01, 2018, 06:33:30 PM Last Edit: March 01, 2018, 06:48:51 PM by Gabin Dayback
Hello.

I have a quick question for experienced LUA scripters:

Is there a LUA Command / Line that makes only one team playable (ATT / DEF) for a specific map?

To make sure I am specific as possible I will provide the following scenario:

- Munge a New Map (Era: CW / Sides: Rep vs. Cis / Mode: Conquest)

Can I make the new map so it can only allow me to play with REP and restrict me from selecting CIS? (Just like in the Campaign.)

This is the code in BF1 - usually it works or there is an equivalent.
ScriptCB_SetPlayerSide(1,0)
ScriptCB_SetPlayerSide(1,1)
ScriptCB_SetCanSwitchSides(nil)


Referenced here - first number in each is the team you want forced.
The BOBclan:  A Rich History


Quote from: Unit 33 on November 29, 2014, 03:44:44 AM
'Please, tell me more about the logistics of the design of laser swords being wielded by space wizards' - Some guy on the internet.

Thank you very much for your response, Phantom.

I tried adding the lines to the SCRIPT, but it seems it crashes the game when the map loads in-game.

I used different variations, but still nothing. :P

Try ForceHumansOntoTeam1() for the republic or empire and ForceHumansOntoTeam1(0) for the cis, alliance.

March 02, 2018, 06:31:08 PM #4 Last Edit: March 06, 2018, 12:13:22 PM by Gabin Dayback
Quote from: Commander Cody on March 02, 2018, 03:40:00 PM
Try ForceHumansOntoTeam1() for the republic or empire and ForceHumansOntoTeam1(0) for the cis, alliance.

It works like a charm.

Thank you very much, Cody.

Feedback (Update):

- The only line that is valid for BFII LUA is ForceHumansOntoTeam1().
- It will restrict you to play with the SIDE which is marked as DEF in the script.
- The only solution to play with a side which is set as DEF (Team 2) by the default script, is to switch it to ATT (Team 1).