• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to make invisible units to stay invisible when channeling/casting a spell?

Status
Not open for further replies.
Level 4
Joined
Aug 7, 2010
Messages
77
Hi all forum helpers. This may be a noobie question to some of you. Well, the situation goes like this, when an invisible unit cast a spell, its invisibility will be broken. So my question is, how to make permanent invisible units remains invisible when casting a spell such as the ghost in starcraft II where he stay invisible when launching a nuclear strike.

Thanks in advance!
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
Add Permanent Invisibility ability to your unit, just set Duration in both fields to 0. Your unit can channel/attack/cast spells and still be invisible. Rawcode of ability 'Apiv'.

You can add/ remove ability via:
JASS:
call UnitAddAbility (unit, 'Apiv')
call UnitRemoveAbility (unit, 'Apiv')
Just set variable unit to given unit you want to be permanently invisible.
 
Level 4
Joined
Aug 7, 2010
Messages
77
Add Permanent Invisibility ability to your unit, just set Duration in both fields to 0. Your unit can channel/attack/cast spells and still be invisible. Rawcode of ability 'Apiv'.

You can add/ remove ability via:
JASS:
call UnitAddAbility (unit, 'Apiv')
call UnitRemoveAbility (unit, 'Apiv')
Just set variable unit to given unit you want to be permanently invisible.

thanks alot! and sorry that i'm a noob.
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
@Svendviking you dont need jass at all.
You can either add permanent ability via object editor or (what enables you manipulating dynamicaly) add/remove it via trigger -> gives possibility to add invisibility as temporary buff, not as permanet skill. Like: your caster goes channel - you add invisibility; caster ends channeling - remove the sbility.

In GUI it's:
  • Unit - Add Yourability to (Triggering unit)
  • Unit - Remove Yourability to (Triggering unit)
Or for efficiency:
  • Custom script: call UnitAddAbility(udg_YourUnit, AbilitId)
  • Custom script: call UnitRemoveAbility(udg_YourUnit, AbilitId)
Ability Id you can get from Object Editor -> Ability section click Ctrl + D.
Rawdata (aka Id) of all abilityies will replace thier name field.
 
Status
Not open for further replies.
Top