• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Summon

Status
Not open for further replies.
Level 3
Joined
Feb 19, 2016
Messages
32
Hey, need help with a trigger.
It's supposed to summon ghouls near the target. The ghouls are dealing damage depending on caster's intelligence, but that actually works. Somehow ghouls spawn in the center of the map instead of the valid point.

Here's the script.

  • Sa3
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to sa3
    • Actions
      • Set sa3t[2] = (Target unit of ability being cast)
      • Set sa3t[1] = (Casting unit)
      • Set sa3p[1] = (Position of ab2t[1])
      • Set sa3p[2] = (Position of ab2t[2])
      • For each (Integer A) from 1 to 2, do (Actions)
        • Loop - Actions
          • Set sa3p[3] = (Et1p[2] offset by 256.00 towards (Random angle) degrees)
          • Unit - Create 1 Ghoul for Player 1 (Red) at sa3p[3] facing 0.00 degrees
          • Unit - Make (Last created unit) Invulnerable
          • Unit - Turn collision for (Last created unit) Off
          • Unit - Order (Last created unit) to Attack sa3t[2]
          • Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
      • Custom script: call_RemoveLocation (udg_sa3p[1])
      • Custom script: call_RemoveLocation (udg_sa3p[2])
      • Custom script: call_RemoveLocation (udg_sa3p[3])
Tried to add waits for minimal durations, but didn't really help. Any solutions. please?
 
Level 13
Joined
Jan 2, 2016
Messages
978
just look at what you are doing
you have units sa3t[], and then you set sa3p[] to the position of ab2t[], and then you set sa3p[3] to point with offset from Et1p[].
How do you expect it to work?

You need to set sa3p[1/2] to positions of sa3t[1/2], and then set sa3p[3] to point with offset, based on sa3p[2]
(Made it colorful, so it'd be easier to notice what's wrong)
 
Status
Not open for further replies.
Top