HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

A Minor Problem With Stunning And Dummy Units

09-27-2008, 09:04 AM#1
moo^moo^cow
hey all, ive run into yet another spell problem. ill keep this simple and break this post down to the spell and the problem.

The Spell:
Windwalk Base spell, Creates a replica of the caster. When the caster breaks out of windwalk he deals extra damage and stuns the attacked unit.

The Problem:
When my hero breaks out of windwalk he creates a dummy unit thats given storm bolt and is ordered to storm bolt the attacked unit. the problem here is the dummy unit wont stun the attacked unit. seeing as the problem lies with the second trigger ill just post that.

Trigger:
Mushi Bunshin no Jutsu 2
Collapse Events
Unit - A unit Is attacked
Collapse Conditions
(((Attacking unit) is A Hero) Equal to True) and (((Attacking unit) has buff Mushi Bunshin no Jutsu ) Equal to True)
Collapse Actions
Unit - Create 1 Stun Dummy for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing (Facing of (Attacked unit)) degrees
Unit - Add Storm Bolt to (Last created unit)
Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Attacked unit)
Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
09-27-2008, 09:27 AM#2
Tide-Arc Ephemera
Does that dummy Stormbolt have a mana cost AND the dummy unit have no mana? That's usually the case.
09-27-2008, 09:46 AM#3
moo^moo^cow
ahahahahaha. oh god now i feel like such a tool. yeah that was the problem cheers +rep.
09-28-2008, 03:49 AM#4
Tide-Arc Ephemera
There IS a way to pick units in a line but it's rather lengthy in GUI, here's a leaky version of how it can be done:

Trigger:
Blah
Events
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 50, do (Actions)
Collapse Loop - Actions
Collapse Unit Group - Pick every unit in (Units within 50.00 of ((YourStartingPosition) offset by (((Distance between (Position of (YourStartingPosition)) and (Position of (YourFinishingPosition))) / 50.00) x (Real((Integer A)))) towards (YourFacingAngle) degrees)) and do (Actions)
Loop - Actions
09-28-2008, 04:30 AM#5
moo^moo^cow
yeah i was considering doing it that way but the only problem was that it either picks too many units or it misses some. But i guess i cant be too picky about it =/. i really wish blizzard would just let you pick units between two points, would make alot of lives easier.

Back on topic, is there a way to make that trigger not leak? do i need to set a variable which selects every unit with 50 units of a given point. and then null it at the end.

im a little n00b when it comes to memory leaks is there a guide that can help me how to null/delete variables?
09-28-2008, 06:21 AM#6
Anopob
Of course there is, just check the tutorials section, like this guide. Of course there are more so check it out when you can.
09-29-2008, 07:03 AM#7
moo^moo^cow
i used your example tide but for some reason its not quite doin what i was expecting it to. i did a leak free version of it where i made a unit group variable and then destroyed it after the trigger was finished and done with.

its meant to make 50 small points along my line and having each point select units within its 50 radius. my only problem is that sometimes it will damage those in the line but sometimes it wont. its really unpredictable. do you think you could check what's wrong with my trigger?