HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

(Spell 2) - Area Effect Mirror Image

06-10-2006, 12:53 PM#1
Fulla
Ok, I honestly have no idea why this doesnt work, Ive tried to check every possible reason.

Sway Of Illusion - Creates an illusion of Caster + all nearby friendly units.

Trigger:
Sway Of Illusion
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Sway Of Illusion
Collapse Actions
Collapse Unit Group - Pick every unit in (Units within 500.00 of (Position of (Casting unit))) and do (Actions)
Collapse Loop - Actions
Unit - Create 1 Dummy Hero for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing (270.0) degrees
Hero - Create Dummy - Sway Of Illusion and give it to (Last created unit)
Hero - Order (Last created unit) to use (Last created item) on (Picked unit)
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)

- Originally I had conditions, but I took them away to try and get it working.
- Currently it WILL Create an illusion of caster but NOT of any other units.

> I have checked the dummy item/ability it works fine when casting on friendly units.
> I checked the Dummy Hero theres no problems there either.
(Removed Locust, Removed Dummy/Invisible Model)

Any help would be appreciated.
thank you
06-10-2006, 12:58 PM#2
MercyfulJester
Have you tried the other events, the "Begins Casting" and "Finishes Casting"?

Edit: Hmm silly me, of course it only creates the illusions of the casting unit. You'd have to make the spell target an area or something. Or create a dummy caster for each picked unit. Something like "For each (picked unit) do actions (Create Dummy Hero) (Order last created unit to use X on picked unit)" I guess.
06-10-2006, 01:24 PM#3
Soultaker
It's because if you order the same unit to copy fx. 6 different units, it will only take the last one, since it takes a bit of time for it to do the order.

Instead you should make a unit ability of the item ability. Create a caster for each unit which you then order to cast it on the picked unit.

I have used this like hundred times, so I'm pretty sure at this. :)

- Soultaker
06-10-2006, 01:33 PM#4
Vexorian
there is the little problem with item illusions not having an orderstring and requiring an order id instead so he would need JASS.


bad:
Unit - Create 1 Dummy Hero for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing (270.0) degrees

good:
Unit - Create 1 Dummy Hero for (Owner of (Casting unit)) at (Position of (Picked Unit)) facing Default building facing (270.0) degrees

Not really *good* though because it has memory leaks
06-10-2006, 03:27 PM#5
Soultaker
Quote:
Originally Posted by Vexorian
there is the little problem with item illusions not having an orderstring and requiring an order id instead so he would need JASS.


bad:
Unit - Create 1 Dummy Hero for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing (270.0) degrees

good:
Unit - Create 1 Dummy Hero for (Owner of (Casting unit)) at (Position of (Picked Unit)) facing Default building facing (270.0) degrees

Not really *good* though because it has memory leaks

I think "Sway of Illusion" (his ability) is not based on Item Illusion, so that won't be a problem. That is if I'm getting you right..

You are right about the orderID, you would have to either use JASS, Custom Script or WEU. But it's so little, so it shouldn't be a problem.

- Soultaker
06-10-2006, 03:37 PM#6
Fulla
The dummy ability is based of - item - illusion. (Not one hero initially casts).
I made an item with this ability.

Then gave item to dummy hero, ordered him to use it.
06-10-2006, 04:23 PM#7
Fulla
Sorry to dbl post, but it works now.

Trigger:
Sway Of Illusion
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Sway Of Illusion [Seer]
Collapse Actions
Set Ability_A_Seer_Sway_U = (Casting unit)
Collapse Unit Group - Pick every unit in (Units within 500.00 of (Position of Ability_A_Seer_Sway_U)) and do (Actions)
Collapse Loop - Actions
Unit Group - Add (Picked unit) to Ability_A_Seer_Sway_G
Collapse For each (Integer A) from 1 to (Number of units in Ability_A_Seer_Sway_G), do (Actions)
Collapse Loop - Actions
Unit - Create 1 Dummy Hero for (Owner of Ability_A_Seer_Sway_U) at (Position of Ability_A_Seer_Sway_U) facing Default building facing (270.0) degrees
Hero - Create Dummy - Sway Of Illusion and give it to (Last created unit)
Hero - Order (Last created unit) to use (Last created item) on (Random unit from Ability_A_Seer_Sway_G)
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Unit Group - Remove all units from Ability_A_Seer_Sway_G

The Random unit, is very strange as it only picks each unit once?
E.g. Hero casts next to - 1Priest/1Sorc/1Mortar/1Footman.

The spell will create an illusion for the hero & 1Priest/1Sorc/1Mortar/1Footman.

Its exactly what I wanted but I thought it randomly pick
06-10-2006, 05:31 PM#8
Freakazoid
Next time when you create a simmilar spell, convert it to jass and use rawcodes for the abilites.
06-10-2006, 05:55 PM#9
blu_da_noob
You only ever have one unit in that temporary group at a time, so it 'randomly' picks that unit every time.
06-11-2006, 04:25 AM#10
Pheonix-IV
Trigger:
Sway Of Illusion
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Sway Of Illusion [Seer]
Collapse Actions
Set Ability_A_Seer_Sway_U = (Casting unit)
Collapse Unit Group - Pick every unit in (Units within 500.00 of (Position of Ability_A_Seer_Sway_U)) and do (Actions)
Collapse Loop - Actions
Unit - Create 1 Dummy Hero for (Owner of Ability_A_Seer_Sway_U) at (Position of Picked Unit) facing Default building facing (270.0) degrees
Hero - Create Dummy - Sway Of Illusion and give it to (Last created unit)
Hero - Order (Last created unit) to use (Last created item) on (Picked Unit)
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)

Shorter and more effective. Though it has nasty memory leaks and it should really be using custom script rawcodes for an ability instead of items.