Page 1 of 1

Teamkill script

Posted: Tue Dec 09, 2014 12:47 pm
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?

Re: Teamkill script

Posted: Tue Dec 09, 2014 4:17 pm
by hunpeter12
It's possible with some complex LUA scripting, but it would have a lot of problems.

Re: Teamkill script

Posted: Tue Dec 09, 2014 8:25 pm
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.

Re: Teamkill script

Posted: Wed Dec 10, 2014 1:55 am
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.

Re: Teamkill script

Posted: Wed Dec 10, 2014 2:38 am
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).

Re: Teamkill script

Posted: Wed Dec 10, 2014 10:03 am
by DrDrSheldonLeeCooper
thx for help ;)

Re: Teamkill script

Posted: Wed Dec 10, 2014 1:37 pm
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.

Re: Teamkill script

Posted: Wed Dec 10, 2014 2:05 pm
by jedimoose32
Sorry, I thought you were suggesting changing the friendly AI over to team 3.

Re: Teamkill script

Posted: Wed Dec 10, 2014 8:26 pm
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.

Re: Teamkill script

Posted: Wed Jan 07, 2015 1:19 am
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.