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

[Trigger] Trigger Unit to Cast

Status
Not open for further replies.
Level 4
Joined
Apr 25, 2008
Messages
75
Hey! I'm trying to trigger a unit to cast a custom spell based on Item Illusions.
Basically it is a trigger that creates x number of dummies to cast my Item Illusions spell which has been customized in the fields that change the damage dealt, damage taken and how long it lasts. I'm doing it this way because there isn't a field that says how many illusions are created.
I have a spell (Based on Finger of Death (Archimonde) ) with all the effects removed on the hero. The allowed targets are "Hero".

Then I wrote a bunch of testing triggers and tested it to find it didn't work.
I did some more specific testing and found the problem was that the dummy (in this case Footman) wasn't casting the spell. I tried changing the spell to a unit spell. I tried using Priests instead of Footies then finally tried to make a dummy caster. None worked. Tested some more and found the problem was there same; dummy wasn't casting! I tried changing Order String and messing with that. I also wrote a trigger that detects what Orders are issued.
  • Untitled Trigger 001 Copy
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • Game - Display to (All players) the text: ((String((Issued order))) + (Name of (Ordered unit)))
To the Footies it was issueing the order "undefend" when I cast the spell. So I changed the Order String to undefend. Nope. I tried testing without removing the unit after they were meant to cast. I found that the units had the spell there and that if I cast them manually it worked perfectly fine!!! I also found that when I cast them manually it doesn't have an order string. I know thing because it just said "Footman" (see above trigger). Here's my trigger.
  • Confusion
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Confusion (Shown on Hero)
    • Actions
      • Unit - Create (((Level of Confusion (Shown on Hero) for (Casting unit)) / 2) + ((Level of Confusion (Shown on Hero) for (Casting unit)) mod 2)) Priest for (Owner of (Casting unit)) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
      • Unit Group - Pick every unit in (Last created unit group) and do (Actions)
        • Loop - Actions
          • Unit - Add Confusion (Shown on Dummy) to (Picked unit)
          • Unit - Set level of Confusion (Shown on Dummy) for (Picked unit) to (Level of Confusion (Shown on Hero) for (Casting unit))
          • Custom script: call IssueTargetOrderBJ( GetFilterUnit(), "fingerofdeath", GetSpellTargetUnit() )
          • Unit - Order (Picked unit) to Special Archimonde - Finger Of Death (Target unit of ability being cast)
          • Unit - Remove (Picked unit) from the game
  • Custom script: call IssueTargetOrderBJ( GetFilterUnit(), "fingerofdeath", GetSpellTargetUnit() )
  • Unit - Order (Picked unit) to Special Archimonde - Finger Of Death (Target unit of ability being cast)
I was alternating between these 2 actions when the Order String was on "fingerofdeath".

So can someone help me here?
I want it to make the dummy caster cast the spell.
OR
A simple way to make Item Illusions create more than 1 illusion.

Also, preferably can I have the answer in GUI cause I suck with JASS. Basically understand nothing.
 
Level 4
Joined
Apr 25, 2008
Messages
75
for the illusions: cast it twice trice or if possible edit the amount of images in the ability fields

There isn't a field for amount of images.
If I cast it 2-3 times then it will look pretty bad I recon. That's why I'm making x number of units and getting them all to cast same time. Don't worry about the formula for how many units are created that works fine and I know what I'm doing there. The problem is that I can't get it to cast in first place. So I can't cast it twice or thrice anyway.
 
maybe you can try changing the base spell, there are some bugged spells like stampede which needs more coding and settings to be autocasted by dummies...

You use
  • Unit Group - Pick Every Unit in (last created unit group)
but what is Last Created Unit group equal to? I dont see an action that creates a unit group in your trigger except this
  • Unit Group - Pick Every Unit in (last created unit group)
......
 
Status
Not open for further replies.
Top