HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Variables in Events

11-19-2002, 01:11 AM#1
Guest
<start of background info>
I am currently making a new spell via triggers. Why triggers you ask? Well, because it is the only way to kinda make new logic for a spell.
<end of background info>

The problem I ran into is that I can't seem to use a variable in an event. Something like
Unit - Within Range:
A unit comes within <range> of <unit>.

I can't use one of my real or integer variables for the range, and I can't use one of my unit variables for the unit. I tried making them arrays and not arrays (although that shouldn't matter) but it didn't help. It always has a greyed out box that says "No generated variables of this type" and next to it is the "select unit" button.

I can't even have it convert the position of a unit with the region size into a region because I can't select any of my unit variables.

<start of more background info>
What this is all for is a hunter missile for the WarStomp. I have gotten up to the part where a hero does a warstomp, I play an appropriate animation for whatever hero does it, and spifffy special effects. Then it targets (can be set to 1min 9max) random enemies (inside a range which can be set) and sets them as Unit[1] Unit[2] ect... Then the missiles are created as Unit[11], Unit[12] ect... and are told to attack that target.

What is supposed to happen is when the missile comes within <range> of the target, it will detonate on that spot (neutral goblin kaboom). I can't tell the missile as an order to detonate on the target unit because it can only be issued as an order on a point. I could just tell it to detonate at the point of the unit, but then the unit can just run away and not get hurt.
<end of more background info>
11-19-2002, 01:36 AM#2
MicrosoftXP
I also was just now trying to make a trigger with a variable in the even Unit - Specific Unit Event, but they dont let you select variables... I dont think wc3 is coded to allow variable events because imagine it would have to know every time the variable changed... (Not good)

Just try a workaround