HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

make unit unselectable

03-21-2005, 11:41 PM#1
curi
hi i'm trying to make a unit unselectable during a spell. i tried using the player selects unit event and unselecting the unit, but if you hotkey the unit and repeatedly hit the hotkey and click somewhere you can get the unit to move because the unselection isn't instant.

i tried aloc but it totally didn't work. you could still select the unit by hotkey, and removing aloc didn't let you click the unit normally again!

i need the player to still be able to select other units while the spell is going on. i think there's new 1.18 triggers that can prevent selection or something, but for everything not a single unit.

is there any solution? i could catch all orders to the unit and ignore them, but letting the unit be selected at all is a problem. because for example i need to add a temporary ability to him and have him use it, and it looks ugly.
03-22-2005, 01:42 AM#2
Guest
(My 1st post in this forum ^_^)
Ok,
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to <ability>
Actions
Advanced - Make <unit> unselectable and untargetable

The action is found in WEU though it makes the unit untargetable...
Hope this helps a little

~piece
03-22-2005, 04:03 AM#3
curi
that's probably just Aloc. convert to custom text and you can see what it does. I don't use WEU.
03-22-2005, 09:55 AM#4
Hyarion
Can't you just change ownership?
03-22-2005, 02:20 PM#5
Vexorian
That just adds the Aloc ability to theu unit
03-22-2005, 05:53 PM#6
Hyarion
Errrr... "That just adds the aloc ability to the unit"? Do you mean that WEU function, or changing the units ownership? Anyhow, isn't there a new JASS function for disabling selection at all?
03-22-2005, 06:55 PM#7
curi
changing ownership is a good idea except it would make the hero portrait in the top left go away

i can't use the new thing b/c i need the player to still be able to select other units during the spell.
03-27-2005, 01:21 AM#8
Valmanway
What about disabling the players UI at the beginning then re-enabling it at the end?
03-27-2005, 01:49 AM#9
curi
he must be able to control other units
03-27-2005, 01:56 AM#10
TheNyne
Make a dummy unit that resembles the unit/hero that has this ability. And make the selection size(I think that is what it is called) for the dummy unit to 0. Note you will have to hold shift when bring the box up to edit the value.

Then replace the unit with the dummyunit. However you want to do it from here on out, I'm not sure which would work best for you.
03-27-2005, 02:25 PM#11
curi
but i don't want to replace the hero with something else. the hero still needs to be there to get attacked, make a portrait, etc.
03-27-2005, 05:03 PM#12
TheNyne
Well, I never said give the dummyunit to a different player. And that would still have the potrait. And then make a trigger to intercept any damage/buffs or whatever that the dummyunit gets, and then when you replace the dummyunit back with the regular one, just add the damage, and the buffs(if that is possiblet to add the buffs, I'm not sure, if it's an aura you wouldn't need to worry about it). If the dummyunit dies, just kill the regular unit.
03-27-2005, 09:05 PM#13
Vexorian
You could hide the unit, create a version with Aloc and at the end of the spell show the unit again and remove the one with Aloc
03-30-2005, 08:15 PM#14
curi
another issue i just thought of is other heroes should still be able to do things like cast Ice Armor on the hero. i'm going to look into ignoring orders to the hero. (if an order is issued, check who it's to, and then if it's the hero casting spell, re-issue the cast spell order ... would that mess up channelling spells though? anyway i'll test it.)
04-08-2005, 09:52 PM#15
curi
ok i don't think you can make a unit keep channelling a spell if it gets an order to do something else. re-issueing the order makes it cast the spell again. so i think the solution is:

have a dummy caster cast the spell. if the hero gets an order, order him to hold position. (or pause the hero or whatever).