HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

need the unit to ignore orders

07-21-2004, 11:04 AM#1
R3N3G4D3
I have a unit on my map that should be ordered to auto-attack another unit as soon as the unit is created and afterwards I need the unit to ignore all attack orders given to it by its owning player and just continue attacking the unit that the trigger told it to. I could create a periodic trigger, but then I would have to set the period to be very small (like 0.1 seconds) for it to simulate the ignore effect, otherwise it might still get 1 hit in when they player keeps clicking repeatedly on another unit to attack. Plus if I keep a periodic trigger I would have to keep both units in memory for the trigger to be able to pick a target and the attacking unit, and there will be more than 1 unit of this unit-type, so a periodic trigger might become a real problem after you have a lot of these units. So I was wondering if there was a way to get unit to just continue the order it was given before and ignore all orders it receives afterwards.
07-21-2004, 12:35 PM#2
htek
create another allied player... give the unit in question to the allied player, but don't share unit control. you'll still be able to affect the unit in regards to spells and stuff... and perhaps a trigger could be used to "start production and end production" of the unit, so it looks as if you are constructing the units.

also, you could create a small square around the barracks or whatever, and say that for every footman entering the area [when they are spawned] then they are destroyed and an allied one put into place...
07-21-2004, 05:34 PM#3
R3N3G4D3
Nah, I can't use that, the unit has to still belong to the same player, it's for a tower in a TD map.
07-21-2004, 06:21 PM#4
Anitarf
Well, if you want to disable user control, one option is the locust ability; it makes the unit unselectable, but also untargetable (so it's basically invulnerable and immune to spells), so that may not work for you if you want that unit to be killable.

An alternative to the periodic trigger would be that whenever any unit was selected by it's owner, the trigger would deselect the unit if it was of the un-orderable kind. If you cannot select the unit, you can't give it any orders, but it is still targetable.

And another thing, if the unit is classified as a ward, it will not show any command buttons, but I do not know if it can be ordered around by triggers then...
07-21-2004, 07:29 PM#5
R3N3G4D3
Maybe I could do the unselection thing, but I was hoping that the player could select it to see the damage done by the unit. Also, about wards, the command buttons are hidden but they're still there and units can still be given commands by using hotkeys or right-clicking on unit to attack.
07-22-2004, 05:54 AM#6
Anitarf
I'm not sure you can command wards, at least, you can't command the serpent ward who to attack, if I remember correctly, it attacks on its own. Maybe it has something else set besides just ward...
07-22-2004, 07:02 PM#7
R3N3G4D3
I'll look into it. Just that I remember that all ants & humans type games even since the beginning have been using wards as units that get in jail, and they could still be ordered around, but maybe they weren't actually wards but made to be targeted as wards.

EDIT: Checked it, it works just like needed. It listens to the orders given to it by triggers but ignores orders from players. The only problem is that it doesn't show the upgrade button in its toolbar (because I need it to upgrade) but I'll figure something out for that too. Thx Anitarf.
07-23-2004, 10:39 PM#8
Ezula
Quote:
Originally Posted by R3N3G4D3
Maybe I could do the unselection thing, but I was hoping that the player could select it to see the damage done by the unit. Also, about wards, the command buttons are hidden but they're still there and units can still be given commands by using hotkeys or right-clicking on unit to attack.

Then possibly u could do a trigger that check the condition "If the footman is not attacking the unit u want him too" then "make him attack that unit"... and run the trigger checking conditions...