Different campaign scripts for 2 sides

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
CT108
Rebel Sergeant
Rebel Sergeant
Posts: 186
Joined: Mon Aug 22, 2016 6:20 am
Projects :: None
Games I'm Playing :: CS2
xbox live or psn: Captain CT108
Location: Xanadu

Different campaign scripts for 2 sides

Post by CT108 »

Hello there general kenobi

I've seen some maps with a campaign mode where you're able to choose both teams, how can I do it?

I mean is it possible to get different campaign scripts for team 1 and team 2, so when you spawn with team "A" the campaign script "A" plays?

Thanks for the help ! =)
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Different campaign scripts for 2 sides

Post by Marth8880 »

ScriptCB_SetGameRules("campaign") is what causes team 1 to be the chosen team. You could then use GetCharacterTeam(0) to get the player's team number and execute conditional logic based on that. See here for more info on GetCharacterTeam: https://github.com/marth8880/SWBF2-Lua- ... clua#L1681

You will, however, want to take into account the fact that the player can still change teams in the spawn screen. I think Zerted once figured out a way to keep the player on their initially-chosen team after they've spawned, so you should look into that.
User avatar
CT108
Rebel Sergeant
Rebel Sergeant
Posts: 186
Joined: Mon Aug 22, 2016 6:20 am
Projects :: None
Games I'm Playing :: CS2
xbox live or psn: Captain CT108
Location: Xanadu

Re: Different campaign scripts for 2 sides

Post by CT108 »

Alright thanks Marth! Do you have any idea for where I can look for this Zerted's solution please? I don't really know where I can start for this
Post Reply