| 05-11-2006, 09:45 AM | #1 |
I have to code a morphing spell by hand so that the unit never actually morphs. When the unit (a hero) is in his morphed form I don't wan't him to be able to do anything except morph back to regular form (like he is frozen). I based the spell off of Channel and made a trigger to cancel any orders besides unmorphing while he is morphed. It is all working fine and dandy except that he still auto-acquires enemy units. You can't order him to attack but he does it automatically anyway. So I figure if I could just disable his attack that would solve the problem. What would be the best way to do that? I am also open to ideas of how to actually make the move/attack/patrol buttons dissapear from the command card. |
| 05-11-2006, 10:16 AM | #2 |
Try something like: Event - A unit is issued an order targeting a point Event - A Unit is issued an order targeting an object Event - A Unit is issued an order with no target Conditions - If Any conditions are true: Issued order equal to "attack" Issued order equal to "move" Ordered unit equal to <your hero> Actions - Order (Ordered Unit) to Stop |
| 05-11-2006, 10:21 AM | #3 | |
Quote:
EDIT: Tried my hand a modified version of vile's solution: |
| 05-11-2006, 11:11 AM | #4 |
Hold position should work better than Stop Isn't there something that turns auto-acquration on/off? I checked WE and JassCraft and couldn't find it though :S |
| 05-11-2006, 11:38 AM | #5 |
Adding the worker classification to the hero will prevent him from auto-acquiring targets. |
| 05-11-2006, 11:47 AM | #6 |
Disabling attack is easy as adding the ability 'Abun' to a unit. For those unfamiliar it is Cargo Hold (Orc Burrow) or something like that. Giving it to a unit removes the attack icon from the unit. And unlike removing 'Aatk' it is 100% reversible. |
| 05-11-2006, 12:19 PM | #7 |
It removes the attack button but it doesnt prevent it from auto acquiring if im not mistaking. Btw Aankhen, you're right, I just posted it quickly, but the main idea is there. |
| 05-11-2006, 01:01 PM | #8 |
It wasn't meant to do it all. Just disabling auto acquire won't prevent the unit from attacking either, but together they will meet all the anti-attack requirements. |
| 05-11-2006, 04:49 PM | #9 |
Thanks guys, peon classification does the trick, and it doesn't even show an idle peasant button like I expected! 'Abun' removes the attack button, but is there anything that also removes the move/hold position/stop/patrol buttons? |
| 05-11-2006, 05:09 PM | #10 | |
Quote:
That actually could be considered a bug. Another of those useful ones blizzard leaves for us :P. As for removing the other icons, it can't be done (except by removing the unit's ability to move, in the case of 'Move' and 'Patrol'). |
| 05-11-2006, 06:01 PM | #11 |
Hmm, i had the same problem, and if you still want the "Attack" ability to be removed (not permanently) then try this: Have a dummy-unit casting "DrunkenHaze" on the unit whose "attack" is supposed to be disabled. Another Trigger removing the Buff would make this undone. |
| 05-12-2006, 06:37 AM | #12 |
Um, I don't believe Drunken Haze will remove the attack and/or other buttons but what Chuckle Brother suggested already works. It is to bad, morphing really would be the best way to do it except the with my custom spell learning system it morphs back to the hero as specified in the object editor, before he has learned any abilities. I can add the abilities back on but all the cooldowns on spells are reset which is bad news. I learned though that disabling and enabling a spell doesn't reset the cooldown. EDIT: Hold on a sec. I don't know much about the spellbook, but could I base my "morphing" ability off of that and wouldn't that clear the command card and then I could just have one ability in there that morphs him back to normal (cancels the spellbook or whatever)? |
| 05-12-2006, 03:40 PM | #13 |
You don't believe or haven't you checked it out? ... I did not say i assumed, for i did implement that into my own map, and it works, trust me... |
| 05-12-2006, 05:02 PM | #14 |
I've disabled move in the past with a custom tech requirement for the 'Amov' (move) ability. I simply put a certain unit type as the requirement and then had a preplaced unit of that type and changed ownership as needed. Unfortunately that's only a per-player solution and not a per-unit solution. (BTW, you'd need to activate Amov in the SLK to be able to see it in the editor). |
| 05-12-2006, 08:05 PM | #15 |
What you can do is edit the ability "Silence" to disable Attack instead of disabling spells. I think. So create a dummy unit and tell it to cast a modified version of Silence. |
