HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

UNIT_TYPE_PEON

04-20-2009, 04:20 PM#1
Opossum
Isn't this classification supposed to set a unit's acquisition range to 0?
It seems this doesn't work anymore unless I'm doing something terribly wrong. Try it yourself:
call UnitAddType(CreateUnit(Player(14), 'hfoo', 0, 0, 0), UNIT_TYPE_PEON) Even the default peasants now attack hostile units when they're close enough.
04-20-2009, 07:33 PM#2
Bobo_The_Kodo
UnitAddType usually does not change a unit's behavior
04-20-2009, 10:26 PM#3
Captain Griffen
Doesn't stop them attacking other peons.
04-21-2009, 03:23 AM#4
Drain Pipe
Quote:
Originally Posted by Litany
It's generally only effective for targeting, as I recall.

well only SOME targeting. Example: you can add the "flying" tag to a unit, and melee will still be able to attack and damage it. Ancients works though, as far as I've checked. You can add and remove the ancient tag and units unable to attack ancient types will not be able to attack those units either. I'm not too sure of others, I know Undead will work as well. Not sure about the rest.
04-21-2009, 05:29 AM#5
Drain Pipe
Quote:
Originally Posted by Litany
When you added the air type did you also remove the ground type and any other types that would allow it to be targeted by a melee unit?

You know what? I don't think i did. not as a control in testing anyways...

But that kind of confuses me then. I rigged up a test map that added the ancient type to units, and then removed it. I also removed the test unit's ability to attack ancients (just that one field). When i added the unit type to some units, others couldn't attack the units with the newly acquired ancient's unit type. Removed it and they could. So why wouldn't units be able to attack them in that case? They still had the same ground-related types as before?

I guess my question should really be then, have you done what you just said and gotten units that were considered ground to be considered air and treated as such and vice versa?

Another followup question: how would i grant a unit temporary ability to target additional unit types without modifying that unit? Because I wanted to try and make scenarios where, for instance, units in an area could only be damaged by other units in said area. Or 2 units could only target and be targeted by each other.
04-21-2009, 11:42 AM#6
Captain Griffen
Searing arrows, orb abuse...messing around with targetting is rediculously buggy and hit and miss.
04-21-2009, 11:55 AM#7
Opossum
Well what I actually want to achieve is to remove the auto targetting of certain creeps and then basically rewrite a custom AI from scratch.
I always thought the worker/peon (that's the same I think?) classification would do that. Guess I was wrong.

I'm gonna try the permanent invisibility thingy then...

Edit: works although the creeps still fight back when they're attacked themselves but I guess that works for me.