HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How can I store previous unit location in variable ??

10-15-2006, 04:52 PM#1
Jazzyfromhell
Do u believe me ?? I have try to make this skill work for 5 days and not yet to succeed. I have go search around , find many thread , but still need something more to go on.

This spell called Illuminate ( edit from blink spell ) - Blink and left illusion of caster behind at the previous location of caster to fool enemy .
It's similair with this http://www.wc3campaigns.net/showthre...blink+illusion

According to Anitarf 's post...
Question is I don't know how to store previous unit location before he cast blink ( In custom script)
. Also how to store any other (such as unit ) in variable .

This is my current work (combination of GUI and Custom Script ):
Trigger:
Illuminate
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to Illuminate
Collapse Actions
Custom script: local unit a = GetLastCreatedUnit()
Custom script: local unit b = GetTriggerUnit()
Unit - Create 1 Dummy for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
Unit - Add Item Illusions to (Last created unit)
Custom script: call IssueTargetOrderById(a, 852274, b)
Unit - Move (Last created unit) instantly to (Position of (Triggering unit)), facing (Target point of ability being cast)
10-15-2006, 04:56 PM#2
st33m
Trigger:
Unit - Move (Last created unit) instantly to (Position of (Triggering unit)), facing (Target point of ability being cast)

What is triggering unit?

EDIT: And anyway, give him the order and move him instantly perhaps? If you order the unit to do whatever, pause it, and then move it instantly, then unpause it, it should work.
10-15-2006, 05:00 PM#3
Fireeye
ok, 1st use "Unit - Starts the effect of an ability", because Begins Casting takes place before mana is reduced so you could cast the ability without any mana cost.
2nd you have 2 possibilitys to store the location. (if you don't want any leaks, but when you use the first you have to add another Custom script)
The first is a point variable (location), the second is you store the x and y value in 2 variables.
Should look like this way
Trigger:
Illuminate
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Illuminate
Collapse Actions
Custom script: local unit a = GetLastCreatedUnit()
Custom script: local unit b = GetTriggerUnit()
set temp_point = Position of (Triggering Unit)
Unit - Create 1 Dummy for (Owner of (Casting unit)) at temp_point facing Default building facing degrees
Unit - Add Item Illusions to (Last created unit)
Custom script: call IssueTargetOrderById(a, 852274, b)
Unit - Move (Last created unit) instantly to temp_point, facing (Target point of ability being cast)
Custom script: call RemoveLocation(udg_temp_point)
10-15-2006, 06:09 PM#4
Jazzyfromhell
Answer to st33m : That trigger unit is the caster of illuminate spell ( If it really being that ).

I just know that I has to use " start the effect of ability " , not " ability being cast " . Thanks .

And what about removing Dummy . I think I cannot use Last Created Unit , because it may detect Last Created Unit as an Illusion , not dummy .

============================================
10-15-2006, 06:23 PM#5
Fireeye
Uhm, add an expiration timer directly after the create dummy refering to the last created unit, like this.
Trigger:
Illuminate
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Illuminate
Collapse Actions
Custom script: local unit a = GetLastCreatedUnit()
Custom script: local unit b = GetTriggerUnit()
set temp_point = Position of (Triggering Unit)
Unit - Create 1 Dummy for (Owner of (Casting unit)) at temp_point facing Default building facing degrees
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Unit - Add Item Illusions to (Last created unit)
Custom script: call IssueTargetOrderById(a, 852274, b)
Unit - Move (Last created unit) instantly to temp_point, facing (Target point of ability being cast)
Custom script: call RemoveLocation(udg_temp_point)
10-15-2006, 06:34 PM#6
Jazzyfromhell
Sorry .but It's doesn't not work yet . Sometime the dummy rotate and facing to caster 's blinked location but do not create illusion ,but sometime he create. Its look like the dummy can't keep up with the caster.

But When I add expiraion timer to dummy ( I have add more 2 second) . He never create an illusion .

UPDATE : I check on him . He get "Item Illusion" abillity but ignore to cast it .

Note : I make my dummy have some Art - model file and remove locust abillity form him , so I can see what he doing
10-15-2006, 06:53 PM#7
The)TideHunter(
What?
Custom script: local unit a = GetLastCreatedUnit()
Custom script: local unit b = GetTriggerUnit()

Are both pointless, totally pointless.

Simple blink spell (with illusion):

Trigger:
Illuminate
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to Illuminate
Collapse Actions
Set TempPoint = (Target point of ability being cast)
Set TempPoint2 = (Position of (Triggering unit))
Unit - Create 1 Dummy for (Owner of (Triggering unit)) at TempPoint2 facing TempPoint
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
Hero - Create Item Illusions and give it to (Last created unit)
Custom script: call IssueTargetOrderById(GetLastCreatedUnit(), 852274, GetTriggerUnit())
Custom script: call RemoveLocation(udg_TempPoint)
Custom script: call RemoveLocation(udg_TempPoint2)
Btw, use starts ability, but only for this situation, its a way to get both locations, rather than once the unit has actually moved.
But this method could be spammed.
10-15-2006, 07:11 PM#8
Jazzyfromhell
Well, He get Wand of Illusion item ( I check by click on the dummy ) , but still don't use it. I don't get it.

And Tidehunter... Did you forget to use TempPoint ?? (you use only TempPoint2)
10-15-2006, 08:30 PM#9
The)TideHunter(
Have you made sure the wand dosent cost mana, or other small problems like that?
Are you sure the order Id is 852274 for Wand of Illusion?

And i do use TempPoint

Unit - Create 1 Dummy for (Owner of (Triggering unit)) at TempPoint2 facing TempPoint
10-15-2006, 08:46 PM#10
Jazzyfromhell
Yes , before that , I use " Item Illusion " (This is a ability not an item ) which code is 852274 . I have change it to 852008 which is Wand of Illusion (item) 's code. And It doesn't cost any mana .

Sorry for didn't notice that TempPoint.

UPDATE : I test it again , The dummy finally cast his illusion spell . The only thing that need to finish is moving illusion to TempPoint2.

Thank a lot.