Page 1 of 1

Neutral Unit Question (Medic)

Posted: Sat Apr 14, 2012 5:41 pm
by SpartanA259
Hey guys I've been wondering if there is any way to make a neutral unit for each team. To try and rephrase that a little better I want to make a medic class for each team and when you play as the medic class nobody will shoot you or kill you. I've tried searching but I dont really know what to search for and I dont even know if this is possible.

Re: Neutral Unit Question (Medic)

Posted: Sat Apr 14, 2012 5:47 pm
by kinetosimpetus
You could try setting a local team as friend to both teams and when a medic spawns, move them to that team. This would all be done in the lua.

Re: Neutral Unit Question (Medic)

Posted: Sat Apr 14, 2012 6:16 pm
by yuke5
@ kinetosimpetus

Would that work though? What if the player wants to be a Medic? I think the games crashes. However, I'm not nearly as experienced as kinetosimpetus. If his idea doesn't work, you could do this.

There could be two local teams of medics though. One local team (local team 1) is friends with team 1 but is enemies with team 2. However, team 2 thinks it's friends with local team 1. Do the same for another local team except that it hates team 1, loves team 2, and team 1 loves it. The downside is that the player couldn't spawn as the medic. The downside is that the player could not spawn as a medic, however, there would be medics on the field helping out both teams.

Re: Neutral Unit Question (Medic)

Posted: Sat Apr 14, 2012 6:35 pm
by kinetosimpetus
I haven't tried it, but what I remember from other topics is it will work, and on re-spawning the player would again be on the correct team. Has to be tried though.

As for the team alliances, he wants all medics to be friendly with everyone so they don't get shot at. If the medics were on another team, but had the same alliances, there would be no point.

Re: Neutral Unit Question (Medic)

Posted: Sun Apr 15, 2012 8:02 pm
by Tears2Roses
[offtopic]
yuke5 wrote: ...
The downside is that the player couldn't spawn as the medic. The downside is that the player could not spawn as a medic
...
One local team (local team 1) is friends with team 1 but is enemies with team 2. However, team 2 thinks it's friends with local team 1. Do the same for another local team except that it hates team 1, loves team 2, and team 1 loves it.
...
Hidden/Spoiler:
you typed The downside is that the player could not spawn as a/the medic twice :wink: and the thing about teams makes no sense...you can set the locals to be friends with team1 and team2 (and everyone else for that matter) and vice-versa
[/offtopic]

Re: Neutral Unit Question (Medic)

Posted: Wed Apr 25, 2012 9:19 am
by [RDH]Zerted
kinetosimpetus wrote:You could try setting a local team as friend to both teams and when a medic spawns, move them to that team. This would all be done in the lua.
Correct. Add your medic unit as normal to teams 1 and 2. Setup a local 3rd team that's a friend (or you can use neutral) of both teams 1 and 2. Make sure teams 1 and 2 are also a friend/neutral towards team 3. Now when a unit of the medic class spawns, Use SetObjectProperty() to change "Team" and "PerceivedTeam" 3. That will effectivly move the unit on onto local team 3.

I would recommend preventing team 3 from being able to capture CPs. If not, you'll have to deal with when all the CPs are captured by team 3 and no human players can spawn.