HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

unit not selectable but still right-clickable ?

01-17-2009, 09:20 PM#1
Troll-Brain
Is there a way to make an unit unselectable but still allow the players to make a right click on it , and targetable in general ?

Any ideas ?

EDIT : And don't talk about to detect the unit selection and then deselect it, it's too slow.
01-17-2009, 09:48 PM#2
Pyrogasm
Yes.

Create the unit –> add 'aloc' –> chaos morph the unit into itself

By "into itself" I mean that the Data - Morphed unit type of the Chaos ability is the same as the unit-type of the unit you are morphing from.
01-17-2009, 09:53 PM#3
Troll-Brain
Quote:
Originally Posted by Pyrogasm
Yes.

Create the unit –> add 'aloc' –> chaos morph the unit into itself

By "into itself" I mean that the Data - Morphed unit type of the Chaos ability is the same as the unit-type of the unit you are morphing from.

No you can't target it in game with a right/left click, but i guess what i want is simply impossible.
01-17-2009, 10:09 PM#4
Pyrogasm
Right-clicking should work.

At the very least you can target it with abilities, I know that.
01-17-2009, 10:42 PM#5
DioD
You cant chaos morph to same unit, you must have different units.

Also your locust ability shoud be permanent (give it initially or use native)
01-17-2009, 11:08 PM#6
Troll-Brain
Quote:
Originally Posted by Pyrogasm
Right-clicking should work.

At the very least you can target it with abilities, I know that.

Here is a test map, uncomment the lines to check that the unit is targetable with a trigger, but the unit is not targetable with the mouse.
A condition was false in the required technology morph ability ...

Quote:
Originally Posted by DioD
You cant chaos morph to same unit, you must have different units.

Also your locust ability shoud be permanent (give it initially or use native)
Thx, this is the answer.
01-17-2009, 11:47 PM#7
Kyrbi0
^Wait, so to clarify, it works if you Chaos morph the unit into a different unit-type? Because I was having so many problems with this a few months ago...
01-17-2009, 11:47 PM#8
Anitarf
I think the trick was to add the locust ability after you chaos-morph the unit... I don't remember very well, I know I had this figured out in one of my spell olympics abilities, basically I did what the Warcraft III ability guide said should be done.
01-18-2009, 12:01 AM#9
Pyrogasm
No, no. You add it before you morph. The reason for this is that the locust ability goes really wonky if you remove it from a unit, and chaos morphing the unit effectively does that, with a few extra tricks. You could morph it into another unit if you wanted to; the point is that the unit you are morphing into doesn't have locust.

Quote:
Originally Posted by DioD
You cant chaos morph to same unit, you must have different units.

Also your locust ability shoud be permanent (give it initially or use native)
You can chaos morph into the same unit, and the way I did I never needed to make the ability permanent.

If you don't believe me, check out the attached testmap. It's for a spell for a spell competition on TheHelper I did a while ago; the spell summons yourself from the future, and I used this very bug in that spell to make the summoned unit targetable by the player's spells. Try it out:
Attached Files
File type: w3xTemporal Fluxuation - Pyrogasm.w3x (139.0 KB)
01-18-2009, 12:22 AM#10
Troll-Brain
I did more tests, and it facts it doesn't the same if the chaos morph ability unit id is the same as the unit or not.

If they are the same, even if the ability 'Aloc' is not permanent (added in the object editor for the unit id or set to permanent with the function UnitMakeAbilityPermanent), you must add 'Aloc' (unneeded if the unit has already it but it doesn't matter) + morph + remove 'Aloc'.
And you will get an unit totally unselectable and untargetable with the mouse but targetable with a trigger action or by an automatic attack (an ennemy detect it), or automatic spell ofc.
If you don't remove 'Aloc' the unit won't be targetable at all.

If they are not the same it works like Pyrogasm said.

@Pyrogasm : In your map it's the same unit type, but not the same rawcode, that's what Diod wanted to said.
But 'Aloc' doesn't need to be permanent, you're right.
01-18-2009, 12:51 AM#11
Pyrogasm
It should be the same rawcode...?
01-18-2009, 01:06 AM#12
Troll-Brain
Quote:
Originally Posted by Pyrogasm
It should be the same rawcode...?
I mean if you tried to use the trick on a footman, with a morph ability UnitID1 == 'hfoo', or with a morph ability UnitID1 == 'h000', where 'h000' is a custom unit based on footman, you won't have the same effect, as i have described.

It depends what you want.
01-18-2009, 04:54 AM#13
Pyrogasm
What I meant was that I thought I was using the the same rawcode in my testmap.
01-18-2009, 08:57 AM#14
Troll-Brain
Quote:
Originally Posted by Pyrogasm
What I meant was that I thought I was using the the same rawcode in my testmap.
But you didn't, you use a custom DK in your map ('U000') and the original DK in your morph ability ('Udea').
I think you've seen it yourself, but it's just to be more clear ^^
01-18-2009, 01:38 PM#15
Anitarf
Quote:
Originally Posted by Troll-Brain
I did more tests, and it facts it doesn't the same if the chaos morph ability unit id is the same as the unit or not.

If they are the same, even if the ability 'Aloc' is not permanent (added in the object editor for the unit id or set to permanent with the function UnitMakeAbilityPermanent), you must add 'Aloc' (unneeded if the unit has already it but it doesn't matter) + morph + remove 'Aloc'.
And you will get an unit totally unselectable and untargetable with the mouse but targetable with a trigger action or by an automatic attack (an ennemy detect it), or automatic spell ofc.
I'm pretty sure that in my spell the units were also targetable with the mouse... can't say for sure, though, and I can;t test it because my wc3 computer is fried, but I did find a copy of my code in the pastebin and I did indeed add the locust ability after I have chaos-morphed the unit from another unit. I'm pretty sure the unit was mouse-targetable, it was definitely unselectable while still being considered as a pathing obstacle, which was my desired result, not so sure about it being targetable though but I think it was.

Edit: Like I already said in my previous post, that's exactly how the Warcraft III ability guide said it could be done, reading that would have saved you guys some testing...