HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Anti Team Killing Code

04-28-2006, 10:47 PM#1
ixmike88
How could I detect before a player attacks an ally? Similar to DotA, thanks.
04-28-2006, 10:56 PM#2
Mezzer
In a nutshell: Unit is attacked, triggering unit is an ally of Owner of(attacking unit) equal to true, order attacking unit to stop. That will prevent allies from attacking each other.
04-29-2006, 01:58 AM#3
Exilus
Or:

E:
-A unit is issued an order targeting a unit

C:
-(Issued order) equal to (Attack)
-(Target unit of issued order) equal to (An ally of (Owner of ordered unit))

A:
(EXTRA)-Display to all players the text message "(player name of owner of ordered unit)+( has tried to teamkill )+(Name of owner of target unit of issued order)+(.....Bad boy!)
-Order (Ordered unit) (Stop)
04-29-2006, 02:27 AM#4
Immoralis
... or you can just make it in targets allowed "enemies"
04-29-2006, 06:32 AM#5
blu_da_noob
Quote:
Originally Posted by Immoralis
... or you can just make it in targets allowed "enemies"

That doesn't stop you being able to attack allies. Perosnally, I prefer Exilus' version, without the message and ordering the unit to move/attackmove to the position of the target of the order.
04-29-2006, 07:49 AM#6
vile
The best thing is to order the unit to attack move into the position of the targeted ally, so instead of just stopping you will try and search for attacking enemies around the target.
04-29-2006, 08:32 AM#7
Captain Griffen
Or you can just change the attacks of all heroes/mercs to not be able to attack allies. More professional, less triggers, and generally a better solution.
04-29-2006, 08:36 AM#8
blu_da_noob
Quote:
Originally Posted by Captain Griffen
Or you can just change the attacks of all heroes/mercs to not be able to attack allies. More professional, less triggers, and generally a better solution.

Quote:
Originally Posted by blu_da_noob
That doesn't stop you being able to attack allies.
.
04-29-2006, 08:52 AM#9
Mystic Prophet
exilus's solution is probably the best to prevent click attacking you cant make that only target enemies. though why he didnt use trigger tags I don't know.

I say give the guy some rep for helping ye out.
04-29-2006, 08:58 AM#10
Captain Griffen
Quote:
Originally Posted by blu_da_noob
That doesn't stop you being able to attack allies.

I'm pretty sure that it does, though I can't check it at the moment. Someone else check it, because I'm sure that it does.
04-29-2006, 09:35 AM#11
blu_da_noob
Just tried it out. Added the 'Enemy' tag to the attack field and it didn't change a thing.
04-29-2006, 09:53 AM#12
Captain Griffen
What copy and paste the raw data for the attack field.
04-29-2006, 10:02 AM#13
iNfraNe
Just believe the man already. Test it yourself. Adding "Enemies" to the field does NOT work.
04-29-2006, 10:02 AM#14
blu_da_noob
debris,enemies,ground,item,structure,ward

That is the targets allowed field. (Footman and added enemies)
04-29-2006, 10:08 AM#15
Captain Griffen
Quote:
Originally Posted by iNfraNe
Just believe the man already. Test it yourself. Adding "Enemies" to the field does NOT work.

First, I already said that I cannot test it. Secondly, I want to see if I can work out why it doesn't work. I'm guessing it may be because ground overrides it, and allows it to attack all ground. So if you don't have any air units, it might be worth trying it without the ground there.