SWBFGamers

Modding for the Original SWBF1 and SWBF2 => SWBF2 Modding => Topic started by: Gabin Dayback on March 01, 2018, 06:33:30 PM

Title: LUA Scripting - One Team Selectable (Battlefront II - 2005)
Post by: Gabin Dayback on March 01, 2018, 06:33:30 PM
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.)
Title: Re: LUA Scripting - One Team Selectable (Battlefront II - 2005)
Post by: Dark_Phantom on March 01, 2018, 06:57:23 PM
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 (http://www.swbfgamers.com/index.php?topic=3886.msg40262#msg40262) - first number in each is the team you want forced.
Title: Re: LUA Scripting - One Team Selectable (Battlefront II - 2005)
Post by: Gabin Dayback on March 01, 2018, 08:49:18 PM
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
Title: Re: LUA Scripting - One Team Selectable (Battlefront II - 2005)
Post by: Commander Cody on March 02, 2018, 03:40:00 PM
Try ForceHumansOntoTeam1() for the republic or empire and ForceHumansOntoTeam1(0) for the cis, alliance.
Title: Re: LUA Scripting - One Team Selectable (Battlefront II - 2005)
Post by: Gabin Dayback on March 02, 2018, 06:31:08 PM
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).









EhPortal 1.34 © 2024, WebDev