• 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.

Spell Won't Function

Status
Not open for further replies.
Level 2
Joined
Oct 28, 2010
Messages
14
Here is my trigger:

9abtqq.jpg


So background information: I have this custom spell named "Charm Possession" that is essentially the same as Charm without the mana cost or cooldown. I gave this to one of my custom heroes to test out something.

What I want to do is create a banshee that will, after a few seconds, go to possess the target my "Charm Possession" spell was targeted at. So in essence, if I wanted to possess a footman, the banshee, after the specified time, will go up to him and cast possession (please note: the banshee charm unit is essentially a banshee--just without an attack and collision size).

However, in-game, the banshee just stands there and doesn't move. The created banshee faces the heroes angle correctly (thankfully), but I have to manually select her and tell her to cast possession on a target.

How would I go about fixing this?

EDIT: Forgot to note that the variable serves no purpose. Please disregard it.
 
Level 12
Joined
May 20, 2009
Messages
822
I think pretty much all data except (Triggering Unit) is thrown away after a wait. Try removing the wait and see if that fixes anything, if not I don't know.

If it does fix it, however, then you have 2 options:


Just change the casting time of the possession spell on the dummy Banshee, or
There's a little bit of a complicated thing you can do to create an artificial wait that is MUI and does not cause problems that the wait function does. I'll go into detail about that if you need it.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
1. Try using starts effect instead of begins casting.
2. You either need to use locals to save the target and the created unit or you will need some form of index system as "Last created unit" literally means the last created unit by any trigger thread (so if you cast again before the banshee possesses or a spawn system makes some units it will get one of those units and not the banshee).
 
Unit starts the effect of an ability

Ability being cast equal to charm...

Set UnitOwner to owner of triggering unit <--- UnitOwner must be a PLAYER variable, not a unit variable

set Temp_Point to position of target unit of ability being cast <--- Temp_Point is a point variable

Create 1 banshee for UnitOwner at Temp_Point facing...

custom script: call RemoveLocation(udg_Temp_Point) <--- remove location leak

wait 0.5 secs <--- bad idea, wait functions is not MUI. See deathismyfriend's tutorial about MUI triggering.

order lastcreated unit to cast... target unit of ability being cast.
 
Status
Not open for further replies.
Top