Why is this not working?!

Anderzzon

Active Member
Reaction score
4
BAH! I can't for the life of me figure this one out. I want the dummy to move from the caster and start a life drain on the target. Here are the triggers:

Trigger:
  • Transfusion
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Transfusion
    • Actions
      • Set BloodMageTarget = (Target unit of ability being cast)
      • Set BloodMagePoint = (Position of (Triggering unit))
      • Rect - Center Transfusion Origin <gen> on BloodMagePoint
      • Set OrbsPoint = (Position of BloodMageTarget)
      • Rect - Center Transfusion <gen> on OrbsPoint
      • Unit - Create 1 Transfusion Dummy for (Owner of (Triggering unit)) at (Random point in Transfusion Origin <gen>) facing Default building facing (270.0) degrees
      • Unit - Set life of (Last created unit) to 1.00
      • Unit - Order (Last created unit) to move (Random point in Transfusion <gen>)
      • Unit - Add Transfusion Drain (Dummy) to (Last created unit)


And:
Trigger:
  • Transfusion Drain
    • Events
      • Unit - A unit enters Transfusion <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to (==) Transfusion Dummy
    • Actions
      • Unit - Order (Triggering unit) to Neutral Dark Ranger - Life Drain BloodMageTarget


Now, there is a lot more to this spell. But untill I can get this working I'm not going in on anymore details.

Also, does anyone know of a good Life Drain spell that is red instead of green?

/Anderzzon

EDIT1: Yes, the mana-costs are equal to 0.
 

Ayanami

칼리
Reaction score
288
I think life drain doesn't work if you're at full health. Not too sure about that.

If you're trying to create a drain effect, maybe try doing it by triggers? Plus, you can change the color of your lightning effect by triggers.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
1). well the dummy cannot cast his spell because you order him to move to a different location after he tried to cast. this will abort his cast order.

2). your trigger is leaking locations:
(Random point in Transfusion Origin <gen>)

3). i doubt the actions you use are what you are actually looking for. i might be wrong but i guess you want your dummy to slide around while casting life drain on a target right? ordering the dummy to move is not the way to go here.
more likely you should use a kind of sliding system, either a self made or downloaded one.

4). i dont know if the rects are needed, if you just want to spawn the dummy at a random location within a set range you can do this without locations using points solely.

5). the second trigger is not needed at all. just put that order action at the end of your first trigger.
 

Anderzzon

Active Member
Reaction score
4
No. I want the dummy to move there and just drain. Simple as that. And no, how can I add that to the end of the first trigger when I want it to start draining when he arrives near the target unit?

I tried ordering the dummy to stop before the drain, that didn't work. So that's not the problem either.

/Anderzzon
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
why do you move that dummy to the target region in the first place? i dont really get what you are trying there.
 

Anderzzon

Active Member
Reaction score
4
I order it to move. I want it to spawn at the caster, "walk" over towards the target unit. And when it comes close to the target I want it to drain it.

/Anderzzon
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
okay, i assume the dummy is a visible dummy then.

but what exactly doesnt work? is the dummy moving? is the dummy casting?
 

Anderzzon

Active Member
Reaction score
4
Yeah, it's visible. It spawns, walks over there and then just stops. So I guess the problem is the casting.

/Anderzzon
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
couldn't you just set the cast range of the Life Drain to 100. and order the dummy to cast it immediatelly after you create him?
I think that the Area of Effect field is the "break" distance
not sure though
 

Anderzzon

Active Member
Reaction score
4
Try insert a debug message to your second trigger. See if the trigger runs.

The message doesn't show. Meaning that the second trigger doesn't activate at all.

/Anderzzon

EDIT1: Okei, I figured out that the problem lies within the first trigger. You see the rect called "Transfusion" doesn't get moved (how the dummy knew where to move before, I have no idea) since when I moved it manually and started the map to test it out the messige came and the dummy drained the target.

EDIT2: It makes no sense what so ever! The dummy knows where to move though when he enters the region it no longer seems to be there since the dummy won't cast the drain. So by that logic the region it seems that the rect is moved and then moved back again before the unit reaches the area.
 

Ayanami

칼리
Reaction score
288
Hmm, maybe to check, make a periodic trigger that constantly moves a unit to the center of region "Transfusion".
 

DioD

New Member
Reaction score
57
Trigger:
  • Unit - A unit enters Transfusion &lt;gen&gt;


it will register event to location at moment of registration, if you move rect later, it wont work.
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
I think it'd be better to set a point beside the target unit, or create a manual region then clear it afterwards. Because I've also found that entering the moved region doesn't work when I was fixing some other spell the other time.
 

Anderzzon

Active Member
Reaction score
4
Okay, why dont you just make a spell that doesnt use all these regions? Its too much fuss

So.. is there a suggestion of how to do it? Is there some sort of function to check the distance between two units? Coz if there is and I could get some direction to finding it I could remake the spell better and it'll help me with the second part of the spell.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Trigger:
  • set Temp_Point_1 = Position of UNIT_A
    • set Temp_Point_2 = Position of UNIT_B
    • set Temp_Real = Distance between Temp_Point_1 and Temp_Point_2
    • custom script: call RemoveLocation (udg_Temp_Point_1)
    • custom script: call RemoveLocation (udg_Temp_Point_2)

and voila, Temp_Real will give you the exact distance between unit a and b.

of course, you can calculate it yourself using coordinates only, but it wouldnt be any more effective if done in GUI solely. using jass you can save a little performance.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
I believe there's a function called Distance between Points, you can set the two points to position of casting unit and position of targeted unit. Of course, that wouldn't work on flying units.
 
General chit-chat
Help Users

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top