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

[Trigger] Add locust and order illusions to attack their target

Status
Not open for further replies.
Level 3
Joined
Jun 17, 2015
Messages
53
Hi, i was tried to make DotA's old reflection skill that

Target the area, creates illusions of picked unit, also illusions are untargetable

but my triggers i've made, only 1 illusions is untargetable, others arent. I searched some forums and cant find a way to fix it, please help me :D


  • Raise Soul
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Raise Soul
    • Actions
      • Set RS_Caster = (Triggering unit)
      • Set RS_Loc[1] = (Target point of ability being cast)
      • Set RS_Group = (Units within 300.00 of RS_Loc[1] matching ((((Matching unit) is A structure) Not equal to (!=) True) and ((((Matching unit) is alive) Equal to (==) True) and (((Matching unit) belongs to an enemy of (Owner of RS_Caster)) Equal to (==) True))))
      • Unit Group - Pick every unit in RS_Group and do (Actions)
        • Loop - Actions
          • Set RS_customvalue = (Custom value of (Picked unit))
          • Set RS_Target[RS_customvalue] = (Picked unit)
          • Set RS_Loc[2] = (Position of RS_Target[RS_customvalue])
          • Unit - Create 1 Craggy Exterior Dummy for (Owner of RS_Caster) at RS_Loc[2] facing Default building facing (270.0) degrees
          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
          • Item - Create Raise Soul Item at RS_Loc[2]
          • Hero - Give (Last created item) to (Last created unit)
          • Item - Set charges remaining in (Last created item) to 1
          • Unit - Set level of Raise Soul Illusion for (Last created unit) to (Level of Raise Soul for RS_Caster)
          • Hero - Order (Last created unit) to use (Last created item) on (Picked unit)
          • Custom script: call RemoveLocation(udg_RS_Loc[2])
      • Custom script: call DestroyGroup(udg_RS_Group)
      • Custom script: call RemoveLocation(udg_RS_Loc[1])
[trigger=ILLUSIONS]
Frostmourne Illusion
Events
Unit - A unit enters (Playable map area)
Conditions
Actions
-------- Raise Soul --------
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(((Entering unit) is an illusion) Equal to (==) True) and (((Entering unit) is owned by (Owner of RS_Caster)) Equal to (==) True)
(Unit-type of (Entering unit)) Equal to (==) (Unit-type of RS_Target[RS_customvalue])
Then - Actions
Unit - Add Locust to (Entering unit)
Unit - Add Item MS Bonus (522) to (Entering unit)
Unit - Order (Entering unit) to Attack RS_Target[RS_customvalue]
Else - Actions
[/trigger]
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
Instead of "enter region" event use "spawns a unit"(or whatever that event's name was, maybe it was summons a unit) event, and in conditions just check if the summoning unit is Craggy Exterior Dummy.

The reason your trigger doesn't work properly is enter region event has a slight delay.

Don't forget setting your dummy unit's animation times to 0.
 
Level 3
Joined
Jun 17, 2015
Messages
53
I don't mess with illusions, they are too weird. I think you have to use the Unit spawns a summoned unit Event.
i think im fine with it, just illusions came at the same time, only 1 random unit got locust, dunno why it cant give locust to all

Instead of "enter region" event use "spawns a unit"(or whatever that event's name was, maybe it was summons a unit) event, and in conditions just check if the summoning unit is Craggy Exterior Dummy.

The reason your trigger doesn't work properly is enter region event has a slight delay.

Don't forget setting your dummy unit's animation times to 0.

i tried, sometime it work, sometime not
 
Level 3
Joined
Jun 17, 2015
Messages
53
i realized something how it works:

1. Like the triggers i wrote, that pick every unit and create their illusions
2. When the unit is summoned, add locust and order them to attack the picked unit
3. But somehow this is how it work:
-there are 3 skeletons (call them skeleton 1 2 3) and 2 ghouls (ghoul 1 2), when i cast skill it summons 3 skeleton illusions and 2 ghoul illusions
-2 ghoul illusions got locust, the other dont have. But they only attacks ghoul 1
 
Level 2
Joined
Sep 16, 2014
Messages
17
This is how i made a locust illusion(note that its copy paste of a illusion trigger that is different from what you want,but you'll get the idea:
  • Shadow Clone
  • Events:
    • Unit - A unit Starts the effect of an ability
  • Condition:
    • (Ability being cast) Equal to Shadow Clone
  • Actions:
    • Unit - Create 1 Shadow Clone DUMMY for Neutral Victim at (Position of UDPS) facing Default building facing degrees
    • Trigger - Turn on ShadowCloneTargetIllu <gen>
    • Custom script: call IssueTargetOrderById(GetLastCreatedUnit(),852274,udg_UDPS)
    • Unit - Remove (Last created unit) from the game
  • ShadowCloneTargetIllu
  • Events:
    • Unit - A unit Spawns a summoned unit
  • Conditions:
    • ((Summoned unit) is an illusion) Equal to True
  • Actions:
    • Set UShadowCloneIllu = (Summoned unit)
    • Custom script: call UnitAddAbility(GetSummonedUnit(),'Aloc')
    • Trigger - Turn off (This trigger)
Note that UShadowCloneIllu variable is your illusion,and you can then manipulate it any way you like. Also i used a dummy unit with "Wand of Illusions" ability instead of dummy item in this example.
 
Level 3
Joined
Jun 17, 2015
Messages
53
i think im fine with single illusion, the problem is how it work in Unit Group Loop which mean many illusions appear at the same time
 
Level 2
Joined
Sep 16, 2014
Messages
17
Actually just tested my triggers with around 100 illusions. Made a test map,and tested it a bit,so try it out. Don't mind dummies,made them in a hurry XD
 

Attachments

  • example.w3x
    17.2 KB · Views: 33
Level 3
Joined
Jun 17, 2015
Messages
53
Actually just tested my triggers with around 100 illusions. Made a test map,and tested it a bit,so try it out. Don't mind dummies,made them in a hurry XD

i see, tested 3 times and only 1 time it got bugged that 1 illusion dont get the locust, btw can u force them to attack picked unit? Im kinda worst with jass :goblin_cry:

and what this code means? How can you spawn illusions without adding items?
  • Custom script: call IssueTargetOrderById(GetLastCreatedUnit(),852274,GetEnumUnit())
 
Level 2
Joined
Sep 16, 2014
Messages
17
No need for JASS there,improved the example map:

  • Custom script: call IssueTargetOrderById(GetLastCreatedUnit(),852274,GetEnumUnit())
means to order last created unit to use "Wand of illusion" ablility(its id is 852275) on picked unit. Note: Wand of illusions ability spawns illusion of its target(its originaly an item ability).

And about JASS,i don't know how to write JASS either,i can only read it,gonna join you in crying. :goblin_cry:
 

Attachments

  • example.w3x
    17.4 KB · Views: 29
Level 3
Joined
Jun 17, 2015
Messages
53
here are my triggers that i posted to your map and test, some how i check it almost same but not all illusions get locust? Maybe it because of Unit Group?
 

Attachments

  • example.w3x
    19.1 KB · Views: 26
Did you try it without locust?

Make invulnerable, turn collision off.

Also, you should try triggering those abilities instead of adding an item and creating dummy units to cast things. Just create the units you want to be illusions and add timers to them.
  • Unit - create (unit-type (target unit of ability being cast)) for your_player facing default building facing direction
  • Unit - turn (last created unit) collision off
  • Unit - Make unit invulnerable
  • Unit - Set generic timer for (last created unit) to 10.00 seconds
Add 'aloc' if you want, but all that extra adding items and ordering units creates a greater risk of human error. For example, why not just set movement speed to 522, why use an item for that?

Also, what is the custom value of picked unit? Why not use an indexed array? Set x = x + 1. Maybe some of your units have the same custom value?
 
Level 3
Joined
Jun 17, 2015
Messages
53
im was think because i want illusions to know their targets are different so i add custom value (honestly i dont know how it works)
 
Status
Not open for further replies.
Top