| 03-31-2010, 12:41 PM | #1 |
Hi there, I'm searching for a way to make prevent player controlled units to automatically acquire targets. Just setting the acquisition range to 0.01 (zero doesn't work) won't do, as your units still attack when they or an allied unit is attacked by an enemy. I want the units to attack only when you order them to. Kinda like workers do it. However classifying the units as worker will create a worker icon on the bottom-left corner ingame which is a no-go. So are there any ways to achieve this by certain object stats, abilities, advanced game settings or triggers? |
| 03-31-2010, 12:57 PM | #2 |
maybe with EVENT_UNIT_ACQUIRED_TARGET EVENT_UNIT_TARGET_IN_RANGE and "stop"-order no idea, never had this problem... |
| 03-31-2010, 01:08 PM | #3 |
Hmm that seems to be very costly regarding performance and issuing a lot stop orders will cause troubles as well. Someone got another idea? ;o |
| 03-31-2010, 01:15 PM | #4 |
or: - you remove 'Aatk' from all units. - if an unit shall attack, replace it with a new one (has 'Aatk') - if the attacker should no longer attack, remove 'Aatk' |
| 03-31-2010, 01:18 PM | #5 |
But I doubt you can order a unit to attack if it doesn't have the Attack ability. Personally I'd give "root" and "uproot" abilities (or whatever they're called) a try, that could make things easier. |
| 03-31-2010, 01:19 PM | #6 | |
Quote:
to go around this, it has to be replaced with a new unit of same type, cause 'Aatk' can't be added... |
| 03-31-2010, 01:50 PM | #7 |
Add the worker classification ingame via triggers, this way, the worker icon does not show up. JASS:call UnitAddType(u,UNIT_TYPE_PEON) |
| 03-31-2010, 02:32 PM | #8 |
Ah now that's cool. Should solve all my problems ^_^ And yeh, I already turned "can flee" to false when I was playing around with the worker classification. Didn't know that was possible : ) +Rep 'fcourse. |
| 04-01-2010, 02:06 AM | #9 |
Workers fight back against other workers, so if everybody has this on then they will fight back (but I think they also come to arms at alarm, i.e., one peasant is attacked by one peon, all nearby peasants attack that peon.) At least this was my experience with adding PEON classification to footmen. |
| 04-01-2010, 08:56 AM | #10 |
I cannot share this experience, when I fighted other workers with my workers, they still fleed. |
| 04-01-2010, 10:04 AM | #11 |
Well should work just fine in my case anyways ;) |
