HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Casting Illusion with triggers

01-07-2007, 02:23 AM#1
rulerofiron99
I know this may sound a bit noob, but im having problems ordering my unit to cast illusion through triggers.

I made a dummy unit with a unit form of the Item Illusions ability, and firstly tried to make it cast the spell on another unit. It had no use/turn on string, so i tried using charm as the string to activate it, but it didnt work either.

Please help, im too lazy to go and make one item and one ability for each level of this spell.
01-07-2007, 04:36 AM#2
karukef
I would answer your question but I'm too busy staring in disbelief at your list of progress.
01-07-2007, 05:43 AM#3
Panto
I made a map to demo how to cast spells that don't have id strings.

You should know that I have a great level of disgust for people who are too "lazy" to do something; I'm certainly not going to do any work for someone who can't be bothered to do it for himself. However, you're being lazy about doing something you really shouldn't be doing, as it's not the best solution by far, anyway, so I'm gonna let it slide this once.

It just so happens that the spell I used to demo is the illusion spell.

Understanding the solution will require you to play the map and then open it up and examine the triggers. Some knowledge of jass or the ability to pick up obvious programing trends will be necessary.

Here's the map.
01-07-2007, 09:12 AM#4
rulerofiron99
Thanks a lot for that demo, but after trying to get it to work for the last 15 minutes I'm out of options.

Here's my trigger:
Trigger:
EyeOfControl
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Eye of Control
Collapse Actions
Set tempPoint[0] = (Position of (Target unit of ability being cast))
Set tempGroup[0] = (Units within (150.00 + (50.00 x (Real((Level of Eye of Control for (Triggering unit)))))) of tempPoint[0] matching ((Owner of (Matching unit)) Equal to Player 12 (Brown)))
Collapse For each (Integer A) from 1 to (Number of units in tempGroup[0]), do (Actions)
Collapse Loop - Actions
Set tempUnit[0] = (Random unit from tempGroup[0])
Set tempPoint[1] = (Position of tempUnit[0])
Unit - Create 1 Eye of Control dummy caster for (Owner of (Triggering unit)) at tempPoint[1] facing Default building facing degrees
Unit - Set level of Eye Of Control illusion for (Last created unit) to (Level of Eye of Control for (Triggering unit))
Custom script: call IssueTargetOrderById( GetLastCreatedUnit(), 852274, udg_tempUnit[0] )
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_tempPoint[1])
Unit Group - Remove tempUnit[0] from tempGroup[0]
Custom script: call RemoveLocation(udg_tempPoint[0])
Custom script: call DestroyGroup(udg_tempGroup[0])

So basically what it does is create illusions of all enemy units nearby the target when it is used. It works fine to the point that it creates the dummy spellcasters, but then I just can't get them to cast the ability, no matter how much I tampered with the IssueTargetOrderById fuction.

It looks like if I were to use the item+hero combo for this it would have been done yesterday
01-07-2007, 09:53 AM#5
Pyrogasm
If the hero Illusion ability triggers an "a unit summons a unit" event, you might be able to do something with that, though I don't know what.
01-07-2007, 11:46 AM#6
rulerofiron99
No, the ability always triggers. I have changed the ability to mirror image the newly controlled unit instead (it works perfectly), but I just can't get anything to cast Illusion without using items.