• 🏆 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!

AoE Invisibilty

Status
Not open for further replies.
Level 3
Joined
Nov 28, 2010
Messages
42
Hello,

I want to make a spell that when used makes all friendly units invisible for 5 seconds.

Its an AoE ability you use it and every friendly unit that is in the range of that ability is invisible.

Hope you can help me.

Thanks!
 

Deleted member 219079

D

Deleted member 219079

Check for alive friendly non-structure units in the range of the caster, create temporary dummy, add invisibility-ability to it, make it cast the invisibility to the picked unit.
 
Level 3
Joined
Nov 28, 2010
Messages
42
Check for alive friendly non-structure units in the range of the caster, create temporary dummy, add invisibility-ability to it, make it cast the invisibility to the picked unit.

When i do this only 1 unit gets the invisibilty. Did i do something wrong?
 

Deleted member 219079

D

Deleted member 219079

  • Example
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to <Your ability>
    • Actions
      • Set Unit_Caster = (Triggering unit)
      • Set Player_Owner = (Owner of Unit_Caster)
      • Set Point_CasterPosition = (Position of Unit_Caster)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within <Your range> of Point_CasterPosition matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an ally of Player_Owner) Equal to True) and (((Matching unit) is A structure) Equal to False)))) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 <Your dummy> for Player_Owner at Point_CasterPosition facing Default building facing degrees
          • Unit - Add <Your invisibility spell> to (Last created unit)
          • Unit - Order (Last created unit) to Human Sorceress - Invisibility (Picked unit)
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_Point_CasterPosition)
If you're unfamiliar with using dummies, feel free to ask :)

Edit: I think this is an ok dummy:
dummy.rar (4.8 KB)​
 
Level 3
Joined
Nov 28, 2010
Messages
42
  • Example
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to <Your ability>
    • Actions
      • Set Unit_Caster = (Triggering unit)
      • Set Player_Owner = (Owner of Unit_Caster)
      • Set Point_CasterPosition = (Position of Unit_Caster)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within <Your range> of Point_CasterPosition matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an ally of Player_Owner) Equal to True) and (((Matching unit) is A structure) Equal to False)))) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 <Your dummy> for Player_Owner at Point_CasterPosition facing Default building facing degrees
          • Unit - Add <Your invisibility spell> to (Last created unit)
          • Unit - Order (Last created unit) to Human Sorceress - Invisibility (Picked unit)
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_Point_CasterPosition)
If you're unfamiliar with using dummies, feel free to ask :)

Edit: I think this is an ok dummy:
dummy.rar (4.8 KB)​

Everything worked. I need this for an rpg map and i have triggers that have a chance to create gold when units die. Now if i use the ability it drops 1 gold piece for every unit that get the invisibilty. This is really weird anyway to firx this. Thanks for the explanation tho!
 
Level 10
Joined
Aug 30, 2007
Messages
270
well, since the dummies you use to make the units invisible are also units and they die after 3 seconds (see expiration timer in the trigger) they will also trigger your gold-drop-trigger. what you just have to do is to check in your gold-drop-trigger if the dying unit is a dummy or not, if it is you just end the trigger, or set the chance to 0%.
 
Level 3
Joined
Nov 28, 2010
Messages
42
well, since the dummies you use to make the units invisible are also units and they die after 3 seconds (see expiration timer in the trigger) they will also trigger your gold-drop-trigger. what you just have to do is to check in your gold-drop-trigger if the dying unit is a dummy or not, if it is you just end the trigger, or set the chance to 0%.

But it drops Gold for every unit that gets invisible. I tried to make 2 invisible 2 Gold Coins. 4 invisible 4 Gold coins.
 

Deleted member 219079

D

Deleted member 219079

By the way, I just gave you an inefficient trigger, I didn't know the (Last created unit) runs through function call,

change the enum to this:
  • Unit Group - Pick every unit in (Units within <Your range> of Point_CasterPosition matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an ally of Player_Owner) Equal to True) and (((Matching unit) is A structure) Equal to False)))) and do (Actions)
    • Loop - Actions
      • Unit - Create 1 <Your dummy> for Player_Owner at Point_CasterPosition facing Default building facing degrees
      • Set Unit_Dummy = (Last created unit)
      • Unit - Add Invisibility to Unit_Dummy
      • Unit - Order Unit_Dummy to Human Sorceress - Invisibility (Picked unit)
      • Unit - Add a 3.00 second Generic expiration timer to Unit_Dummy
i have triggers that have a chance to create gold when units die. Now if i use the ability it drops 1 gold piece for every unit that get the invisibilty.
Just like jopi said, run the gold giving units through a filter where you filter out units of type <Your dummy>.

Edit: Can you post the gold bounty triggers here?
 
Level 3
Joined
Nov 28, 2010
Messages
42
By the way, I just gave you an inefficient trigger, I didn't know the (Last created unit) runs through function call,

change the enum to this:
  • Unit Group - Pick every unit in (Units within <Your range> of Point_CasterPosition matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an ally of Player_Owner) Equal to True) and (((Matching unit) is A structure) Equal to False)))) and do (Actions)
    • Loop - Actions
      • Unit - Create 1 <Your dummy> for Player_Owner at Point_CasterPosition facing Default building facing degrees
      • Set Unit_Dummy = (Last created unit)
      • Unit - Add Invisibility to Unit_Dummy
      • Unit - Order Unit_Dummy to Human Sorceress - Invisibility (Picked unit)
      • Unit - Add a 3.00 second Generic expiration timer to Unit_Dummy

Just like jopi said, run the gold giving units through a filter where you filter out units of type <Your dummy>.

Edit: Can you post the gold bounty triggers here?

  • GoldDrop
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set ItemDrop = (Random integer number between 1 and 20)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ItemDrop Equal to 20
        • Then - Actions
          • Item - Create Gold at (Position of (Dying unit))
        • Else - Actions
 

Deleted member 219079

D

Deleted member 219079

Add in the trigger's conditions block:
(Unit-type of (Triggering unit)) is (<Your dummy>) equal to false
 
Status
Not open for further replies.
Top