Teamkill script

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
DrDrSheldonLeeCooper
Chief Warrant Officer
Chief Warrant Officer
Posts: 353
Joined: Sat Apr 26, 2014 1:50 pm
Projects :: Times before Empire
Games I'm Playing :: SWBF2-BF-Skyrim
xbox live or psn: No gamertag set
Location: Coruscant City [Germany]

Teamkill script

Post by DrDrSheldonLeeCooper »

Is it possible to make a script that if you attack a team member, that he will
get agressive and attack you? your if you make a teamkill and the other teammebers
want to revenge him? Or isn't that possible to make with the swbf2 al?
hunpeter12
Command Sergeant Major
Command Sergeant Major
Posts: 260
Joined: Mon Apr 18, 2011 2:53 pm
Projects :: Underground City The Complex [WIP]
Games I'm Playing :: SWBF2

Re: Teamkill script

Post by hunpeter12 »

It's possible with some complex LUA scripting, but it would have a lot of problems.
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Teamkill script

Post by Noobasaurus »

I wouldn't really say complex. I did something similar using teams in my Kill the Target script. You could probably use that as a base and instead of changing the team of a whole side you instead change the team of one unit and set them to attack you. Most of this stuff you can see in the Kill the Target script. Here's the function you would use when damage is taken:

Code: Select all

SelectCharacterTeam(character, team)
I forget if that actually changes their team right then and there, but it's worth a try.
hunpeter12
Command Sergeant Major
Command Sergeant Major
Posts: 260
Joined: Mon Apr 18, 2011 2:53 pm
Projects :: Underground City The Complex [WIP]
Games I'm Playing :: SWBF2

Re: Teamkill script

Post by hunpeter12 »

Yeah, not really complex, but maybe strange result. If you transfer some units of your team to e.g. team 3 and set team 3 to be enemy with both teams you will have somke units from your team as an enemy for all the mission (unless you use a timer or something), just because you accidentally grenaded a team member of yours. So I don't know if it would be fun.
jedimoose32
Field Commander
Field Commander
Posts: 938
Joined: Thu Jan 24, 2008 12:41 am
Projects :: Engineering Degree
Location: The Flatlands of Canada

Re: Teamkill script

Post by jedimoose32 »

It's late and I just got off work so I could be way off here, but I think noobasaurus is saying that you could change the player's team (or perceived team?) to, for example, team 3, and make everyone aggressive toward team 3. Then when the player dies, switch them back to their previously chosen team. I feel like this should be possible, and not too complicated (depending on your definition of complicated).
DrDrSheldonLeeCooper
Chief Warrant Officer
Chief Warrant Officer
Posts: 353
Joined: Sat Apr 26, 2014 1:50 pm
Projects :: Times before Empire
Games I'm Playing :: SWBF2-BF-Skyrim
xbox live or psn: No gamertag set
Location: Coruscant City [Germany]

Re: Teamkill script

Post by DrDrSheldonLeeCooper »

thx for help ;)
hunpeter12
Command Sergeant Major
Command Sergeant Major
Posts: 260
Joined: Mon Apr 18, 2011 2:53 pm
Projects :: Underground City The Complex [WIP]
Games I'm Playing :: SWBF2

Re: Teamkill script

Post by hunpeter12 »

jedimoose32 wrote:It's late and I just got off work so I could be way off here, but I think noobasaurus is saying that you could change the player's team (or perceived team?) to, for example, team 3, and make everyone aggressive toward team 3. Then when the player dies, switch them back to their previously chosen team. I feel like this should be possible, and not too complicated (depending on your definition of complicated).
That's what I said.
jedimoose32
Field Commander
Field Commander
Posts: 938
Joined: Thu Jan 24, 2008 12:41 am
Projects :: Engineering Degree
Location: The Flatlands of Canada

Re: Teamkill script

Post by jedimoose32 »

Sorry, I thought you were suggesting changing the friendly AI over to team 3.
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Teamkill script

Post by Noobasaurus »

Yeah, you could either make your whole team aggressive towards you (make you team 3 or whatever on a timer or something) or make that one unit aggressive towards your team. Of course, an even more complicated way to do this would be to change the player to team 3 and put the unit on team 4, which is friendly to your original team and enemy to your new team and the original enemies. This way, however, makes it a lot better in the long run.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Teamkill script

Post by [RDH]Zerted »

Like people have been saying, you can move the player to another team or move some AI units to another team. Both ways would work. They would work even better if you clear then set the AI goal to attack the player.

However, any third team still has the ability to capture CPs. You don't want a non-spawnable team capturing CPs. Don't forget to deal with that.
Post Reply