- Joined
- Jul 10, 2007
- Messages
- 6,306
implement N
call DummyCaster[orderId].cast()
instead of call DummyCaster[spellId].cast()
. (in the documentation) It is misleading. If you order a unit to perform an ability id, afaik it will just learn the spell if you have the skill points for it. (at least for issued orders with no-target)Private struct i is useless, just put the module in your active struct. It's private anyway.
If you upload a test-map so users can just copy+paste the dummy unit out of it from object editor (if they wish), this will be a much more portable library because of its soft learning curve. When I first got into unit indexing, the external blocks weren't even working so I was forced to c&p from the object editor.
It will cause smaller maps to crash because you are creating a unit at some huge-ass coordinates.
It won't work properly with abilities such as Thunder Clap and War Stomp because those affect units around the caster, and your caster sits at (32256, 32256) and cannot be moved.
It won't work with channeling spells or spells that have a casting time.
If you register, for example, two or more abilities based on Storm Bolt, then there is no way to cast them separately because they all share the same order. In other words, you are screwed.
I advise not being in such a hurry to submit resources that you don't even invest the time to properly document things. This has very little documentation and actually tells users nothing about the library unless they already know what a dummy caster is.
So did I, and guess what? The map crashed. If maps didn't crash when units went far off bounds, then why was BoundSentinel (and stuff similar to it) made?I tested on a small map.
I'm supposed to move the units that I want affected by Thunder Clap, War Stomp or Fan of Knives at (32256, 32256)? You're kidding, right?It will work with them... you're supposed to move the units to the caster, not the other way around.
If this is supposed to be used for reviving or stunning a single unit, then I see absolutely no point in it. The extra requirement is simply not worth it.
castTarget
and castPoint
methods to castOnTarget
and castOnPoint
respectively. It makes more sense, at least to me.unregister
method that removes the ability from the dummy, just like register
adds it.That's okay, and consider renaming your castTarget and castPoint methods to castOnTarget and castOnPoint respectively. It makes more sense, at least to me.
You can also add an unregister method that removes the ability from the dummy, just like register adds it.
SetUnitPosition(u, 32256.0, 32256.0)
to move it to the highest coordinates. SetUnitPosition()
does not let the unit go off bounds, but SetUnitX()
and SetUnitY()
do.unregister
either, but the user should be able to remove abilities from the dummy.If this is supposed to be used solely within stun/revival/etc. systems, then the user shouldn't even be doing that.The need for unregister is important due to order-id's being shared across
a lot of spells. Because of this, it would actually be good practice to simply
unregister instantly. But then there is the cost of recursion, because firing
the ability might trigger a spell event which then also tries to use the
dummy unit and then happens to share the same order id -_-
The need for unregister is important due to order-id's being shared across
a lot of spells. Because of this, it would actually be good practice to simply
unregister instantly. But then there is the cost of recursion, because firing
the ability might trigger a spell event which then also tries to use the
dummy unit and then happens to share the same order id -_-
Remember that many w3 internal spells have special effects added to them and most of the time the user would like to see them. So casting a spell towards a target that is 6000 units away would cause bugs.
Also no way to change the dummy's Z or any way to access the dummy at all. I would never use this.
Well a chain lightning for example would suck here.
local Dummy dummy = Dummy.create(etc)
call dummy.cast(spell) //etc
//etc
call dummy.destroy()
Check out my recycler in the GY.
Writing a simple recycler in this library shouldn't be so hard