Page 1 of 1

Different campaign scripts for 2 sides

Posted: Sat Aug 04, 2018 6:25 pm
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 ! =)

Re: Different campaign scripts for 2 sides

Posted: Sun Aug 05, 2018 1:04 pm
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.

Re: Different campaign scripts for 2 sides

Posted: Sun Aug 05, 2018 2:32 pm
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